Die Bindung an system.serviceModel/bindings/wsHttpBinding keine Fehler...
Ich versuche, um zwei Endpunkte in meinem WCF-web-basierte service - wsHttp und netTcp.
Wie gezeigt, in der Web.config
unten habe ich Hinzugefügt, aber die folgende Fehlermeldung wenn ich es kompilieren, und klicken Sie auf Service.svc in meinem web-browser:
Fehler Seite:
Server Error in '/MyService' Application. Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: The binding at system.serviceModel/bindings/wsHttpBinding does not have a configured binding named 'wsHttpBinding'. This is an invalid value for bindingConfiguration.
Source Error:
Line 16: </baseAddresses> Line 17: </host> Line 18: <endpoint address="http://localhost:8090/Services/MyService" Line 19: binding="wsHttpBinding" Line 20: bindingConfiguration="wsHttpBinding"
Source File: C:\MyService\web.config Line: 18
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
Web.config:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="false" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<protocolMapping>
<add scheme="http" binding="wsHttpBinding"/>
</protocolMapping>
<services>
<service
name="Microsoft.ServiceModel.Samples.MyService">
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:9001/"/>
</baseAddresses>
</host>
<endpoint address="http://localhost:8090/Services/MyService"
binding="wsHttpBinding"
bindingConfiguration="wsHttpBinding"
name="MyService_WsHttp"
contract="Microsoft.ServiceModel.Samples.IService" />
<endpoint address="net.tcp://localhost:9000/Services/MyService"
binding="netTcpBinding"
bindingConfiguration="tcpBinding"
name="MyService_Tcp"
contract="Microsoft.ServiceModel.Samples.IService" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
InformationsquelleAutor Bob | 2012-03-24
Du musst angemeldet sein, um einen Kommentar abzugeben.
nehmen:
hier:
markieren Sie bitte als Antwort, wenn es geklappt hat - Grund dafür ist, dass, wenn Sie 'out of the box' - Bindungen (wie Sie...), dann hast du nicht alle änderungen an der Konfiguration - die dieses Attribut zeigen soll.
Wenn ich "wsHttpBinding", heißt es Vertrag verwenden müssen DualHttpBinding ?!
entwickeln Sie ein duplex-service?
Sorry für die späte Antwort . Ja Chris
InformationsquelleAutor Chris
Ich weiß nicht, was Sie haben, richtig beantworten die Frage, die ich bin sicher, dass er umsetzen will, der
eine verbindliche Konfiguration so entfernen, sondern
bindingConfiguration="wsHttpBinding
, so stellen Sie sicher, dass die Bindung in Ihre und Punkt übereinstimmen, die in Ihrem configure-Datei.Hoffe, dass diese Arbeit
e.g:
InformationsquelleAutor Greko2015 GuFn