WCF nicht finden können, die endpoint-Konfiguration Problem

Ich habe einen webservice mit WCF Teste ich auf meinem lokalen Rechner, das ist mir headscratcher.

Mein service wird konfiguriert wie folgt:

<system.serviceModel>
   <services>
      <service name="GHMDatroseIntegration.GHMDatroseWCFService.DatroseService" 
               behaviorConfiguration="DatroseServiceBehavior">
         <endpoint 
             address="mex"
             binding="basicHttpBinding" 
             contract="GHMDatroseIntegration.GHMDatroseWCFService.IDatroseService" />
      </service>
   </services>
   <behaviors>
      <serviceBehaviors>
         <behavior name="DatroseServiceBehavior">
            <serviceMetadata httpGetEnabled="true"/>
            <serviceDebug includeExceptionDetailInFaults="true"/>
            <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
         </behavior>
      </serviceBehaviors>
   </behaviors>
   <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>

Mein client konfiguriert ist, etwa so:

<system.serviceModel>
   <bindings>
      <basicHttpBinding>
         <binding name="BasicHttpBinding_IDatroseService" 
             closeTimeout="00:02:00" openTimeout="00:01:00" 
             receiveTimeout="00:10:00" sendTimeout="00:02:00"
             allowCookies="false" bypassProxyOnLocal="false" 
             hostNameComparisonMode="StrongWildcard"
             maxBufferSize="524288" maxBufferPoolSize="524288" 
             maxReceivedMessageSize="524288" 
             messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
             useDefaultWebProxy="true">
            <readerQuotas 
                 maxDepth="32" maxStringContentLength="524288" 
                 maxArrayLength="524288" maxBytesPerRead="524288" 
                 maxNameTableCharCount="524288" />
            <security mode="None">
                 <transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
                 <message clientCredentialType="UserName" algorithmSuite="Default" />
            </security>
         </binding>
      </basicHttpBinding>
   </bindings>
   <client>
       <endpoint name="BasicHttpBinding_IDatroseService"
           address="http://localhost/DatroseWCFService/DatroseService.svc"  
           behaviorConfiguration="DatroseServiceBehavior"
           binding="basicHttpBinding"  
           bindingConfiguration="BasicHttpBinding_IDatroseService"
           contract="DatroseWCFService.IDatroseService"  />
   </client>
   <behaviors>
      <endpointBehaviors>
         <behavior name="DatroseServiceBehavior">
             <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
         </behavior>
      </endpointBehaviors>
   </behaviors>
 </system.serviceModel>

Die Fehler ich erhalte, ist:

Es wurde kein Endpunkt hören auf http://localhost/DatroseWCFService/DatroseService.svc könnte
die Nachricht akzeptiert. Dies ist oft aufgrund einer falschen Adresse oder
SOAP-Aktion. Sehen InnerException, falls vorhanden, für weitere details.

... und doch, wenn ich navigieren Sie zu dem Speicherort bekomme ich den Bildschirm, so erscheint es sinnvoll eingesetzt werden.

Ich bin sicher, dass dies hat zu tun mit meiner Konfiguration der Endpunkte, aber ich kann nicht herausfinden, was Sie sind, Aussehen soll. Etwas Hilfe wäre hier sehr geschätzt.

UPDATE whups ich die falsche Fehlermeldung. Es ist jetzt behoben.

UPDATE 2 pro, was ich glaube, ist vorgeschlagen worden, die an diesen Reaktionen habe ich geändert meine server config :

<system.serviceModel>
   <services>
      <service name="GHMDatroseIntegration.GHMDatroseWCFService.DatroseService" 
               behaviorConfiguration="DatroseServiceBehavior">
         <endpoint 
             address="/svc"
             binding="basicHttpBinding"
             contract="GHMDatroseIntegration.GHMDatroseWCFService.IDatroseService"  />
         <endpoint 
             address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
       </service>
   </services>
   <behaviors>
       <serviceBehaviors>
          <behavior name="DatroseServiceBehavior">
             <serviceMetadata httpGetEnabled="true"/>
             <serviceDebug includeExceptionDetailInFaults="true"/>
             <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
          </behavior>
       </serviceBehaviors>
   </behaviors>
   <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>

und meine client-Konfiguration:

<system.serviceModel>
   <bindings>
      <basicHttpBinding>
         <binding name="BasicHttpBinding_IDatroseService" 
             closeTimeout="00:02:00" openTimeout="00:01:00" 
             receiveTimeout="00:10:00" sendTimeout="00:02:00"
             allowCookies="false" bypassProxyOnLocal="false" 
             hostNameComparisonMode="StrongWildcard"
             maxBufferSize="524288" maxBufferPoolSize="524288" 
             maxReceivedMessageSize="524288"
             messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
             useDefaultWebProxy="true">
          <readerQuotas 
              maxDepth="32" maxStringContentLength="524288" maxArrayLength="524288"
              maxBytesPerRead="524288" maxNameTableCharCount="524288" />
          <security mode="None">
              <transport clientCredentialType="None" proxyCredentialType="None"
                        realm="" />
              <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
       </binding>
     </basicHttpBinding>
   </bindings>
   <client>
      <endpoint name="BasicHttpBinding_IDatroseService" 
          address="http://localhost/DatroseWCFService/DatroseService.svc/svc" 
          behaviorConfiguration="DatroseServiceBehavior"
          binding="basicHttpBinding" 
          bindingConfiguration="BasicHttpBinding_IDatroseService"
          contract="DatroseWCFService.IDatroseService" />
   </client>
   <behaviors>
      <endpointBehaviors>
         <behavior name="DatroseServiceBehavior">
            <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
         </behavior>
      </endpointBehaviors>
   </behaviors>
</system.serviceModel>

und wenn ich diese ausführe bekomme ich jetzt einen 400 (ungültige Anforderung) Fehler. Ich bin nicht sicher, ob das ein Schritt vorwärts oder einen Schritt zurück. Habe erstellte ich ein neues problem, oder habe ich räumte mein Weg zum nächsten problem?

UPDATE 3

Auf niao' Rat, änderte ich dies für die server-config:

<system.serviceModel>
    <services>
        <service name="GHMDatroseIntegration.GHMDatroseWCFService.DatroseService" behaviorConfiguration="DatroseServiceBehavior">
            <endpoint contract="GHMDatroseIntegration.GHMDatroseWCFService.IDatroseService" binding="basicHttpBinding" address="http://localhost/DatroseWCFService/DatroseService.svc"/>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        </service>
    </services>
    <behaviors>
        <serviceBehaviors>
            <behavior name="DatroseServiceBehavior">
                <!-- 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="true"/>
                <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>

...aber, wenn ich stöberte an diese Adresse, bekam ich einen gelben Bildschirm des Todes:

Server Error in '/DatroseWCFService' Anwendung.

Wenn " system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled'
auf true gesetzt wird in der Konfiguration der Endpunkte, die erforderlich sind, um anzugeben,
eine relative Adresse. Wenn Sie die Angabe einer relativen hören URI auf die
Endpunkt, dann die Adresse kann absolut sein. Um dieses problem zu beheben,
geben Sie einen relativen uri für den Endpunkt
'http://localhost/DatroseWCFService/DatroseService.svc'.

...also, ich habe versucht, es mit einem relativen Pfad wie folgt:

<endpoint 
   address="localhost/DatroseWCFService/DatroseService.svc"
   binding="basicHttpBinding" 
   contract="GHMDatroseIntegration.GHMDatroseWCFService.IDatroseService" />

... aber nach der Veröffentlichung, dass, bekomme ich den 404 Fehler. Die client-endpoint konfiguriert ist, als solche:

<endpoint name="BasicHttpBinding_IDatroseService"
    address="http://localhost/DatroseWCFService/DatroseService.svc" 
    behaviorConfiguration="DatroseServiceBehavior"
    binding="basicHttpBinding" 
    bindingConfiguration="BasicHttpBinding_IDatroseService"
    contract="DatroseWCFService.IDatroseService"  />

UPDATE 4
Pro marc_s' Rat, ich entfernt die Bindung config vom client, also meine config sieht wie folgt aus:

<system.serviceModel>
    <client>
        <endpoint address="http://localhost/DatroseWCFService/DatroseService.svc" behaviorConfiguration="DatroseServiceBehavior"
         binding="basicHttpBinding" 
         contract="DatroseWCFService.IDatroseService" name="BasicHttpBinding_IDatroseService" />
    </client>
    <behaviors>
        <endpointBehaviors>
            <behavior name="DatroseServiceBehavior">
                <dataContractSerializer maxItemsInObjectGraph="10000000"/>
            </behavior>
        </endpointBehaviors>
    </behaviors>
</system.serviceModel>

und meine Serverkonfiguration sieht so aus:

<system.serviceModel>
    <services>
        <service name="GHMDatroseIntegration.GHMDatroseWCFService.DatroseService" behaviorConfiguration="DatroseServiceBehavior">
            <endpoint contract="GHMDatroseIntegration.GHMDatroseWCFService.IDatroseService" binding="basicHttpBinding" address=""/>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        </service>
    </services>
    <behaviors>
        <serviceBehaviors>
            <behavior name="DatroseServiceBehavior">
                <serviceMetadata httpGetEnabled="true"/>
                <serviceDebug includeExceptionDetailInFaults="true" httpsHelpPageEnabled="true" httpHelpPageEnabled="true"/>
                <dataContractSerializer maxItemsInObjectGraph="10000000"/>
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>

Ich bekomme nicht mehr die 404-Fehler.

Jedoch, ich bekomme eine 400 (ProtocolException, Bad Request) keine erbauliche Informationen, was Sie bekam oder warum es schlecht ist. Ich erwarte habe ich weiter als das Endpunkt-Problem, in eine völlig neue void-of-service-Konfiguration Hölle.

UPDATE 5

Pro Anfrage, das "Skelett" von meinem service (ich nehme an, die Schnittstelle zu tun?):

[ServiceContract]
public interface IDatroseService
{

    [OperationContract]
    bool SubmitPayableTransaction(List<InvoiceItem> invoices);

    [OperationContract]
    Dictionary<string, bool> ValidateAccounts(List<string> accounts);

    [OperationContract]
    Dictionary<string, int> GetVendor1099Types(List<string> vendors);

    [OperationContract]
    Dictionary<string, string> GetPaymentTerms(List<string> vendors);

}
Ihr webservice auf port 80?!?
Ich lief in dieses Problem. Ein hilfreiches Element ist die Verwendung von fiddler. Es kann Anfrage ein crossdomainpolicy.xml (name vielleicht ein Stück anders) , wird verursachen. Auch habe ich falsch konfiguriert, meine Datenbank Verbindung und warf einen Fehler aus, und daher der service war nicht zu hören. Versuchen, für diese Arten von Gegenständen zu sehen, ob dies die Ursache dafür ist. Ihre Konfiguration der service könnte richtig sein, aber etwas anderes falsch sein könnte.
Ich habe einen Endpunkt definiert (siehe config)... meinst du definieren?
das funktioniert nicht; When 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' is set to true in configuration, the endpoints are required to specify a relative address. If you are specifying a relative listen URI on the endpoint, then the address can be absolute. To fix this problem, specify a relative uri for endpoint 'http://localhost/DatroseWCFService/DatroseService.svc'.
legen Sie die folgenden in der server config Datei: <serviceHostingEnvironment multipleSiteBindingsEnabled="false" />

InformationsquelleAutor Jeremy Holovacs | 2012-02-06

Schreibe einen Kommentar