Round4/GroupH/SimpleRpc

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="EmptyFault"/>
                                                                           
                        <complexType name="ArrayOfString">
                                <complexContent>
                                        <restriction base="soap-enc:Array">
                                                <attribute ref="soap-enc:arrayType" wsdl:arrayType="string[]"/>
                                        </restriction>
                                </complexContent>
                        </complexType>
                                                                           
                        <complexType name="ArrayOfInt">
                                <complexContent>
                                        <restriction base="soap-enc:Array">
                                                <attribute ref="soap-enc:arrayType" wsdl:arrayType="int[]"/>
                                        </restriction>
                                </complexContent>
                        </complexType>
                                                                           
                        <complexType name="ArrayOfFloat">
                                <complexContent>
                                        <restriction base="soap-enc:Array">
                                                <attribute ref="soap-enc:arrayType" wsdl:arrayType="float[]"/>
                                        </restriction>
                                </complexContent>
                        </complexType>
                                                                           
                        <simpleType name="Enum">
                                <restriction base="int">
                                        <enumeration value="1"/>
                                        <enumeration value="2"/>
                                </restriction>
                        </simpleType>
                </schema>
        </types>
                                                                           
        <message name="echoFaultRequest"/>
        <message name="echoFaultResponse"/>
        <message name="echoStringFaultRequest">
                <part name="param" type="xsd:string"/>
        </message>
        <message name="echoIntArrayFaultRequest">
                <part name="param" type="ns2:ArrayOfInt"/>
        </message>
        <message name="echoMultipleFaults1Request">
                <part name="whichFault" type="xsd:int"/>
                <part name="param1" type="xsd:string"/>
                <part name="param2" type="ns2:ArrayOfFloat"/>
        </message>
        <message name="echoMultipleFaults2Request">
                <part name="whichFault" type="xsd:int"/>
                <part name="param1" type="xsd:string"/>
                <part name="param2" type="xsd:float"/>
                <part name="param3" type="ns2:ArrayOfString"/>
        </message>
        <message name="echoMultipleFaults3Request">
                <part name="whichFault" type="xsd:int"/>
                <part name="param1" type="xsd:string"/>
                <part name="param2" type="xsd:string"/>
        </message>
        <message name="echoMultipleFaults4Request">
                <part name="whichFault" type="xsd:int"/>
                <part name="param1" type="xsd:int"/>
                <part name="param2" type="ns2:Enum"/>
        </message>
                                                                           
        <!-- Fault messages -->
        <message name="EmptyFault">
                <part name="part1" type="ns2:EmptyFault"/>
        </message>
        <message name="StringFault">
                <part name="part2" type="xsd:string"/>
        </message>
        <message name="IntFault">
                <part name="part3" type="xsd:int"/>
        </message>
        <message name="FloatFault">
                <part name="part4" type="xsd:float"/>
        </message>
        <message name="IntArrayFault">
                <part name="part5" type="ns2:ArrayOfInt"/>
        </message>
        <message name="StringArrayFault">
                <part name="part6" type="ns2:ArrayOfString"/>
        </message>
        <message name="FloatArrayFault">
                <part name="part7" type="ns2:ArrayOfFloat"/>
        </message>
        <!--
                Part name same as in StringFault message
        -->
        <message name="String2Fault">
                <part name="part2" type="xsd:string"/>
        </message>
        <message name="EnumFault">
                <part name="part9" type="ns2:Enum"/>
        </message>
                                                                           
        <portType name="SimpleRpcEncPortType">
                <!--
                        Throws an empty fault
                -->
                <operation name="echoEmptyFault" parameterOrder="">
                        <input message="tns:echoFaultRequest"/>
                        <output message="tns:echoFaultResponse"/>
                        <fault name="SimpleFault" message="tns:EmptyFault"/>
                </operation>
                                                                           
                <!--
                        Throws fault with xsd:string parameter
                -->
                <operation name="echoStringFault" parameterOrder="param">
                        <input message="tns:echoStringFaultRequest"/>
                        <output message="tns:echoFaultResponse"/>
                        <fault name="SimpleFault" message="tns:StringFault"/>
                </operation>
                                                                           
                <!--
                        Throws fault with xsd:int[] parameter
                -->
                <operation name="echoIntArrayFault" parameterOrder="param">
                        <input message="tns:echoIntArrayFaultRequest"/>
                        <output message="tns:echoFaultResponse"/>
                        <fault name="SimpleFault" message="tns:IntArrayFault"/>
                </operation>
                                                                           
                <!--
                        Throws empty fault, fault with a xsd:string
                        parameter and fault with xsd:float[] parameter
                -->
                <operation name="echoMultipleFaults1" parameterOrder="whichFault param1 param2">
                        <input message="tns:echoMultipleFaults1Request"/>
                        <output message="tns:echoFaultResponse"/>
                        <fault name="SimpleFault1" message="tns:EmptyFault"/>
                        <fault name="SimpleFault2" message="tns:StringFault"/>
                        <fault name="SimpleFault3" message="tns:FloatArrayFault"/>
                </operation>
                                                                           
                <!--
                        Throws fault with xsd:string parameter, fault with
                        xsd:float parameter and fault with xsd:string[]
                        parameters
                -->
                <operation name="echoMultipleFaults2" parameterOrder="whichFault param1 param2 param3">
                        <input message="tns:echoMultipleFaults2Request"/>
                        <output message="tns:echoFaultResponse"/>
                        <fault name="SimpleFault1" message="tns:StringFault"/>
                        <fault name="SimpleFault2" message="tns:FloatFault"/>
                        <fault name="SimpleFault3" message="tns:StringArrayFault"/>
                </operation>
                                                                           
                <!--
                        Throws two faults, each with xsd:string parameters
                        and same part names. Each part name is bound to a different
                        namespace.
                -->
                <operation name="echoMultipleFaults3" parameterOrder="whichFault param1 param2">
                        <input message="tns:echoMultipleFaults3Request"/>
                        <output message="tns:echoFaultResponse"/>
                        <fault name="SimpleFault1" message="tns:StringFault"/>
                        <fault name="SimpleFault2" message="tns:String2Fault"/>
                </operation>
                                                                           
                <!--
                        Throws fault with xsd:int parameter and fault with an
                        int enumeration parameter
                -->
                <operation name="echoMultipleFaults4" parameterOrder="whichFault param1 param2">
                        <input message="tns:echoMultipleFaults4Request"/>
                        <output message="tns:echoFaultResponse"/>
                        <fault name="SimpleFault1" message="tns:IntFault"/>
                        <fault name="SimpleFault2" message="tns:EnumFault"/>
                </operation>
        </portType>
                                                                           
        <binding name="SimpleRpcEncBinding" type="tns:SimpleRpcEncPortType">
                <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
                                                                           
                <operation name="echoEmptyFault">
                        <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="SimpleFault">
                                <soap:fault
                                        name="SimpleFault"
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </fault>
                        <soap:operation soapAction=""/>
                </operation>
                                                                           
                <operation name="echoStringFault">
                        <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="SimpleFault">
                                <soap:fault
                                        name="SimpleFault"
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </fault>
                        <soap:operation soapAction=""/>
                </operation>
                                                                           
                <operation name="echoIntArrayFault">
                        <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="SimpleFault">
                                <soap:fault
                                        name="SimpleFault"
                                        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="SimpleFault1">
                                <soap:fault
                                        name="SimpleFault1"
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </fault>
                        <fault name="SimpleFault2">
                                <soap:fault
                                        name="SimpleFault2"
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </fault>
                        <fault name="SimpleFault3">
                                <soap:fault
                                        name="SimpleFault3"
                                        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="SimpleFault1">
                                <soap:fault
                                        name="SimpleFault1"
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </fault>
                        <fault name="SimpleFault2">
                                <soap:fault
                                        name="SimpleFault2"
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </fault>
                        <fault name="SimpleFault3">
                                <soap:fault
                                        name="SimpleFault3"
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </fault>
                        <soap:operation soapAction=""/>
                </operation>
                                                                           
                <operation name="echoMultipleFaults3">
                        <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="SimpleFault1">
                                <soap:fault
                                        name="SimpleFault1"
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl/fault1"/>
                        </fault>
                        <fault name="SimpleFault2">
                                <soap:fault
                                        name="SimpleFault2"
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl/fault2"/>
                        </fault>
                        <soap:operation soapAction=""/>
                </operation>
                                                                           
                <operation name="echoMultipleFaults4">
                        <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="SimpleFault1">
                                <soap:fault
                                        name="SimpleFault1"
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </fault>
                        <fault name="SimpleFault2">
                                <soap:fault
                                        name="SimpleFault2"
                                        encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                                        use="encoded"
                                        namespace="http://soapinterop.org/wsdl"/>
                        </fault>
                        <soap:operation soapAction=""/>
                </operation>
                                                                           
        </binding>
                                                                           
        <service name="SimpleRpcEncService">
                <port name="SimpleRpcEncPort" binding="tns:SimpleRpcEncBinding">
                        <soap:address
                                location="http://soapinterop.novell.com/interop/round4/grouph/simplerpc"/>
                </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.simplerpc;
                                                                           
import javax.naming.InitialContext;
import javax.xml.rpc.Stub;
                                                                           
public class Client
{
    public static void main(String[] args) throws Exception
    {
    |   InitialContext ctx = new InitialContext();
    |   SimpleRpcEncService service = (SimpleRpcEncService)
    |           ctx.lookup("xmlrpc:soap:grouph.simplerpc.SimpleRpcEncService");
    |   SimpleRpcEncPortType stub = service.getSimpleRpcEncPort();
    |                                                                      
    |   // set the end point address
    |   if (args.length > 0) 
    |       ((Stub)stub)._setProperty("javax.xml.rpc.service.endpoint.address",
    |           args[0]);
    |                                                                      
    |   echoEmptyFault(stub);
    |   echoStringFault(stub);
    |   echoIntArrayFault(stub);
    |   echoMultipleFaults1(stub);
    |   echoMultipleFaults2(stub);
    |   echoMultipleFaults3(stub);
    |   echoMultipleFaults4(stub);
    }
                                                                           
    public static void echoEmptyFault(SimpleRpcEncPortType stub)
    {
    |   try
    |   {
    |   |   System.out.print("echoEmptyFault: ");
    |   |   boolean result = Tests.echoEmptyFault(stub);
    |   |   System.out.println(result ? "OK" : "failed");
    |   }
    |   catch (java.lang.Exception ex)
    |   {
    |   |   System.out.println("error invoking echoEmptyFault:" + 
    |   |       ex.getMessage());
    |   |   if (java.lang.System.getProperty("DEBUG") != null)
    |   |       ex.printStackTrace();
    |   }
    }
                                                                           
    public static void echoStringFault(SimpleRpcEncPortType stub)
    {
    |   try
    |   {
    |   |   System.out.print("echoStringFault: ");
    |   |   boolean result = Tests.echoStringFault(stub);
    |   |   System.out.println(result ? "OK" : "failed");
    |   }
    |   catch (java.lang.Exception ex)
    |   {
    |   |   System.out.println("error invoking echoStringFault:" +
    |   |       ex.getMessage());
    |   |   if (java.lang.System.getProperty("DEBUG") != null)
    |   |       ex.printStackTrace();
    |   }
    }
                                                                           
    public static void echoIntArrayFault(SimpleRpcEncPortType stub)
    {
    |   try
    |   {
    |   |   System.out.print("echoIntArrayFault: ");
    |   |   boolean result = Tests.echoIntArrayFault(stub);
    |   |   System.out.println(result ? "OK" : "failed");
    |   }
    |   catch (java.lang.Exception ex)
    |   {
    |   |   System.out.println("error invoking echoIntArrayFault:" + 
    |   |       ex.getMessage());
    |   |   if (System.getProperty("DEBUG") != null)
    |   |       ex.printStackTrace();
    |   }
    }
                                                                           
    public static void echoMultipleFaults1(SimpleRpcEncPortType 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 (System.getProperty("DEBUG") != null)
    |   |       ex.printStackTrace();
    |   }
    }
                                                                           
    public static void echoMultipleFaults2(SimpleRpcEncPortType 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 (System.getProperty("DEBUG") != null)
    |   |       ex.printStackTrace();
    |   }
    }
                                                                           
    public static void echoMultipleFaults3(SimpleRpcEncPortType stub)
    {
    |   try
    |   {
    |   |   System.out.print("echoMultipleFaults3: ");
    |   |   boolean result = Tests.echoMultipleFaults3(stub);
    |   |   System.out.println(result ? "OK" : "failed");
    |   }
    |   catch (java.lang.Exception ex)
    |   {
    |   |   System.out.println("error invoking echoMultipleFaults3:" +
    |   |       ex.getMessage());
    |   |   if (System.getProperty("DEBUG") != null)
    |   |       ex.printStackTrace();
    |   }
    }
                                                                           
    public static void echoMultipleFaults4(SimpleRpcEncPortType stub)
    {
    |   try
    |   {
    |   |   System.out.print("echoMultipleFaults4: ");
    |   |   boolean result = Tests.echoMultipleFaults4(stub);
    |   |   System.out.println(result ? "OK" : "failed");
    |   }
    |   catch (java.lang.Exception ex)
    |   {
    |   |   System.out.println("error invoking echoMultipleFaults4:" +
    |   |       ex.getMessage());
    |   |   if (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.simplerpc;
                                                                           
import javax.servlet.ServletException;
                                                                           
public class ServerImpl extends SimpleRpcEncPortType_ServiceSkeleton
{
    public void init()
        throws ServletException
    {
    |   super.init();
    |                                                                      
    |   // Set the WSDL file property
    |   _setProperty("xmlrpc.wsdl", "simple-rpc-encoded.wsdl");
    }
                                                                           
    public void echoIntArrayFault(int[] i0)
        throws IntArrayFault, java.rmi.RemoteException
    {
    |   throw new IntArrayFault(i0);
    }
                                                                           
    public void echoMultipleFaults4(int i0, int i1, grouph.simplerpc.Enum i2)
        throws EnumFault, IntFault, java.rmi.RemoteException
    {
    |   if (i0 == 2) {
    |   |   throw new EnumFault(i2);
    |   } else {
    |   |   throw new IntFault(i1);
    |   }
    }
                                                                           
    public void echoMultipleFaults3(int i0, java.lang.String i1, java.lang.String i2)
        throws String2Fault, StringFault, java.rmi.RemoteException
    {
    |   if (i0 == 2) {
    |   |   throw new String2Fault(i2);
    |   } else {
    |   |   throw new StringFault(i1);
    |   }
    }
                                                                           
    public void echoMultipleFaults2(int i0, java.lang.String i1, float i2, java.lang.String[] i3)
        throws StringArrayFault, FloatFault, StringFault, java.rmi.RemoteException
    {
    |   if (i0 == 2) {
    |   |   throw new StringFault(i1);
    |   } else if (i0 == 3) {
    |   |   throw new StringArrayFault(i3);
    |   } else {
    |   |   throw new FloatFault(i2);
    |   }
    }
                                                                           
    public void echoStringFault(java.lang.String i0)
        throws StringFault, java.rmi.RemoteException
    {
    |   throw new StringFault(i0);
    }
                                                                           
    public void echoMultipleFaults1(int i0, java.lang.String i1, float[] i2)
        throws FloatArrayFault, StringFault, EmptyFault, 
//        throws FloatArrayFault, StringFault, EmptyFault_Exception, 
        java.rmi.RemoteException
    {
    |   if (i0 == 2) {
    |   |   throw new StringFault(i1);
    |   } else if (i0 == 3) {
    |   |   throw new FloatArrayFault(i2);
    |   } else {
    |   |   throw new EmptyFault();
//          throw new EmptyFault_Exception();
    |   }
    }
                                                                           
    public void echoEmptyFault()
        throws EmptyFault, java.rmi.RemoteException
//        throws EmptyFault_Exception, java.rmi.RemoteException
    {
    |   throw new EmptyFault();
//      throw new EmptyFault_Exception();
    }
}


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