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="SoapInterop" targetNamespace="http://soapinterop/" xmlns:wsdlns="http://soapinterop/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/"> <types/> <message name="echoStringRequest"> <part name="a" type="xsd:string"/> </message> <message name="echoStringResponse"> <part name="Result" type="xsd:string"/> </message> <portType name="SoapInteropEmptySAPortType"> <operation name="echoString" parameterOrder="a"> <input message="wsdlns:echoStringRequest"/> <output message="wsdlns:echoStringResponse"/> </operation> </portType> <binding name="SoapInteropEmptySABinding" type="wsdlns:SoapInteropEmptySAPortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="echoString"> <soap:operation soapAction=""/> <input> <soap:body use="encoded" namespace="http://soapinterop/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" namespace="http://soapinterop/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> </binding> <service name="EmptySA"> <port name="SoapInteropEmptySAPort" binding="wsdlns:SoapInteropEmptySABinding"> <soap:address location="http://soapinterop.novell.com/interop/round3/groupd/emptysa"/> </port> </service> </definitions>
If you invoke wsdl2java on the above WSDL document, you can run this client to interact with the service:
package groupd.emptysa; import javax.naming.InitialContext; import javax.xml.rpc.Stub; public class Client { public static void main(String[] args) throws Exception { | InitialContext ctx = new InitialContext(); | EmptySA service = (EmptySA) | ctx.lookup("xmlrpc:soap:groupd.emptysa.EmptySA"); | SoapInteropEmptySAPortType stub = service.getSoapInteropEmptySAPort(); | | // set the end point address | if (args.length > 0) | ((Stub)stub)._setProperty("javax.xml.rpc.service.endpoint.address", | args[0]); | | echoString(stub); } public static void echoString(SoapInteropEmptySAPortType stub) { | try | { | | System.out.print("echoString: "); | | boolean result = Tests.echoString(stub); | | System.out.println(result ? "OK" : "failed"); | } | catch (java.lang.Exception ex) | { | | System.out.println("error invoking echoString:" + 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.emptysa; import javax.servlet.ServletException; public class ServerImpl extends SoapInteropEmptySAPortType_ServiceSkeleton { public void init() throws ServletException { | super.init(); | | // Set the WSDL file property | _setProperty("xmlrpc.wsdl", "EmptySA.wsdl"); } public java.lang.String echoString(java.lang.String 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.