I am starting up with web service and I have just faced up a doubt. I have the WSDL file and I want to develop the web service. I have tried out with Axis2 and CXF and I do not know if the problem is conceptual, or technical.
My tutor give me this wsdl file:
<wsdl:types>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://ws.unit4.com">
<xs:element name="InsertDog">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="param0" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="InsertDogResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="InsertDogRequest">
<wsdl:part name="parameters" element="ns:InsertDog"/>
</wsdl:message>
<wsdl:message name="InsertDogResponse">
<wsdl:part name="parameters" element="ns:InsertDogResponse"/>
</wsdl:message>
<wsdl:portType name="InsertDogPortType">
<wsdl:operation name="InsertDog">
<wsdl:input message="ns:InsertDogRequest" wsaw:Action="urn:InsertDog"/>
<wsdl:output message="ns:InsertDogResponse" wsaw:Action="urn:InsertDogResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="InsertDogSoap11Binding" type="ns:InsertDogPortType">
<soap:binding transport="http://ift.tt/LcBaVu" style="document"/>
<wsdl:operation name="InsertDog">
<soap:operation soapAction="urn:InsertDog" 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="InsertDogServ">
<wsdl:port name="InsertDogHttpSoap11Endpoint" binding="ns:InsertDogTransSoap11Binding">
<soap:address location="x.x.x.x"/>
</wsdl:port>
</wsdl:service>
And my tutor said me also that this web service has to be able to receive and XML document like:
<soapenv:Envelope xmlns:soapenv="http://ift.tt/sVJIaE" xmlns:q0="http://ws.unit4.com" xmlns:xsd="http://ift.tt/tphNwY" xmlns:xsi="http://ift.tt/ra1lAU">
<soapenv:Body>
<NewDog xmlns="http://gfr.com/">
<name>Kira</name>
<owner>John Smith</owner>
<contactNumber>123456789</contactNumber>
</NewDog>
</soapenv:Body>
</soapenv:Envelope>
But I receive an error like:
...
<soapenv:Fault>
<faultcode xmlns:ns1="http://ift.tt/1f4HjAN">ns1:Client</faultcode>
<faultstring>No such operation 'NewDog'</faultstring>
...
I do not know if I am wrong or not, but, shouldn't be the wsdl schema part like this one below to work out with this XML request?
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://ws.unit4.com">
<xs:element name="NewDog">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="owner" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="contactNumber" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="InsertDogResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Thank you very much in advance :) and happy weekend!!
No comments:
Post a Comment