We are using WSDL in soapclient to access the java web service.The soapclient request is not formed as required by the service.
Namespace is not included in one ComplexType element(<GSTBTR eq>) in request XML which causes the problem in getting response from the service.
Request XML generated by SoapClient:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap .org/soap/envelope/" xmlns:ns1="http ://abc.com/GBTSTo/GBTSTReq/01" xmlns:ns2="http ://abc.com/GBTST">
<SOAP-ENV:Body>
<ns2:gBlTST>
<GSTBTReq> <!-- TODO : NAMESPACE DOES NOT GET MAPPED HERE -->
<CustomerNumber >123</CustomerNumber>
<Unit>ABC</Unit>
</GSTBTReq>
</gBlTST>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Following is the part of WSDL to create soapclient.
<s:schema elementFormDefa ult="qualified" targetNamespace ="http://abc.com/GBTST" xmlns:conv="htt p://www.openuri.org/2002/04/soap/conversation/" xmlns:cw="http://www.openuri.org/2002/04/wsdl/conversation/" xmlns:http="htt p://schemas.xmlsoap .org/wsdl/http/"
<s:import namespace="http ://abc.com/GBTST/GBTSTReq/01"/>
<s:import namespace="http ://abc.com/GBTST/GBTSTResp/01"/>
<s:element name="gBTST">
<s:complexTyp e>
<s:sequence>
<s:element ref="ns:GSTBTRe q"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name= "gBTSTResp" >
<s:complexTyp e>
<s:sequence>
<s:element ref="ns1:GSTBTR esp"/>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
<s:schema targetNamespace ="http://abc.com/GBTST/GBTSTReq/01" xmlns:common="h ttp://abc.com/Common/01" xmlns:conv="htt p://www.openuri.org/2002/04/soap/conversation/" xmlns:cw="http://www.openuri.org/2002/04/wsdl/conversation/" xmlns:http="htt p://schemas.xmlsoap .org/wsdl/http/"
xmlns:req="http ://abc.com/GBTST/GBTSTReq/01" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap="htt p://schemas.xmlsoap .org/wsdl/soap/" xmlns:soapenc=" http://schemas.xmlsoap .org/soap/encoding/" xmlns:xsd="http ://www.w3.org/2001/XMLSchema">
<s:import namespace="http ://abc.com/Common/01"/>
<s:simpleType name="CustomerN umber">
<s:restrictio n base="xsd:integ er"/>
</s:simpleType>
<s:simpleType name="Unit">
<s:restrictio n base="xsd:strin g">
<s:enumeratio n value="ABC"/>
</s:restriction>
</s:simpleType>
<s:element name="GSTBTReq" >
<s:complexTyp e>
<s:sequence>
<s:element name="CustomerN umber" nillable="false " type="req:Custo merNumber"/>
<s:element name="Unit" nillable="false " type="req:Opera tingUnit"/>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
Namespace is not included in one ComplexType element(<GSTBTR eq>) in request XML which causes the problem in getting response from the service.
Request XML generated by SoapClient:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap .org/soap/envelope/" xmlns:ns1="http ://abc.com/GBTSTo/GBTSTReq/01" xmlns:ns2="http ://abc.com/GBTST">
<SOAP-ENV:Body>
<ns2:gBlTST>
<GSTBTReq> <!-- TODO : NAMESPACE DOES NOT GET MAPPED HERE -->
<CustomerNumber >123</CustomerNumber>
<Unit>ABC</Unit>
</GSTBTReq>
</gBlTST>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Following is the part of WSDL to create soapclient.
<s:schema elementFormDefa ult="qualified" targetNamespace ="http://abc.com/GBTST" xmlns:conv="htt p://www.openuri.org/2002/04/soap/conversation/" xmlns:cw="http://www.openuri.org/2002/04/wsdl/conversation/" xmlns:http="htt p://schemas.xmlsoap .org/wsdl/http/"
<s:import namespace="http ://abc.com/GBTST/GBTSTReq/01"/>
<s:import namespace="http ://abc.com/GBTST/GBTSTResp/01"/>
<s:element name="gBTST">
<s:complexTyp e>
<s:sequence>
<s:element ref="ns:GSTBTRe q"/>
</s:sequence>
</s:complexType>
</s:element>
<s:element name= "gBTSTResp" >
<s:complexTyp e>
<s:sequence>
<s:element ref="ns1:GSTBTR esp"/>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
<s:schema targetNamespace ="http://abc.com/GBTST/GBTSTReq/01" xmlns:common="h ttp://abc.com/Common/01" xmlns:conv="htt p://www.openuri.org/2002/04/soap/conversation/" xmlns:cw="http://www.openuri.org/2002/04/wsdl/conversation/" xmlns:http="htt p://schemas.xmlsoap .org/wsdl/http/"
xmlns:req="http ://abc.com/GBTST/GBTSTReq/01" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap="htt p://schemas.xmlsoap .org/wsdl/soap/" xmlns:soapenc=" http://schemas.xmlsoap .org/soap/encoding/" xmlns:xsd="http ://www.w3.org/2001/XMLSchema">
<s:import namespace="http ://abc.com/Common/01"/>
<s:simpleType name="CustomerN umber">
<s:restrictio n base="xsd:integ er"/>
</s:simpleType>
<s:simpleType name="Unit">
<s:restrictio n base="xsd:strin g">
<s:enumeratio n value="ABC"/>
</s:restriction>
</s:simpleType>
<s:element name="GSTBTReq" >
<s:complexTyp e>
<s:sequence>
<s:element name="CustomerN umber" nillable="false " type="req:Custo merNumber"/>
<s:element name="Unit" nillable="false " type="req:Opera tingUnit"/>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
Comment