2011-08-10 6 views
11

Todo lo demás funciona bien, puedo hacer llamadas SOAP y RESTful sin problema a través de https. Pero WSDL siempre regresa en blanco (solicitud incorrecta). HTTP devuelve WSDL bien.IIS 7.5 Wcf https WSDL siempre devuelve en blanco (solicitud incorrecta)

registro de seguimiento de los informes de excepción interiores:

The body of the message cannot be read because it is empty. 

etiqueta serviceMetaData se establece:

<serviceMetadata 
httpGetEnabled="true" 
policyVersion="Policy15" 
httpsGetEnabled="true" /> 

secciones Web.config Encuadernación:

<bindings> 
     <basicHttpBinding> 
      <binding name="soapBinding"> 
       <security mode="None"> 
       </security> 
      </binding> 
     </basicHttpBinding> 
     <webHttpBinding> 
      <binding name="webBinding"> 
       <security mode="None"> 
       </security> 
      </binding> 
     </webHttpBinding> 
    </bindings> 

Usted se dará cuenta de inmediato el modo de seguridad = "Ninguno"

Via ServiceHostFactory veo el modo de transportar como:

 ServiceHost serviceHost = new ServiceHost(service.GetType(), baseAddresses); 

     if (ExposeSSL(baseAddresses[0])) 
     { 
      foreach (var endpoint in serviceHost.Description.Endpoints) 
      { 
       if (endpoint.Binding is WebHttpBinding) 
       { 
        ((WebHttpBinding)endpoint.Binding).Security.Mode = WebHttpSecurityMode.Transport; 
        endpoint.Address = new EndpointAddress(baseAddresses[0].ToString().Replace("http", "https")); 
       } 
       if (endpoint.Binding is BasicHttpBinding) 
       { 
        ((BasicHttpBinding)endpoint.Binding).Security.Mode = BasicHttpSecurityMode.Transport; 
        endpoint.Address = new EndpointAddress(baseAddresses[0].ToString().Replace("http", "https")); 
       } 
      } 

configuración de Servicios:

 <service name="xxxx.Wcf.AdminJsonService" behaviorConfiguration="DefaultBehaviour"> 
      <host> 
       <baseAddresses> 
        <!-- note, choose an available port--> 
        <add baseAddress="http://localhost:62701/json"/> 
       </baseAddresses> 
      </host> 
      <!-- Service Endpoints --> 
      <endpoint address="" binding="webHttpBinding" bindingConfiguration="webBinding" behaviorConfiguration="jsonBehavior" bindingNamespace="https://www.xxxx/WebService4/AdminJsonService" contract="xxxx.Wcf.IAdminJsonService"/> 
     </service> 

     <service name="xxxx.Wcf.AdminXmlService" behaviorConfiguration="DefaultBehaviour"> 
      <host> 
       <baseAddresses> 
        <!-- note, choose an available port--> 
        <add baseAddress="http://localhost:62701/xml"/> 
       </baseAddresses> 
      </host> 
      <!-- Service Endpoints --> 
      <endpoint address="" binding="webHttpBinding" bindingConfiguration="webBinding" behaviorConfiguration="poxBehavior" bindingNamespace="https://www.xxx/WebService4/AdminXmlService" contract="xxxx.Wcf.IAdminXmlService"/> 
     </service> 

     <service name="xxxx.Wcf.AdminSoapService" behaviorConfiguration="DefaultBehaviour"> 
      <!-- Service Endpoints --> 
      <endpoint binding="basicHttpBinding" behaviorConfiguration="soapBehavior" bindingNamespace="https://www.example.com/WebService4/AdminSoapService" contract="xxxx.Wcf.IAdminSoapService"/> 
      <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
     </service> 

punto final comportamientos

  <!-- SOAP --> 
      <behavior name="soapBehavior"> 
      </behavior> 
      <!-- JSON --> 
      <behavior name="jsonBehavior"> 
       <webHttp/> 
      </behavior> 
      <!-- POX --> 
      <behavior name="poxBehavior"> 
       <webHttp/> 
      </behavior> 

Servicio Comportamientos

  <behavior name="ErrorBehaviour"> 
       <serviceDebug includeExceptionDetailInFaults="true"/> 
      </behavior> 
      <behavior name="DefaultBehaviour"> 
       <NiceErrorHandler/> 
       <!-- 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"/> 

       <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> 
       <serviceMetadata 
        httpGetEnabled="true" 
        policyVersion="Policy15" 
        httpsGetEnabled="true" /> 
      </behavior> 

También tienen

<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/> 

Alguien tiene idea de por qué esto puede estar ocurriendo?

+0

¿Has descubierto esto? –

+1

¿Puede mostrar la URL de la solicitud WSDL? –

+0

He votado negativamente esta pregunta porque ¡el asker no ha respondido estas preguntas en una semana! –

Respuesta

0

¿Intentó apagar uno de los otros puntos finales? En mi caso, WCF no funcionó hasta que deshabilité uno de los puntos finales. No importa cuál desactivé. Los otros trabajarían.

<services> 
     <service name="GTW.TrendToolService" behaviorConfiguration="MyServiceBehavior"> 
     <!--<endpoint name="rest" address="" binding="webHttpBinding" contract="TT.ITrendtoolService" behaviorConfiguration="restBehavior"/>--> 
     <endpoint name="json" address="json" binding="webHttpBinding" behaviorConfiguration="jsonBehavior" contract="GTW.IAqvService" /> 
     <endpoint name="xml" address="xml" binding="webHttpBinding" behaviorConfiguration="restBehavior" contract="GTW.IAqvService" /> 
     <!--<endpoint name="mex" address="mex" binding="mexHttpBinding" contract="GTW.IAqvService" /> 
     <endpoint name="soap" address="soap" binding="basicHttpBinding" contract="GTW.IAqvService" />--> 
     </service> 
    </services> 
<behaviors> 
    <serviceBehaviors> 
    <behavior name="MyServiceBehavior"> 
     <serviceMetadata httpGetEnabled="true" /> 
     <serviceDebug includeExceptionDetailInFaults="true" /> 
    </behavior> 
    </serviceBehaviors> 
    <endpointBehaviors> 
    <behavior name="restBehavior"> 
     <webHttp /> 
    </behavior> 
    <behavior name="jsonBehavior"> 
     <enableWebScript /> 
    </behavior> 
    </endpointBehaviors> 
</behaviors> 
0

Creo que su problema va a estar relacionado con la sección de comportamientos de su servicio. Específicamente le dijo a .net que publique su WSDL en HTTP pero no en HTTPS. Intente lo siguiente

 <behavior name="DefaultBehaviour"> 
      <NiceErrorHandler/> 
      <!-- 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"/> 

      <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> 
      <serviceMetadata 
       httpGetEnabled="true" 
       httpsGetEnabled="true" 
       policyVersion="Policy15" 
       httpsGetEnabled="true" /> 
     </behavior> 

Tenga en cuenta la línea adicional en el servicio Los metadatos que se refieren a httpsGet en comparación con http.

asumiré que https está activada tanto en los enlaces y en su aplicación, dado que se puede ver el WSDL http en lugar de algún enorme murmullo acerca de no ser capaz de encontrar las consolidaciones o algo ...

0

Cuando están haciendo el cifrado de transporte. Usted tiene que agregar los correos electrónicos a su protocolo de dirección base, por ejemplo: < add baseAddress = "https: // localhost: 62701/xml" /> o < add baseAddress = "http: // localhost: 62701/json "/>

Cuestiones relacionadas