I´m trying to use a webservice made with axis2 from VB6. I have severals methods in the service. One of them doesn´t recive parameters when I invoke it and the result of the calling is ok, but when I invoke a method with one parameter I recive the following error: "Unexpected Subelement". I´m using Microsoft SOAP Toolkit 3.0 for calling the service.
This is the code that I use:
Expand|Select|Wrap|Line Numbers
- Dim clnt As New SoapClient30
- Dim objResultNodes
- Dim listaCapabilities
- On Error GoTo Mensaje
- Screen.MousePointer = vbHourglass
- DoEvents
- 'Inciar Servicio Web
- clnt.ClientProperty("ServerHTTPRequest") = True
- clnt.MSSoapInit "*****/SourcingServices?wsdl"
- If Err <> 0 Then
- MsgBox ("Respuesta erronea del Servicio Web. Verificar el Servicio URL" & vbLf & vbLf & "URGENTE !!! LLAMAR AL TEAM MANAGER: Pope-Iban-Ibai" & vbLf & vbLf & Error)
- Screen.MousePointer = vbDefault
- Exit Sub
- End If
- Lista.Clear
- 'Invoke the Web service method
- 'It returns a DataSet (two nodes list; one containing schema
- ' and other containing actual results)
- 'Set objResultNodes = clnt.leerOfak(auxOF)
- Dim prov As String
- prov = InputBox("Introduzca el proveedor", "Proveedor")
- listaCapabilities = clnt.getCapabilityListFromCompany(prov)
- For i = 0 To UBound(listaCapabilities)
- Lista.AddItem (listaCapabilities(i))
- Next
- Salir:
- '
- ''Respuesta LeerOfak
- 'auxCLIENTE = clnt.leerOfak(auxOF).Item(5).Text
- Screen.MousePointer = vbDefault
- Set clnt = Nothing
- Exit Sub
- Mensaje:
- MsgBox Err.Description, vbCritical, "Error Numero " & Err.Number
- Resume Salir
- <wsdl:definitio ns xmlns:http="htt p://schemas.xmlsoap .org/wsdl/http/" xmlns:mime="htt p://schemas.xmlsoap .org/wsdl/mime/" xmlns:soap12="h ttp://schemas.xmlsoap .org/wsdl/soap12/" xmlns:wsaw="htt p://www.w3.org/2006/05/addressing/wsdl" xmlns:xsd="http ://ptk.ws.batz.com/xsd" xmlns:ns="http://ptk.ws.batz.com " xmlns:soap="htt p://schemas.xmlsoap .org/wsdl/soap/" xmlns:wsdl="htt p://schemas.xmlsoap .org/wsdl/" targetNamespace ="http://ptk.ws.batz.com ">
<wsdl:documenta tion>SourcingSe rvices</wsdl:documentat ion>
- <wsdl:types>
- <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDe fault="qualifie d" elementFormDefa ult="qualified" targetNamespace ="http://ptk.ws.batz.com/xsd">
- <xs:element name="getCapabi lityList">
- <xs:complexType >
- <xs:sequence>
<xs:element name="porRellen ar" nillable="true" type="xs:string " />
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getCapabi lityListRespons e">
- <xs:complexType >
- <xs:sequence>
<xs:element maxOccurs="unbo unded" name="return" nillable="true" type="xs:string " />
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getCapabi lityListFromCom pany">
- <xs:complexType >
- <xs:sequence>
<xs:element name="companyNa me" nillable="true" type="xs:string " />
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getCapabi lityListFromCom panyResponse">
- <xs:complexType >
- <xs:sequence>
<xs:element maxOccurs="unbo unded" name="return" nillable="true" type="xs:string " />
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getCompan yList">
- <xs:complexType >
- <xs:sequence>
<xs:element name="porRellen ar" nillable="true" type="xs:string " />
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element name="getCompan yListResponse">
- <xs:complexType >
- <xs:sequence>
<xs:element maxOccurs="unbo unded" name="return" nillable="true" type="xs:string " />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
- <wsdl:message name="getCapabi lityListMessage ">
<wsdl:part name="part1" element="xsd:ge tCapabilityList " />
</wsdl:message>
- <wsdl:message name="getCapabi lityListRespons eMessage">
<wsdl:part name="part1" element="xsd:ge tCapabilityList Response" />
</wsdl:message>
- <wsdl:message name="getCapabi lityListFromCom panyMessage">
<wsdl:part name="part1" element="xsd:ge tCapabilityList FromCompany" />
</wsdl:message>
- <wsdl:message name="getCapabi lityListFromCom panyResponseMes sage">
<wsdl:part name="part1" element="xsd:ge tCapabilityList FromCompanyResp onse" />
</wsdl:message>
- <wsdl:message name="getCompan yListMessage">
<wsdl:part name="part1" element="xsd:ge tCompanyList" />
</wsdl:message>
- <wsdl:message name="getCompan yListResponseMe ssage">
<wsdl:part name="part1" element="xsd:ge tCompanyListRes ponse" />
</wsdl:message>
- <wsdl:portTyp e name="SourcingS ervicesPortType ">
- <wsdl:operati on name="getCapabi lityList">
<wsdl:input message="ns:get CapabilityListM essage" wsaw:Action="ur n:getCapability List" />
<wsdl:output message="ns:get CapabilityListR esponseMessage" wsaw:Action="ht tp://ptk.ws.batz.com/SourcingService sPortType/getCapabilityLi stResponse" />
</wsdl:operation>
- <wsdl:operati on name="getCapabi lityListFromCom pany">
<wsdl:input message="ns:get CapabilityListF romCompanyMessa ge" wsaw:Action="ur n:getCapability ListFromCompany " />
<wsdl:output message="ns:get CapabilityListF romCompanyRespo nseMessage" wsaw:Action="ht tp://ptk.ws.batz.com/SourcingService sPortType/getCapabilityLi stFromCompanyRe sponse" />
</wsdl:operation>
- <wsdl:operati on name="getCompan yList">
<wsdl:input message="ns:get CompanyListMess age" wsaw:Action="ur n:getCompanyLis t" />
<wsdl:output message="ns:get CompanyListResp onseMessage" wsaw:Action="ht tp://ptk.ws.batz.com/SourcingService sPortType/getCompanyListR esponse" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="SourcingS ervicesSOAP11Bi nding" type="ns:Sourci ngServicesPortT ype">
<soap:binding transport="http ://schemas.xmlsoap .org/soap/http" style="document " />
- <wsdl:operati on name="getCapabi lityList">
<soap:operati on soapAction="urn :getCapabilityL ist" style="document " />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operati on name="getCapabi lityListFromCom pany">
<soap:operati on soapAction="urn :getCapabilityL istFromCompany" style="document " />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operati on name="getCompan yList">
<soap:operati on soapAction="urn :getCompanyList " 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="SourcingS ervicesSOAP12Bi nding" type="ns:Sourci ngServicesPortT ype">
<soap12:bindi ng transport="http ://schemas.xmlsoap .org/soap/http" style="document " />
- <wsdl:operati on name="getCapabi lityList">
<soap12:operati on soapAction="urn :getCapabilityL ist" style="document " />
- <wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operati on name="getCapabi lityListFromCom pany">
<soap12:operati on soapAction="urn :getCapabilityL istFromCompany" style="document " />
- <wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operati on name="getCompan yList">
<soap12:operati on soapAction="urn :getCompanyList " style="document " />
- <wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:binding name="SourcingS ervicesHttpBind ing" type="ns:Sourci ngServicesPortT ype">
<http:binding verb="POST" />
- <wsdl:operati on name="getCapabi lityList">
<http:operati on location="getCa pabilityList" />
- <wsdl:input>
<mime:content type="text/xml" />
</wsdl:input>
- <wsdl:output>
<mime:content type="text/xml" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operati on name="getCapabi lityListFromCom pany">
<http:operati on location="getCa pabilityListFro mCompany" />
- <wsdl:input>
<mime:content type="text/xml" />
</wsdl:input>
- <wsdl:output>
<mime:content type="text/xml" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operati on name="getCompan yList">
<http:operati on location="getCo mpanyList" />
- <wsdl:input>
<mime:content type="text/xml" />
</wsdl:input>
- <wsdl:output>
<mime:content type="text/xml" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="SourcingS ervices">
- <wsdl:port name="SourcingS ervicesSOAP11po rt_http" binding="ns:Sou rcingServicesSO AP11Binding">
<soap:address location="http://192.168.90.227: 7001/ematrix/services/SourcingService s" />
</wsdl:port>
- <wsdl:port name="SourcingS ervicesSOAP12po rt_http" binding="ns:Sou rcingServicesSO AP12Binding">
<soap12:addre ss location="http://192.168.90.227: 7001/ematrix/services/SourcingService s" />
</wsdl:port>
- <wsdl:port name="SourcingS ervicesHttpport " binding="ns:Sou rcingServicesHt tpBinding">
<http:address location="http://192.168.90.227: 7001/ematrix/services/SourcingService s" />
</wsdl:port>
</wsdl:service>
</wsdl:definition s>
Any Idea?
Thanks in Advance