mardi 14 juin 2016

Non-specific error when trying to get data from the data source (SOAP)

I have SharePoint Online platform and I want to connect to a SOAP datasource using SharePoint Designer (a web service that I've made), but I'm getting this error when loading in a page:

"The server returned a non-specific error when trying to get data from the data source. Check the format and content of your query and try again. If the problem persists, contact the server administrator"

The real problem is that I don't know where possibly the error is. I thought the error was in my WCF Web Service but it just works fine when I debug it in SOAP tests like: http://wsdlbrowser.com

Then I thought the problem was with SharePoint itself, but when I try to add another random WSDL file (found it on internet), it works as just as expected: http://www.webservicex.net/CurrencyConvertor.asmx?WSDL

So I got stuck at this point: is it a problem with my web.config or something? There's a way to compare these two wsdl files (mine and CurrencyConvertor) to understand what is the difference between them? I couldn't figure it out.

My web service is running through SSL (but I've tested either http or https and no changes) and my web.config file is as follows:

<system.serviceModel> 
    <bindings>
      <basicHttpBinding>
        <binding name="basicHttpEndpointBinding">
          <security mode="Transport">
            <transport clientCredentialType="None" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="OSG.WCFService.AniversarianteBehavior">
            <serviceMetadata httpsGetEnabled="true"/>
            <useRequestHeadersForMetadataAddress/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service name="OSG.WCFService.Aniversariante" behaviorConfiguration="OSG.WCFService.AniversarianteBehavior">
        <endpoint address=""
                  binding="basicHttpBinding"
                  bindingConfiguration="basicHttpEndpointBinding"
                  contract="OSG.WCFService.IAniversariante"/>       
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
      </service>
    </services>
  </system.serviceModel>

And my wsdl file is:

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" name="Aniversariante" targetNamespace="http://tempuri.org/">
<wsp:Policy wsu:Id="BasicHttpBinding_IAniversariante_policy">
<wsp:ExactlyOne>
<wsp:All>
<sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
<wsp:Policy>
<sp:TransportToken>
<wsp:Policy>
<sp:HttpsToken RequireClientCertificate="false"/>
</wsp:Policy>
</sp:TransportToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:Basic256/>
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict/>
</wsp:Policy>
</sp:Layout>
</wsp:Policy>
</sp:TransportBinding>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<wsdl:types>
<xsd:schema targetNamespace="http://tempuri.org/Imports">
<xsd:import schemaLocation="https://mycompany.com.br:4443/Aniversariante.svc?xsd=xsd0" namespace="http://tempuri.org/"/>
<xsd:import schemaLocation="https://mycompany.com.br:4443/Aniversariante.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
<xsd:import schemaLocation="https://mycompany.com.br:4443/Aniversariante.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/OSG.Webservices.Model.HCM"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="IAniversariante_GetAllAniversariante_InputMessage">
<wsdl:part name="parameters" element="tns:GetAllAniversariante"/>
</wsdl:message>
<wsdl:message name="IAniversariante_GetAllAniversariante_OutputMessage">
<wsdl:part name="parameters" element="tns:GetAllAniversarianteResponse"/>
</wsdl:message>
<wsdl:message name="IAniversariante_GetAniversarianteMes_InputMessage">
<wsdl:part name="parameters" element="tns:GetAniversarianteMes"/>
</wsdl:message>
<wsdl:message name="IAniversariante_GetAniversarianteMes_OutputMessage">
<wsdl:part name="parameters" element="tns:GetAniversarianteMesResponse"/>
</wsdl:message>
<wsdl:message name="IAniversariante_GetAniversarianteDia_InputMessage">
<wsdl:part name="parameters" element="tns:GetAniversarianteDia"/>
</wsdl:message>
<wsdl:message name="IAniversariante_GetAniversarianteDia_OutputMessage">
<wsdl:part name="parameters" element="tns:GetAniversarianteDiaResponse"/>
</wsdl:message>
<wsdl:portType name="IAniversariante">
<wsdl:operation name="GetAllAniversariante">
<wsdl:input wsaw:Action="http://tempuri.org/IAniversariante/GetAllAniversariante" message="tns:IAniversariante_GetAllAniversariante_InputMessage"/>
<wsdl:output wsaw:Action="http://tempuri.org/IAniversariante/GetAllAniversarianteResponse" message="tns:IAniversariante_GetAllAniversariante_OutputMessage"/>
</wsdl:operation>
<wsdl:operation name="GetAniversarianteMes">
<wsdl:input wsaw:Action="http://tempuri.org/IAniversariante/GetAniversarianteMes" message="tns:IAniversariante_GetAniversarianteMes_InputMessage"/>
<wsdl:output wsaw:Action="http://tempuri.org/IAniversariante/GetAniversarianteMesResponse" message="tns:IAniversariante_GetAniversarianteMes_OutputMessage"/>
</wsdl:operation>
<wsdl:operation name="GetAniversarianteDia">
<wsdl:input wsaw:Action="http://tempuri.org/IAniversariante/GetAniversarianteDia" message="tns:IAniversariante_GetAniversarianteDia_InputMessage"/>
<wsdl:output wsaw:Action="http://tempuri.org/IAniversariante/GetAniversarianteDiaResponse" message="tns:IAniversariante_GetAniversarianteDia_OutputMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BasicHttpBinding_IAniversariante" type="tns:IAniversariante">
<wsp:PolicyReference URI="#BasicHttpBinding_IAniversariante_policy"/>
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GetAllAniversariante">
<soap:operation soapAction="http://tempuri.org/IAniversariante/GetAllAniversariante" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetAniversarianteMes">
<soap:operation soapAction="http://tempuri.org/IAniversariante/GetAniversarianteMes" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetAniversarianteDia">
<soap:operation soapAction="http://tempuri.org/IAniversariante/GetAniversarianteDia" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Aniversariante">
<wsdl:port name="BasicHttpBinding_IAniversariante" binding="tns:BasicHttpBinding_IAniversariante">
<soap:address location="https://mycompany.com.br:4443/Aniversariante.svc"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

Any thoughts?

Aucun commentaire:

Enregistrer un commentaire