The point is to make a simple white-pages web service which adds a person to a phone book (called addPerson() ) using SOAP. If there is already a person with the same first- and last name in the phone book, a fault message should be returned.
I made the following wsdl file
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="whitepages" targetNamespace="http://whitepages.ws"
xmlns="http://ift.tt/LcBaVt"
xmlns:wsdl="http://ift.tt/LcBaVt"
xmlns:xsd="http://ift.tt/tphNwY" xmlns:tns="http://whitepages.ws" xmlns:soap="http://ift.tt/KIQHA2">
<types>
<xsd:schema targetNamespace="http://whitepages.ws" xmlns:tns="http://whitepages.ws">
<xsd:complexType name="personType">
<xsd:sequence>
<xsd:element name="address" type="tns:addressType"></xsd:element>
</xsd:sequence>
<xsd:attribute name="firstName" type="xsd:string"/>
<xsd:attribute name="lastName" type="xsd:string"/>
<xsd:attribute name="phone" type="xsd:string"/>
</xsd:complexType>
<xsd:complexType name="addressType">
<xsd:sequence>
<xsd:element name="street">
<xsd:complexType>
<xsd:sequence/>
</xsd:complexType>
</xsd:element>
<xsd:element name="postcode">
<xsd:complexType>
<xsd:sequence/>
</xsd:complexType>
</xsd:element>
<xsd:element name="city">
<xsd:complexType>
<xsd:sequence/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="person" type="tns:personType"></xsd:element>
<xsd:element name="response" type="xsd:string"></xsd:element>
<xsd:complexType name="faultType">
<xsd:sequence>
<xsd:element name="errorMessage" type="xsd:string"></xsd:element>
<xsd:element name="person" type="tns:personType"></xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="fault" type="tns:faultType"></xsd:element>
</xsd:schema>
</types>
<message name="whitepagesOperationRequest">
<part name="person" element="tns:person"/>
</message>
<message name="whitepagesOperationResponse">
<part name="response" element="tns:response"/>
</message>
<message name="WPFault">
<part name="errorMessage" type="xsd:string"/>
<part name="person" element="tns:person"/>
</message>
<portType name="whitepages">
<operation name="addPerson">
<input name="input1" message="tns:whitepagesOperationRequest"/>
<output name="output1" message="tns:whitepagesOperationResponse"/>
<fault name="fault1" message="tns:WPFault"/>
</operation>
</portType>
<binding name="whitepagesBinding" type="tns:whitepages">
<soap:binding style="document" transport="http://ift.tt/LcBaVu"/>
<operation name="addPerson">
<soap:operation style="document"/>
<input name="input1">
<soap:body use="literal"/>
</input>
<output name="output1">
<soap:body use="literal"/>
</output>
<fault name="fault1">
<soap:fault name="fault1" use="literal"/>
</fault>
</operation>
</binding>
<service name="whitepagesService">
<port name="whitepagesBindingPort" binding="tns:whitepagesBinding">
<soap:address location="http://localhost:${HttpDefaultPort}/service"/>
</port>
</service>
</definitions>
I validated the xml and now I need to make the java classes(for both) for that schema but I don't know how to proceed...Any advice or tip would be really appreciated..
Thanks in advance
No comments:
Post a Comment