3 Replies Latest reply on Oct 27, 2009 10:55 AM by Helder Dinis

    Error when test a web service reference

    Helder Dinis
      Hello,

      After creating a web service reference and when i make a test of any method, i get the fowling error:

      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Server was unable to process request. ---&gt; Object reference not set to an instance of an object.</faultstring><detail /></soap:Fault></soap:Body>
      </soap:Envelope>


      This is the WSDL definition:

      <?xml version="1.0" encoding="utf-8"?>
      <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="urn:webservices.x-arq.mind.pt/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="urn:webservices.x-arq.mind.pt/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
      <wsdl:types>
      <s:schema elementFormDefault="qualified" targetNamespace="urn:webservices.x-arq.mind.pt/">
      <s:import namespace="urn:webservices.x-arq.mind.pt/ResultadosPesquisa.xsd" />
      <s:import schemaLocation="http://arquivomunicipal.cm-lisboa.pt/X-arqCRMWebService/XarqCRMWebService.asmx?schema=ResultadosPesquisa" namespace="urn:webservices.x-arq.mind.pt/ResultadosPesquisa.xsd" />
      <s:element name="ObterNumeroResultados">
      <s:complexType>
      <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="Obra" type="s:string" />

      <s:element minOccurs="0" maxOccurs="1" name="Processo" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="Morada" type="s:string" />
      </s:sequence>
      </s:complexType>
      </s:element>
      <s:element name="ObterNumeroResultadosResponse">
      <s:complexType>
      <s:sequence>
      <s:element minOccurs="1" maxOccurs="1" name="ObterNumeroResultadosResult" type="s:int" />

      </s:sequence>
      </s:complexType>
      </s:element>
      <s:element name="ObterResultadosEmObjecto">
      <s:complexType>
      <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="Obra" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="Processo" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="Morada" type="s:string" />

      </s:sequence>
      </s:complexType>
      </s:element>
      <s:element name="ObterResultadosEmObjectoResponse">
      <s:complexType>
      <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="ObterResultadosEmObjectoResult" type="tns:ArrayOfResultadoPesquisa" />
      </s:sequence>
      </s:complexType>

      </s:element>
      <s:complexType name="ArrayOfResultadoPesquisa">
      <s:sequence>
      <s:element minOccurs="0" maxOccurs="unbounded" name="ResultadoPesquisa" nillable="true" type="tns:ResultadoPesquisa" />
      </s:sequence>
      </s:complexType>
      <s:complexType name="ResultadoPesquisa">
      <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="Obra" type="s:string" />

      <s:element minOccurs="0" maxOccurs="1" name="Processo" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="Morada" type="s:string" />
      <s:element minOccurs="1" maxOccurs="1" name="ContemFicheirosDigitalizados" type="s:boolean" />
      <s:element minOccurs="0" maxOccurs="1" name="UrlFicheirosDigitalizados" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="EstadoCiarq" type="s:string" />
      </s:sequence>
      </s:complexType>
      <s:element name="ObterResultados">
      <s:complexType>

      <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="Obra" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="Processo" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="Morada" type="s:string" />
      </s:sequence>
      </s:complexType>
      </s:element>
      <s:element name="ObterResultadosResponse">
      <s:complexType>

      <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="ObterResultadosResult">
      <s:complexType>
      <s:sequence>
      <s:any namespace="urn:webservices.x-arq.mind.pt/ResultadosPesquisa.xsd" />
      </s:sequence>
      </s:complexType>
      </s:element>
      </s:sequence>

      </s:complexType>
      </s:element>
      <s:element name="ObterResultadosPaginadosEmObjecto">
      <s:complexType>
      <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="Obra" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="Processo" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="Morada" type="s:string" />
      <s:element minOccurs="1" maxOccurs="1" name="NumeroResultados" type="s:int" />

      <s:element minOccurs="1" maxOccurs="1" name="IndicePrimeiroResultadoDevolver" type="s:int" />
      </s:sequence>
      </s:complexType>
      </s:element>
      <s:element name="ObterResultadosPaginadosEmObjectoResponse">
      <s:complexType>
      <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="ObterResultadosPaginadosEmObjectoResult" type="tns:ArrayOfResultadoPesquisa" />
      </s:sequence>

      </s:complexType>
      </s:element>
      <s:element name="ObterResultadosPaginados">
      <s:complexType>
      <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="Obra" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="Processo" type="s:string" />
      <s:element minOccurs="0" maxOccurs="1" name="Morada" type="s:string" />
      <s:element minOccurs="1" maxOccurs="1" name="NumeroResultados" type="s:int" />

      <s:element minOccurs="1" maxOccurs="1" name="IndicePrimeiroResultadoDevolver" type="s:int" />
      </s:sequence>
      </s:complexType>
      </s:element>
      <s:element name="ObterResultadosPaginadosResponse">
      <s:complexType>
      <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="ObterResultadosPaginadosResult">
      <s:complexType>

      <s:sequence>
      <s:any namespace="urn:webservices.x-arq.mind.pt/ResultadosPesquisa.xsd" />
      </s:sequence>
      </s:complexType>
      </s:element>
      </s:sequence>
      </s:complexType>
      </s:element>
      </s:schema>

      </wsdl:types>
      <wsdl:message name="ObterNumeroResultadosSoapIn">
      <wsdl:part name="parameters" element="tns:ObterNumeroResultados" />
      </wsdl:message>
      <wsdl:message name="ObterNumeroResultadosSoapOut">
      <wsdl:part name="parameters" element="tns:ObterNumeroResultadosResponse" />
      </wsdl:message>
      <wsdl:message name="ObterResultadosEmObjectoSoapIn">
      <wsdl:part name="parameters" element="tns:ObterResultadosEmObjecto" />

      </wsdl:message>
      <wsdl:message name="ObterResultadosEmObjectoSoapOut">
      <wsdl:part name="parameters" element="tns:ObterResultadosEmObjectoResponse" />
      </wsdl:message>
      <wsdl:message name="ObterResultadosSoapIn">
      <wsdl:part name="parameters" element="tns:ObterResultados" />
      </wsdl:message>
      <wsdl:message name="ObterResultadosSoapOut">
      <wsdl:part name="parameters" element="tns:ObterResultadosResponse" />

      </wsdl:message>
      <wsdl:message name="ObterResultadosPaginadosEmObjectoSoapIn">
      <wsdl:part name="parameters" element="tns:ObterResultadosPaginadosEmObjecto" />
      </wsdl:message>
      <wsdl:message name="ObterResultadosPaginadosEmObjectoSoapOut">
      <wsdl:part name="parameters" element="tns:ObterResultadosPaginadosEmObjectoResponse" />
      </wsdl:message>
      <wsdl:message name="ObterResultadosPaginadosSoapIn">
      <wsdl:part name="parameters" element="tns:ObterResultadosPaginados" />

      </wsdl:message>
      <wsdl:message name="ObterResultadosPaginadosSoapOut">
      <wsdl:part name="parameters" element="tns:ObterResultadosPaginadosResponse" />
      </wsdl:message>
      <wsdl:portType name="XarqCRMWebServiceSoap">
      <wsdl:operation name="ObterNumeroResultados">
      <wsdl:input message="tns:ObterNumeroResultadosSoapIn" />
      <wsdl:output message="tns:ObterNumeroResultadosSoapOut" />
      </wsdl:operation>

      <wsdl:operation name="ObterResultadosEmObjecto">
      <wsdl:input message="tns:ObterResultadosEmObjectoSoapIn" />
      <wsdl:output message="tns:ObterResultadosEmObjectoSoapOut" />
      </wsdl:operation>
      <wsdl:operation name="ObterResultados">
      <wsdl:input message="tns:ObterResultadosSoapIn" />
      <wsdl:output message="tns:ObterResultadosSoapOut" />
      </wsdl:operation>
      <wsdl:operation name="ObterResultadosPaginadosEmObjecto">

      <wsdl:input message="tns:ObterResultadosPaginadosEmObjectoSoapIn" />
      <wsdl:output message="tns:ObterResultadosPaginadosEmObjectoSoapOut" />
      </wsdl:operation>
      <wsdl:operation name="ObterResultadosPaginados">
      <wsdl:input message="tns:ObterResultadosPaginadosSoapIn" />
      <wsdl:output message="tns:ObterResultadosPaginadosSoapOut" />
      </wsdl:operation>
      </wsdl:portType>
      <wsdl:binding name="XarqCRMWebServiceSoap" type="tns:XarqCRMWebServiceSoap">

      <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
      <wsdl:operation name="ObterNumeroResultados">
      <soap:operation soapAction="urn:webservices.x-arq.mind.pt/ObterNumeroResultados" style="document" />
      <wsdl:input>
      <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
      <soap:body use="literal" />
      </wsdl:output>

      </wsdl:operation>
      <wsdl:operation name="ObterResultadosEmObjecto">
      <soap:operation soapAction="urn:webservices.x-arq.mind.pt/ObterResultadosEmObjecto" style="document" />
      <wsdl:input>
      <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
      <soap:body use="literal" />
      </wsdl:output>

      </wsdl:operation>
      <wsdl:operation name="ObterResultados">
      <soap:operation soapAction="urn:webservices.x-arq.mind.pt/ObterResultados" style="document" />
      <wsdl:input>
      <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
      <soap:body use="literal" />
      </wsdl:output>

      </wsdl:operation>
      <wsdl:operation name="ObterResultadosPaginadosEmObjecto">
      <soap:operation soapAction="urn:webservices.x-arq.mind.pt/ObterResultadosPaginadosEmObjecto" style="document" />
      <wsdl:input>
      <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
      <soap:body use="literal" />
      </wsdl:output>

      </wsdl:operation>
      <wsdl:operation name="ObterResultadosPaginados">
      <soap:operation soapAction="urn:webservices.x-arq.mind.pt/ObterResultadosPaginados" style="document" />
      <wsdl:input>
      <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
      <soap:body use="literal" />
      </wsdl:output>

      </wsdl:operation>
      </wsdl:binding>
      <wsdl:binding name="XarqCRMWebServiceSoap12" type="tns:XarqCRMWebServiceSoap">
      <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
      <wsdl:operation name="ObterNumeroResultados">
      <soap12:operation soapAction="urn:webservices.x-arq.mind.pt/ObterNumeroResultados" style="document" />
      <wsdl:input>
      <soap12:body use="literal" />
      </wsdl:input>

      <wsdl:output>
      <soap12:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
      <wsdl:operation name="ObterResultadosEmObjecto">
      <soap12:operation soapAction="urn:webservices.x-arq.mind.pt/ObterResultadosEmObjecto" style="document" />
      <wsdl:input>
      <soap12:body use="literal" />
      </wsdl:input>

      <wsdl:output>
      <soap12:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
      <wsdl:operation name="ObterResultados">
      <soap12:operation soapAction="urn:webservices.x-arq.mind.pt/ObterResultados" style="document" />
      <wsdl:input>
      <soap12:body use="literal" />
      </wsdl:input>

      <wsdl:output>
      <soap12:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
      <wsdl:operation name="ObterResultadosPaginadosEmObjecto">
      <soap12:operation soapAction="urn:webservices.x-arq.mind.pt/ObterResultadosPaginadosEmObjecto" style="document" />
      <wsdl:input>
      <soap12:body use="literal" />
      </wsdl:input>

      <wsdl:output>
      <soap12:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
      <wsdl:operation name="ObterResultadosPaginados">
      <soap12:operation soapAction="urn:webservices.x-arq.mind.pt/ObterResultadosPaginados" style="document" />
      <wsdl:input>
      <soap12:body use="literal" />
      </wsdl:input>

      <wsdl:output>
      <soap12:body use="literal" />
      </wsdl:output>
      </wsdl:operation>
      </wsdl:binding>
      <wsdl:service name="XarqCRMWebService">
      <wsdl:port name="XarqCRMWebServiceSoap" binding="tns:XarqCRMWebServiceSoap">
      <soap:address location="http://arquivomunicipal.cm-lisboa.pt/X-arqCRMWebService/XarqCRMWebService.asmx" />
      </wsdl:port>

      <wsdl:port name="XarqCRMWebServiceSoap12" binding="tns:XarqCRMWebServiceSoap12">
      <soap12:address location="http://arquivomunicipal.cm-lisboa.pt/X-arqCRMWebService/XarqCRMWebService.asmx" />
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>


      Thanks for your help!

      From Portugal,
      Helder Dinis

      Edited by: Helder Dinis on Oct 22, 2009 5:52 PM
        • 1. Re: Error when test a web service reference
          Sam.K
          Could you show us your SOAP envelope please ?


          Thanks,

          Sam
          Please reward good answers by marking them correct or helpful!
          • 2. Re: Error when test a web service reference
            Helder Dinis
            Hello,

            First, I would like to thank you for your help.

            Below is the SOAP envelope (request) that was created by the Application Express engine based on the Web service reference definition.

            Input parameters:
            Obra: 35078
            Processo: 2073/DCEOD/I/1960
            Morada: BECO BUGIO


            <?xml version='1.0' encoding='UTF-8'?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
                 <SOAP-ENV:Body><ns1:ObterResultadosEmObjecto xmlns:ns1="urn:webservices.x-arq.mind.pt/urn:webservices.x-arq.mind.pt/ResultadosPesquisa.xsd"><ns1:Obra>35078</ns1:Obra><ns1:Processo>2073/DCEOD/I/1960</ns1:Processo><ns1:Morada>BECO BUGIO</ns1:Morada></ns1:ObterResultadosEmObjecto></SOAP-ENV:Body>
            </SOAP-ENV:Envelope>


            From Portugal,
            Helder Dinis
            • 3. Re: Error when test a web service reference
              Helder Dinis
              Please, somebody help me.

              Thank you.

              Helder Dinis