Round3/GroupD/Compound1

The standard WSDL description listed below can be found here. You can find additional information at the SOAP Builders round 3 site.

WSDL Interface

<?xml version="1.0" encoding="UTF-8"?>
<definitions name="SoapInteropCompound" 
                targetNamespace="http://soapinterop.org/" 
                xmlns:wsdlns="http://soapinterop.org/" 
                xmlns:typens="http://soapinterop.org/xsd"
                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/xsd" 
                xmlns="http://www.w3.org/2001/XMLSchema" 
                elementFormDefault="qualified">                 
                        <complexType name="Person">
                                <sequence>
                                        <element minOccurs="1" maxOccurs="1" name="Age" type="double"/>
                                        <element minOccurs="1" maxOccurs="1" name="ID" type="xsd:float"/>                                       
                                </sequence>
                                <attribute name="Name" type="string"/>
                                <attribute name="Male" type="boolean"/>
                        </complexType>
                        <element name="x_Person" type="typens:Person"/> 
                        <element name="result_Person" type="typens:Person"/>
                                                                           
                        <complexType name="Document">
                        <simpleContent>
                         <extension base="string">
                           <xsd:attribute name ="ID" type="string"/>
                         </extension>
                        </simpleContent>
                        </complexType>  
                        <element name="x_Document" type="typens:Document"/>     
                        <element name="result_Document" type="typens:Document"/>        
                </schema>
        </types>
        <message name="echoPerson">
                <part name="x" element="typens:x_Person"/>
        </message>
        <message name="echoPersonResponse">
                <part name="Result" element="typens:result_Person"/>
        </message>
        <message name="echoDocument">
                <part name="x" element="typens:x_Document"/>
        </message>
        <message name="echoDocumentResponse">
                <part name="Result" element="typens:result_Document"/>
        </message>
        <portType name="SoapInteropCompound1PortType">
                <operation name="echoPerson" parameterOrder="x">
                        <input message="wsdlns:echoPerson"/>
                        <output message="wsdlns:echoPersonResponse"/>
                </operation>
                <operation name="echoDocument" parameterOrder="x">
                        <input message="wsdlns:echoDocument"/>
                        <output message="wsdlns:echoDocumentResponse"/>
                </operation>
        </portType>
        <binding name="SoapInteropCompound1Binding" type="wsdlns:SoapInteropCompound1PortType">
                <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
                <operation name="echoPerson">
                        <soap:operation soapAction="http://soapinterop/echoPerson"/>
                        <input>
                                <soap:body use="literal"/>
                        </input>
                        <output>
                                <soap:body use="literal"/>
                        </output>
                </operation>
                <operation name="echoDocument">
                        <soap:operation soapAction="http://soapinterop/echoDocument"/>
                        <input>
                                <soap:body use="literal"/>
                        </input>
                        <output>
                                <soap:body use="literal"/>
                        </output>
                </operation>
                                                                           
        </binding>
        <service name="Compound1">
                <port name="SoapInteropCompound1Port" binding="wsdlns:SoapInteropCompound1Binding">
                        <soap:address location="http://soapinterop.novell.com/interop/round3/groupd/compound1"/>
                </port>
        </service>
</definitions>

Client

If you invoke wsdl2java on the above WSDL document, you can run this client to interact with the service:

package groupd.compound1;
                                                                           
import javax.naming.InitialContext;
import javax.xml.rpc.Stub;
                                                                           
public class Client
{
    public static void main(String[] args) throws Exception
    {
    |   InitialContext ctx = new InitialContext();
    |   Compound1 service = (Compound1)
    |                   ctx.lookup("xmlrpc:soap:groupd.compound1.Compound1");
    |   SoapInteropCompound1PortType stub = service.getSoapInteropCompound1Port();
    |                                                                      
    |   // set the end point address
    |   if (args.length > 0) 
    |       ((Stub)stub)._setProperty("javax.xml.rpc.service.endpoint.address",
    |           args[0]);
    |                                                                      
    |   echoPerson(stub);
    |   echoDocument(stub);
    }
                                                                           
    public static void echoPerson(SoapInteropCompound1PortType stub)
    {
    |   try
    |   {
    |   |   System.out.print("echoPerson: ");
    |   |   boolean result = Tests.echoPerson(stub);
    |   |   System.out.println(result ? "OK" : "failed");
    |   }
    |   catch (java.lang.Exception ex)
    |   {
    |   |   System.out.println("error invoking echoPerson:" + ex.getMessage());
    |   |   if (java.lang.System.getProperty("DEBUG") != null)
    |   |       ex.printStackTrace();
    |   }
    }
                                                                           
    public static void echoDocument(SoapInteropCompound1PortType stub)
    {
    |   try
    |   {
    |   |   System.out.print("echoDocument: ");
    |   |   boolean result = Tests.echoDocument(stub);
    |   |   System.out.println(result ? "OK" : "failed");
    |   }
    |   catch (java.lang.Exception ex)
    |   {
    |   |   System.out.println("error invoking echoDocument:" + 
    |   |       ex.getMessage());
    |   |   if (java.lang.System.getProperty("DEBUG") != null)
    |   |       ex.printStackTrace();
    |   }
    }
}

Server

An implementation of the service endpoint from the above WSDL is listed below:

// Thu Oct 03 12:38:40 PDT 2002
                                                                           
package groupd.compound1;
                                                                           
import groupd.compound1.holders.*;
                                                                           
import javax.servlet.ServletException;
                                                                           
public class ServerImpl extends SoapInteropCompound1PortType_ServiceSkeleton
{
    public void init()
        throws ServletException
    {
    |   super.init();
    |                                                                      
    |   // Set the WSDL file property
    |   _setProperty("xmlrpc.wsdl", "Compound1.wsdl");
    }
                                                                           
    public groupd.compound1.Person echoPerson(groupd.compound1.Person i0)
        throws java.rmi.RemoteException
    {
    |   return i0;
    }
                                                                           
    public groupd.compound1.Document echoDocument(groupd.compound1.Document 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.