Round4/GroupG/MimeRpc

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"?>
<wsdl:definitions name="SOAPBuilders" 
    xmlns="http://soapinterop.org/attachments/wsdl" 
    xmlns:types="http://soapinterop.org/attachments/xsd" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
    xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" 
    targetNamespace="http://soapinterop.org/attachments/wsdl">
        <wsdl:types>
                <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/attachments/xsd">
                        <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
                        <complexType name="ArrayOfBinary">
                                <complexContent>
                                        <restriction base="soap-enc:Array">
                                                <attribute ref="soap-enc:arrayType" wsdl:arrayType="soap-enc:base64Binary[]"/>
                                        </restriction>
                                </complexContent>
                        </complexType>
                </schema>
        </wsdl:types>
        <wsdl:message name="EchoAttachmentIn">
                <wsdl:part name="In" type="xsd:base64Binary"/>
        </wsdl:message>
        <wsdl:message name="EchoAttachmentOut">
                <wsdl:part name="Out" type="xsd:base64Binary"/>
        </wsdl:message>
        <wsdl:message name="EchoAttachmentsIn">
                <wsdl:part name="In" type="types:ArrayOfBinary"/>
        </wsdl:message>
        <wsdl:message name="EchoAttachmentsOut">
                <wsdl:part name="Out" type="types:ArrayOfBinary"/>
        </wsdl:message>
        <wsdl:message name="EchoAttachmentAsBase64In">
                <wsdl:part name="In" type="xsd:base64Binary"/>
        </wsdl:message>
        <wsdl:message name="EchoAttachmentAsBase64Out">
                <wsdl:part name="Out" type="xsd:base64Binary"/>
        </wsdl:message>
        <wsdl:message name="EchoBase64AsAttachmentIn">
                <wsdl:part name="In" type="xsd:base64Binary"/>
        </wsdl:message>
        <wsdl:message name="EchoBase64AsAttachmentOut">
                <wsdl:part name="Out" type="xsd:base64Binary"/>
        </wsdl:message>
        <wsdl:portType name="AttachmentsPortType">
                <wsdl:operation name="EchoAttachment">
                        <wsdl:input name="EchoAttachmentInput" message="EchoAttachmentIn"/>
                        <wsdl:output name="EchoAttachmentOutput" message="EchoAttachmentOut"/>
                </wsdl:operation>
                <wsdl:operation name="EchoAttachments">
                        <wsdl:input name="EchoAttachmentsInput" message="EchoAttachmentsIn"/>
                        <wsdl:output name="EchoAttachmentsOutput" message="EchoAttachmentsOut"/>
                </wsdl:operation>
                <wsdl:operation name="EchoAttachmentAsBase64">
                        <wsdl:input name="EchoAttachmentAsBase64Input" message="EchoAttachmentAsBase64In"/>
                        <wsdl:output name="EchoAttachmentAsBase64Output" message="EchoAttachmentAsBase64Out"/>
                </wsdl:operation>
                <wsdl:operation name="EchoBase64AsAttachment">
                        <wsdl:input name="EchoBase64AsAttachmentInput" message="EchoBase64AsAttachmentIn"/>
                        <wsdl:output name="EchoBase64AsAttachmentOutput" message="EchoBase64AsAttachmentOut"/>
                </wsdl:operation>
        </wsdl:portType>
        <wsdl:binding name="AttachmentsBinding" type="AttachmentsPortType">
                <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
                <wsdl:operation name="EchoAttachment">
                        <soap:operation soapAction="http://soapinterop.org/attachments/"/>
                        <wsdl:input name="EchoAttachmentInput">
                                <mime:multipartRelated>
                                        <mime:part>
                                                <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
                                        </mime:part>
                                        <mime:part>
                                                <mime:content part="In" type="application/octetstream"/>
                                        </mime:part>
                                </mime:multipartRelated>
                        </wsdl:input>
                        <wsdl:output name="EchoAttachmentOutput">
                                <mime:multipartRelated>
                                        <mime:part>
                                                <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
                                        </mime:part>
                                        <mime:part>
                                                <mime:content part="Out" type="application/octetstream"/>
                                        </mime:part>
                                </mime:multipartRelated>
                        </wsdl:output>
                </wsdl:operation>
                <wsdl:operation name="EchoAttachments">
                        <soap:operation soapAction="http://soapinterop.org/attachments/"/>
                        <wsdl:input name="EchoAttachmentsInput">
                                <mime:multipartRelated>
                                        <mime:part>
                                                <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
                                        </mime:part>
                                        <mime:part>
                                                <mime:content part="In" type="application/octetstream"/>
                                        </mime:part>
                                </mime:multipartRelated>
                        </wsdl:input>
                        <wsdl:output name="EchoAttachmentsOutput">
                                <mime:multipartRelated>
                                        <mime:part>
                                                <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
                                        </mime:part>
                                        <mime:part>
                                                <mime:content part="Out" type="application/octetstream"/>
                                        </mime:part>
                                </mime:multipartRelated>
                        </wsdl:output>
                </wsdl:operation>
                <wsdl:operation name="EchoAttachmentAsBase64">
                        <soap:operation soapAction="http://soapinterop.org/attachments/"/>
                        <wsdl:input name="EchoAttachmentAsBase64Input">
                                <mime:multipartRelated>
                                        <mime:part>
                                                <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
                                        </mime:part>
                                        <mime:part>
                                                <mime:content part="In" type="application/octetstream"/>
                                        </mime:part>
                                </mime:multipartRelated>
                        </wsdl:input>
                        <wsdl:output name="EchoAttachmentAsBase64Output">
                                <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
                        </wsdl:output>
                </wsdl:operation>
                <wsdl:operation name="EchoBase64AsAttachment">
                        <soap:operation soapAction="http://soapinterop.org/attachments/"/>
                        <wsdl:input name="EchoBase64AsAttachmentInput">
                                <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
                        </wsdl:input>
                        <wsdl:output name="EchoBase64AsAttachmentOutput">
                                <mime:multipartRelated>
                                        <mime:part>
                                                <soap:body use="encoded" namespace="http://soapinterop.org/attachments/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
                                        </mime:part>
                                        <mime:part>
                                                <mime:content part="Out" type="application/octetstream"/>
                                        </mime:part>
                                </mime:multipartRelated>
                        </wsdl:output>
                </wsdl:operation>
        </wsdl:binding>
</wsdl:definitions>

Client

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

package groupg.mimerpc;
                                                                           
import javax.naming.InitialContext;
import javax.xml.rpc.Stub;
                                                                           
public class Client
{
    public static void main(String[] args) throws Exception
    {
    |   InitialContext ctx = new InitialContext();
    |   AttachmentsService service = (AttachmentsService)
    |           ctx.lookup("xmlrpc:soap:groupg.mimerpc.AttachmentsService");
    |   AttachmentsPortType stub = service.getAttachmentsPort();
    |                                                                      
    |   // set the end point address
    |   if (args.length > 0) 
    |       ((Stub)stub)._setProperty("javax.xml.rpc.service.endpoint.address",
    |           args[0]);
    |                                                                      
    |   echoAttachment(stub);
    |   echoBase64AsAttachment(stub);
    |   echoAttachmentAsBase64(stub);
    |   echoAttachments(stub);
    }
                                                                           
    public static void echoAttachment(AttachmentsPortType stub)
    {
    |   try
    |   {
    |   |   System.out.print("echoAttachment: ");
    |   |   boolean result = Tests.echoAttachment(stub);
    |   |   System.out.println(result ? "OK" : "failed");
    |   }
    |   catch (java.lang.Exception ex)
    |   {
    |   |   System.out.println("error invoking echoAttachment:" + 
    |   |       ex.getMessage());
    |   |   if (java.lang.System.getProperty("DEBUG") != null)
    |   |       ex.printStackTrace();
    |   }
    }
                                                                           
    public static void echoBase64AsAttachment(AttachmentsPortType stub)
    {
    |   try
    |   {
    |   |   System.out.print("echoBase64AsAttachment: ");
    |   |   boolean result = Tests.echoBase64AsAttachment(stub);
    |   |   System.out.println(result ? "OK" : "failed");
    |   }
    |   catch (java.lang.Exception ex)
    |   {
    |   |   System.out.println("error invoking echoBase64AsAttachment:" +
    |   |       ex.getMessage());
    |   |   if (java.lang.System.getProperty("DEBUG") != null)
    |   |       ex.printStackTrace();
    |   }
    }
                                                                           
    public static void echoAttachmentAsBase64(AttachmentsPortType stub)
    {
    |   try
    |   {
    |   |   System.out.print("echoAttachmentAsBase64: ");
    |   |   boolean result = Tests.echoAttachmentAsBase64(stub);
    |   |   System.out.println(result ? "OK" : "failed");
    |   }
    |   catch (java.lang.Exception ex)
    |   {
    |   |   System.out.println("error invoking echoAttachmentAsBase64:" + 
    |   |       ex.getMessage());
    |   |   if (System.getProperty("DEBUG") != null)
    |   |       ex.printStackTrace();
    |   }
    }
                                                                           
    public static void echoAttachments(AttachmentsPortType stub)
    {
    |   try
    |   {
    |   |   System.out.print("echoAttachments: ");
    |   |   boolean result = Tests.echoAttachments(stub);
    |   |   System.out.println(result ? "OK" : "failed");
    |   }
    |   catch (java.lang.Exception ex)
    |   {
    |   |   System.out.println("error invoking echoAttachments:" +      
    |   |       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 groupg.mimerpc;
                                                                           
import javax.servlet.ServletException;
                                                                           
public class ServerImpl extends AttachmentsPortType_ServiceSkeleton
{
    public void init()
        throws ServletException
    {
    |   super.init();
    |                                                                      
    |   // Set the WSDL file property
    |   _setProperty("xmlrpc.wsdl", "mime-rpc.wsdl");
    }
                                                                           
    public byte[] echoAttachment(byte[] i0)
        throws java.rmi.RemoteException
    {
    |   return i0;
    }
                                                                           
    public byte[] echoBase64AsAttachment(byte[] i0)
        throws java.rmi.RemoteException
    {
    |   return i0;
    }
                                                                           
    public byte[] echoAttachmentAsBase64(byte[] i0)
        throws java.rmi.RemoteException
    {
    |   return i0;
    }
                                                                           
    public byte[][] echoAttachments(byte[][] 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.