Round4/GroupH/ComplexRpc

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

WSDL Interface

<?xml version="1.0" encoding="UTF-8"?>
<definitions
        xmlns="http://schemas.xmlsoap.org/wsdl/"
        xmlns:tns="http://soapinterop.org/wsdl"
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:ns2="http://soapinterop.org/types"
        targetNamespace="http://soapinterop.org/wsdl">
                                                                           
        <types>
                <schema
                        xmlns="http://www.w3.org/2001/XMLSchema"
                        xmlns:tns="http://soapinterop.org/types"
                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                        xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
                        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                        targetNamespace="http://soapinterop.org/types">
                                                                           
                        <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
                                                                           
                        <complexType name="SOAPStruct">
                                <sequence>
                                        <element name="varString" type="xsd:string"/>
                                        <element name="varInt" type="xsd:int"/>
                                        <element name="varFloat" type="xsd:float"/>
                                </sequence>
                        </complexType>
                                                                           
                        <complexType name="SOAPStructFault">
                                <sequence>
                                        <element name="soapStruct" type="tns:SOAPStruct"/>
                                </sequence>
                        </complexType>
                                                                           
                        <complexType name="BaseStruct">
                                <sequence>
                                        <element name="floatMessage" type="xsd:float"/>
                                        <element name="shortMessage" type="xsd:short"/>
                                </sequence>
                        </complexType>
                                                                           
                        <complexType name="ExtendedStruct">
                                <complexContent>
                                        <extension base="tns:BaseStruct">
                                                <sequence>
                                                        <element name="stringMessage" type="xsd:string"/>
                                                        <element name="intMessage" type="xsd:int"/>
                                                        <element name="anotherIntMessage" type="xsd:int"/>
                                                </sequence>
                                        </extension>
                                </complexContent>
                        </complexType>
                                                                           
                        <complexType name="MoreExtendedStruct">
                                <complexContent>
                                        <extension base="tns:ExtendedStruct">
                                                <sequence>
                                                        <element name="booleanMessage" type="xsd:boolean"/>
                                                </sequence>
                                        </extension>
                                </complexContent>
                        </complexType>
                                                                           
                </schema>
        </types>
                                                                           
        <message name="echoFaultResponse"/>
        <message name="echoSOAPStructFaultRequest">
                <part name="param" type="ns2:SOAPStructFault"/>
        </message>
        <message name="echoBaseStructFaultRequest">
                <part name="param" type="ns2:BaseStruct"/>
        </message>
        <message name="echoExtendedStructFaultRequest">
                <part name="param" type="ns2:ExtendedStruct"/>
        </message>
        <message name="echoMultipleFaults1Request">
                <part name="whichFault" type="xsd:int"/>
                <part name="param1" type="ns2:SOAPStruct"/>
                <part name="param2" type="ns2:BaseStruct"/>
        </message>
        <message name="echoMultipleFaults2Request">
                <part name="whichFault" type="xsd:int"/>
                <part name="param1" type="ns2:BaseStruct"/>
                <part name="param2" type="ns2:ExtendedStruct"/>
                <part name="param3" type="ns2:MoreExtendedStruct"/>
        </message>
                                                                           
        <!-- Fault messages -->
        <message name="SOAPStructFault">
                <part name="part1" type="ns2:SOAPStructFault"/>
        </message>
        <message name="BaseStructFault">
                <part name="part2" type="ns2:BaseStruct"/>
        </message>
        <message name="ExtendedStructFault">
                <part name="part3" type="ns2:ExtendedStruct"/>
        </message>
        <message name="MoreExtendedStructFault">
                <part name="part4" type="ns2:MoreExtendedStruct"/>
        </message>
                                                                           
        <portType name="ComplexRpcEncPortType">
                <!--
                        Throws a fault with an embedded SOAPStruct
                -->
                <operation name="echoSOAPStructFault" parameterOrder="param">
                        <input message="tns:echoSOAPStructFaultRequest"/>
                        <output message="tns:echoFaultResponse"/>
                        <fault name="ComplexFault" message="tns:SOAPStructFault"/>
                </operation>
                                                                           
                <!--
                        Throws a fault with a base complex struct
                -->
                <operation name="echoBaseStructFault" parameterOrder="param">
                        <input message="tns:echoBaseStructFaultRequest"/>
                        <output message="tns:echoFaultResponse"/>
                        <fault name="ComplexFault" message="tns:BaseStructFault"/>
                </operation>
                                                                           
                <!--
                        Throws a fault with an en extended complex type
                -->
                <operation name="echoExtendedStructFault" parameterOrder="param">
                        <input message="tns:echoExtendedStructFaultRequest"/>
                        <output message="tns:echoFaultResponse"/>
                        <fault name="ComplexFault" message="tns:ExtendedStructFault"/>
                </operation>
                                                                           
                <!--
                        Throws a fault with embedded complex type and fault with
                        another complex type
                -->
                <operation name="echoMultipleFaults1" parameterOrder="whichFault param1 param2">
                        <input message="tns:echoMultipleFaults1Request"/>
                        <output message="tns:echoFaultResponse"/>
                        <fault name="ComplexFault1" message="tns:SOAPStructFault"/>
                        <fault name="ComplexFault2" message="tns:BaseStructFault"/>
                </operation>
                                                                           
                <!--
                        Throws a fault with base complex type, fault with an extended
                        complex type and a fault with doubly extended complex type
                -->
                <operation name="echoMultipleFaults2" parameterOrder="whichFault param1 param2 param3">
                        <input message="tns:echoMultipleFaults2Request"/>
                        <output message="tns:echoFaultResponse"/>
                        <fault name="ComplexFault1" message="tns:BaseStructFault"/>
                        <fault name="ComplexFault2" message="tns:ExtendedStructFault"/>
                        <fault name="ComplexFault3" message="tns:MoreExtendedStructFault"/>
                </operation>
        </portType>
                                                                           
        <binding name="ComplexRpcEncBinding" type="tns:ComplexRpcEncPortType">
                <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
                <operation name="echoSOAPStructFault">
                        <input>
                                <soap:body
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </input>
                        <output>
                                <soap:body
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </output>
                        <fault name="ComplexFault">
                                <soap:fault
                                        name="ComplexFault"
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </fault>
                        <soap:operation soapAction=""/>
                </operation>
                                                                           
                <operation name="echoBaseStructFault">
                        <input>
                                <soap:body
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </input>
                        <output>
                                <soap:body
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </output>
                        <fault name="ComplexFault">
                                <soap:fault
                                        name="ComplexFault"
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </fault>
                        <soap:operation soapAction=""/>
                </operation>
                                                                           
                <operation name="echoExtendedStructFault">
                        <input>
                                <soap:body
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </input>
                        <output>
                                <soap:body
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </output>
                        <fault name="ComplexFault">
                                <soap:fault
                                        name="ComplexFault"
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </fault>
                        <soap:operation soapAction=""/>
                </operation>
                                                                           
                <operation name="echoMultipleFaults1">
                        <input>
                                <soap:body
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </input>
                        <output>
                                <soap:body
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </output>
                        <fault name="ComplexFault1">
                                <soap:fault
                                        name="ComplexFault1"
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </fault>
                        <fault name="ComplexFault2">
                                <soap:fault
                                        name="ComplexFault2"
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </fault>
                        <soap:operation soapAction=""/>
                </operation>
                                                                           
                <operation name="echoMultipleFaults2">
                        <input>
                                <soap:body
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </input>
                        <output>
                                <soap:body
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </output>
                        <fault name="ComplexFault1">
                                <soap:fault
                                        name="ComplexFault1"
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </fault>
                        <fault name="ComplexFault2">
                                <soap:fault
                                        name="ComplexFault2"
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </fault>
                        <fault name="ComplexFault3">
                                <soap:fault
                                        name="ComplexFault3"
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </fault>
                        <soap:operation soapAction=""/>
                </operation>
        </binding>
                                                                           
        <service name="ComplexRpcEncService">
                <port name="ComplexRpcEncPort" binding="tns:ComplexRpcEncBinding">
                        <soap:address
                                location="http://soapinterop.novell.com/round4/grouph/complexrpc"/>
                </port>
        </service>
</definitions>
                                                                           

Client

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

package grouph.complexrpc;
                                                                           
import javax.naming.InitialContext;
import javax.xml.rpc.Stub;
                                                                           
public class Client
{
    public static void main(String[] args) throws Exception
    {
    |   InitialContext ctx = new InitialContext();
    |   ComplexRpcEncService service = (ComplexRpcEncService)
    |           ctx.lookup("xmlrpc:soap:grouph.complexrpc.ComplexRpcEncService");
    |   ComplexRpcEncPortType stub = service.getComplexRpcEncPort();
    |                                                                      
    |   // set the end point address
    |   if (args.length > 0) 
    |       ((Stub)stub)._setProperty("javax.xml.rpc.service.endpoint.address",
    |           args[0]);
    |                                                                      
    |   echoSOAPStructFault(stub);
    |   echoBaseStructFault(stub);
    |   echoExtendedStructFault(stub);
    |   echoMultipleFaults1(stub);
    |   echoMultipleFaults2(stub);
    }
                                                                           
    public static void echoSOAPStructFault(ComplexRpcEncPortType stub)
    {
    |   try
    |   {
    |   |   System.out.print("echoSOAPStructFault: ");
    |   |   boolean result = Tests.echoSOAPStructFault(stub);
    |   |   System.out.println(result ? "OK" : "failed");
    |   }
    |   catch (java.lang.Exception ex)
    |   {
    |   |   System.out.println("error invoking echoSOAPStructFault:" + 
    |   |       ex.getMessage());
    |   |   if (java.lang.System.getProperty("DEBUG") != null)
    |   |       ex.printStackTrace();
    |   }
    }
                                                                           
    public static void echoBaseStructFault(ComplexRpcEncPortType stub)
    {
    |   try
    |   {
    |   |   System.out.print("echoBaseStructFault: ");
    |   |   boolean result = Tests.echoBaseStructFault(stub);
    |   |   System.out.println(result ? "OK" : "failed");
    |   }
    |   catch (java.lang.Exception ex)
    |   {
    |   |   System.out.println("error invoking echoBaseStructFault:" + 
    |   |       ex.getMessage());
    |   |   if (java.lang.System.getProperty("DEBUG") != null)
    |   |       ex.printStackTrace();
    |   }
    }
                                                                           
    public static void echoExtendedStructFault(ComplexRpcEncPortType stub)
    {
    |   try
    |   {
    |   |   System.out.print("echoExtendedStructFault: ");
    |   |   boolean result = Tests.echoExtendedStructFault(stub);
    |   |   System.out.println(result ? "OK" : "failed");
    |   }
    |   catch (java.lang.Exception ex)
    |   {
    |   |   System.out.println("error invoking echoExtendedStructFault:" + 
    |   |       ex.getMessage());
    |   |   if (java.lang.System.getProperty("DEBUG") != null)
    |   |       ex.printStackTrace();
    |   }
    }
                                                                           
    public static void echoMultipleFaults1(ComplexRpcEncPortType stub)
    {
    |   try
    |   {
    |   |   System.out.print("echoMultipleFaults1: ");
    |   |   boolean result = Tests.echoMultipleFaults1(stub);
    |   |   System.out.println(result ? "OK" : "failed");
    |   }
    |   catch (java.lang.Exception ex)
    |   {
    |   |   System.out.println("error invoking echoMultipleFaults1:" + 
    |   |       ex.getMessage());
    |   |   if (java.lang.System.getProperty("DEBUG") != null)
    |   |       ex.printStackTrace();
    |   }
    }
                                                                           
    public static void echoMultipleFaults2(ComplexRpcEncPortType stub)
    {
    |   try
    |   {
    |   |   System.out.print("echoMultipleFaults2: ");
    |   |   boolean result = Tests.echoMultipleFaults2(stub);
    |   |   System.out.println(result ? "OK" : "failed");
    |   }
    |   catch (java.lang.Exception ex)
    |   {
    |   |   System.out.println("error invoking echoMultipleFaults2:" + 
    |   |       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 grouph.complexrpc;
                                                                           
import javax.servlet.ServletException;
                                                                           
public class ServerImpl extends ComplexRpcEncPortType_ServiceSkeleton
{
    public void init()
        throws ServletException
    {
    |   super.init();
    |                                                                      
    |   // Set the WSDL file property
    |   _setProperty("xmlrpc.wsdl", "complex-rpc-encoded.wsdl");
    }
                                                                           
    public void echoSOAPStructFault(SOAPStructFault i0)
        throws SOAPStructFault, java.rmi.RemoteException
    {
    |   throw new SOAPStructFault(i0.getSoapStruct());
    }
                                                                           
    public void echoBaseStructFault(BaseStruct i0)
        throws BaseStruct, java.rmi.RemoteException
    {
    |   throw new BaseStruct(i0.getFloatMessage(), 
    |                                   i0.getShortMessage());
    }
                                                                           
    public void echoExtendedStructFault(ExtendedStruct i0)
        throws ExtendedStruct, java.rmi.RemoteException
    {
    |   throw new ExtendedStruct(i0.getFloatMessage(), 
    |                   i0.getShortMessage(), i0.getStringMessage(),
    |                   i0.getIntMessage(), i0.getAnotherIntMessage());
    }
                                                                           
    public void echoMultipleFaults1(int i0, SOAPStruct i1, 
        BaseStruct i2)
        throws BaseStruct, SOAPStructFault, 
            java.rmi.RemoteException
    {
    |   if (i0 == 2) {
    |   |   throw new BaseStruct(i2.getFloatMessage(),
    |   |                               i2.getShortMessage());
    |   } else {
    |   |   throw new SOAPStructFault(i1);
    |   }
    }
                                                                           
    public void echoMultipleFaults2(int i0, BaseStruct i1, 
        ExtendedStruct i2, MoreExtendedStruct i3)
        throws MoreExtendedStruct, ExtendedStruct, 
            BaseStruct, java.rmi.RemoteException
    {
    |   if (i0 == 2) {
    |   |   throw new ExtendedStruct(i2.getFloatMessage(), 
    |   |               i2.getShortMessage(), i2.getStringMessage(),
    |   |               i2.getIntMessage(), i2.getAnotherIntMessage());
    |   } else if (i0 == 3) {
    |   |   throw new MoreExtendedStruct(i3.getFloatMessage(), 
    |   |               i3.getShortMessage(), i3.getStringMessage(),
    |   |               i3.getIntMessage(), i3.getAnotherIntMessage(),
    |   |               i3.getBooleanMessage());
    |   } else {
    |   |   throw new BaseStruct(i1.getFloatMessage(),
    |   |                               i1.getShortMessage());
    |   }
    }
}


Copyright © 2003, 2004 Novell, Inc. All rights reserved. Copyright © 2001, 2002, 2003 SilverStream Software, LLC. All rights reserved.