The standard WSDL description listed below can be found here. You can find additional information at the SOAP Builders round 3 site.
<?xml version="1.0" encoding="UTF-8"?> <definitions name="SoapInteropCompound" targetNamespace="http://soapinterop.org/" xmlns:wsdlns="http://soapinterop.org/" xmlns:emp="http://soapinterop.org/employee" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/"> <types> <schema targetNamespace="http://soapinterop.org/person" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <complexType name="Person"> <sequence> <element minOccurs="1" maxOccurs="1" name="Name" type="string"/> <element minOccurs="1" maxOccurs="1" name="Male" type="boolean"/> </sequence> </complexType> </schema> <schema targetNamespace = "http://soapinterop.org/employee" xmlns:prs = "http://soapinterop.org/person" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <import namespace="http://soapinterop.org/person" /> <complexType name="Employee"> <sequence> <element minOccurs="1" maxOccurs="1" name="person" type="prs:Person"/> <element minOccurs="1" maxOccurs="1" name="salary" type="double"/> <element minOccurs="1" maxOccurs="1" name="ID" type="int"/> </sequence> </complexType> <element name="x_Employee" type="emp:Employee"/> <element name="result_Employee" type="emp:Employee"/> </schema> </types> <message name="echoEmployee"> <part name="x" element="emp:x_Employee"/> </message> <message name="echoEmployeeResponse"> <part name="result" element="emp:result_Employee"/> </message> <portType name="SoapInteropCompound2PortType"> <operation name="echoEmployee" parameterOrder="x"> <input message="wsdlns:echoEmployee"/> <output message="wsdlns:echoEmployeeResponse"/> </operation> </portType> <binding name="SoapInteropCompound2Binding" type="wsdlns:SoapInteropCompound2PortType"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="echoEmployee"> <soap:operation soapAction="#echoEmployee"/> <input> <soap:body use="literal"/> </input> <output> <soap:body use="literal"/> </output> </operation> </binding> <service name="Compound2"> <port name="SoapInteropCompound2Port" binding="wsdlns:SoapInteropCompound2Binding"> <soap:address location="http://soapinterop.novell.com/interop/round3/groupd/compound2"/> </port> </service> </definitions>
If you invoke wsdl2java on the above WSDL document, you can run this client to interact with the service:
package groupd.compound2; import javax.naming.InitialContext; import javax.xml.rpc.Stub; public class Client { public static void main(String[] args) throws Exception { | InitialContext ctx = new InitialContext(); | Compound2 service = (Compound2) | ctx.lookup("xmlrpc:soap:groupd.compound2.Compound2"); | SoapInteropCompound2PortType stub = service.getSoapInteropCompound2Port(); | | // set the end point address | if (args.length > 0) | ((Stub)stub)._setProperty("javax.xml.rpc.service.endpoint.address", | args[0]); | | echoEmployee(stub); } public static void echoEmployee(SoapInteropCompound2PortType stub) { | try | { | | System.out.print("echoEmployee: "); | | boolean result = Tests.echoEmployee(stub); | | System.out.println(result ? "OK" : "failed"); | } | catch (java.lang.Exception ex) | { | | System.out.println("error invoking echoEmployee:" + | | ex.getMessage()); | | if (java.lang.System.getProperty("DEBUG") != null) | | ex.printStackTrace(); | } } }
An implementation of the service endpoint from the above WSDL is listed below:
// Thu Oct 03 12:38:40 PDT 2002 package groupd.compound2; import groupd.compound2.holders.*; import javax.servlet.ServletException; public class ServerImpl extends SoapInteropCompound2PortType_ServiceSkeleton { public void init() throws ServletException { | super.init(); | | // Set the WSDL file property | _setProperty("xmlrpc.wsdl", "Compound2.wsdl"); } public Employee echoEmployee(Employee i0) throws java.rmi.RemoteException { | return i0; } }
Copyright © 2003, 2004 Novell, Inc. All rights reserved. Copyright © 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved.