Anpassung der web.config für sWALL Version 9.10

Geändert am Mi, 10 Jun um 10:07 VORMITTAGS

Im Zuge der Umstellung der Anwendung sWALL auf eine REST‑basierte Architektur war eine Anpassung der web.config erforderlich. Im Folgenden werden die vorgenommenen Änderungen nachvollziehbar dokumentiert.


Zunächst wurde im Bereich <system.web> die .NET-Version aktualisiert. Dazu wurden die Einstellungen in den Abschnitten <compilation> sowie <httpRuntime> angepasst und auf .NET Framework 4.8 hochgesetzt. Diese Änderung ist Voraussetzung für den Betrieb der neuen REST‑Schnittstellen sowie für die Nutzung aktueller Bibliotheken.


<system.web>
  <compilation debug="true" strict="false" explicit="true" targetFramework="4.8"/>
  <httpRuntime targetFramework="4.8" maxRequestLength="1048576"/>
  <httpModules>
    <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"/>
  </httpModules>
</system.web>


Anschließend wurde im Abschnitt <system.serviceModel><bindings> ein zusätzliches webHttpBinding ergänzt. Dieses Binding wird für die REST‑Services benötigt. 


<webHttpBinding>
  <binding name="WebHttpBinding">
    <security mode="Transport">
      <transport clientCredentialType="InheritedFromHost"/>
    </security>
    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" />
  </binding>
</webHttpBinding>

Im nächsten Schritt wurde im Bereich <system.serviceModel><services> eine neue Service‑Definition für die REST‑Services ergänzt. Dabei handelt es sich um den Service SAmAs.sWALL.Web.WCF.sWALLRest.


<service name="SAmAs.sWALL.Web.WCF.sWALLRest">
	<endpoint address="/Dokumente" binding="webHttpBinding" bindingConfiguration="WebHttpBinding" behaviorConfiguration="RestBehavior" name="Dokumente" contract="SAmAs.sWALL.Web.WCF.ISvcDokumente"/>
	<endpoint address="/Arbeitgeber" binding="webHttpBinding" bindingConfiguration="WebHttpBinding" behaviorConfiguration="RestBehavior" name="Arbeitgeber" contract="SAmAs.sWALL.Web.WCF.ISvcArbeitgeber"/>
	<endpoint address="/Fertigungsauftrag" binding="webHttpBinding" bindingConfiguration="WebHttpBinding" behaviorConfiguration="RestBehavior" name="Fertigungsauftrag" contract="SAmAs.sWALL.Web.WCF.ISvcFertigungsauftrag"/>
	<endpoint address="/Einsatzzeit" binding="webHttpBinding" bindingConfiguration="WebHttpBinding" behaviorConfiguration="RestBehavior" name="Einsatzzeit" contract="SAmAs.sWALL.Web.WCF.ISvcEinsatzzeit"/>
	<endpoint address="/Interview" binding="webHttpBinding" bindingConfiguration="WebHttpBinding" behaviorConfiguration="RestBehavior" name="Interview" contract="SAmAs.sWALL.Web.WCF.ISvcInterview"/>
	<endpoint address="/Tagesliste" binding="webHttpBinding" bindingConfiguration="WebHttpBinding" behaviorConfiguration="RestBehavior" name="Tagesliste" contract="SAmAs.sWALL.Web.WCF.ISvcTagesliste"/>
	<endpoint address="/Einstellungen" binding="webHttpBinding" bindingConfiguration="WebHttpBinding" behaviorConfiguration="RestBehavior" name="Einstellungen" contract="SAmAs.sWALL.Web.WCF.ISvcEinstellungen"/>
	<endpoint address="/Abteilung" binding="webHttpBinding" bindingConfiguration="WebHttpBinding" behaviorConfiguration="RestBehavior" name="Abteilung" contract="SAmAs.sWALL.Web.WCF.ISvcAbteilung"/>
	<endpoint address="/Ansprechpartner" binding="webHttpBinding" bindingConfiguration="WebHttpBinding" behaviorConfiguration="RestBehavior" name="Ansprechpartner" contract="SAmAs.sWALL.Web.WCF.ISvcAnsprechpartner"/>
	<endpoint address="/Proband" binding="webHttpBinding" bindingConfiguration="WebHttpBinding" behaviorConfiguration="RestBehavior" name="Proband" contract="SAmAs.sWALL.Web.WCF.ISvcProband"/>
	<endpoint address="/Befunde" binding="webHttpBinding" bindingConfiguration="WebHttpBinding" behaviorConfiguration="RestBehavior" name="Befunde" contract="SAmAs.sWALL.Web.WCF.ISvcBefunde"/>
	<endpoint address="/Benutzer" binding="webHttpBinding" bindingConfiguration="WebHttpBinding" behaviorConfiguration="RestBehavior" name="Benutzer" contract="SAmAs.sWALL.Web.WCF.ISvcBenutzer"/>
	<endpoint address="/Unterweisungen" binding="webHttpBinding" bindingConfiguration="WebHttpBinding" behaviorConfiguration="RestBehavior" name="Unterweisungen" contract="SAmAs.sWALL.Web.WCF.ISvcUnterweisungen"/>
	<endpoint address="/Untersuchung" binding="webHttpBinding" bindingConfiguration="WebHttpBinding" behaviorConfiguration="RestBehavior" name="Untersuchung" contract="SAmAs.sWALL.Web.WCF.ISvcUntersuchung"/>
	<endpoint address="/Mandant" binding="webHttpBinding" bindingConfiguration="WebHttpBinding" behaviorConfiguration="RestBehavior" name="Mandant" contract="SAmAs.sWALL.Web.WCF.ISvcMandant"/>
	<endpoint address="/Allgemein" binding="webHttpBinding" bindingConfiguration="WebHttpBinding" behaviorConfiguration="RestBehavior" name="Allgemein" contract="SAmAs.sWALL.Web.WCF.ISvcAllgemein"/>
	<endpoint address="/Lizenzierung" binding="webHttpBinding" bindingConfiguration="WebHttpBinding" behaviorConfiguration="RestBehavior" name="Lizenzierung" contract="SAmAs.sWALL.Web.WCF.ISvcLizenzierung"/>
	<endpoint address="/Datei" binding="webHttpBinding" bindingConfiguration="WebHttpBinding" behaviorConfiguration="RestBehavior" name="Datei" contract="SAmAs.sWALL.Web.WCF.ISvcDatei"/>
	<endpoint address="/Statistik" binding="webHttpBinding" bindingConfiguration="WebHttpBinding" behaviorConfiguration="RestBehavior" name="Statistik" contract="SAmAs.sWALL.Web.WCF.ISvcStatistik"/>
</service>


Damit die REST‑Endpunkte korrekt arbeiten, wurde im Abschnitt <system.serviceModel><behaviors> zusätzlich der Bereich <endpointBehaviors> ergänzt. Hier wurde das Behavior RestBehavior definiert, welches das <webHttp />‑Element enthält und somit die REST‑Funktionalität für die Endpoints aktiviert.


<endpointBehaviors>
  <behavior name="RestBehavior">
    <webHttp/>
  </behavior>
</endpointBehaviors>


Mit dem Update ab Version 10 ist es zwingend erforderlich, den gesamten <assemblyBinding>‑Abschnitt vollständig zu aktualisieren


<assemblyBinding
  xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="Microsoft.AI.Agent.Intercept" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
    <bindingRedirect oldVersion="0.0.0.0-2.0.7.0" newVersion="2.0.7.0"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
    <bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
    <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
    <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
    <bindingRedirect oldVersion="0.0.0.0-6.0.0.1" newVersion="6.0.0.1"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Text.Encodings.Web" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
    <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="Microsoft.IdentityModel.Abstractions" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
    <bindingRedirect oldVersion="0.0.0.0-7.0.3.0" newVersion="7.0.3.0"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Security.Cryptography.ProtectedData" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    <bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    <bindingRedirect oldVersion="0.0.0.0-4.0.4.1" newVersion="4.0.4.1"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
    <bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
    <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0"/>
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Runtime.Serialization.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
    <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0"/>
  </dependentAssembly>
</assemblyBinding>

War dieser Artikel hilfreich?

Das ist großartig!

Vielen Dank für das Feedback

Leider konnten wir nicht helfen

Vielen Dank für das Feedback

Wie können wir diesen Artikel verbessern?

Wählen Sie wenigstens einen der Gründe aus
CAPTCHA-Verifikation ist erforderlich.

Feedback gesendet

Wir wissen Ihre Bemühungen zu schätzen und werden versuchen, den Artikel zu korrigieren