Loading ...
Sorry, an error occurred while loading the content.

SOAP Vs XML-RPC

Expand Messages
  • Gaurav
    Hello, I am working on the J2ME platform on an embedded device that may need to provide certain Web services. My requirement is that I need to marshall the
    Message 1 of 2 , Mar 6, 2003
    • 0 Attachment
      Hello,
      I am working on the J2ME platform on an embedded device that
      may need to provide certain Web services. My requirement is that I
      need to marshall the data in XML format. But the glitch is that the
      data I will sending will be a Binary payload. Now is SOAP better for
      such an implemetation or XML-RPC. I believe XML-RPC does not allow
      you to send data as a binary, whereas in SOAP I could send it as an
      attachment???

      Please let me know.

      Also does J2ME provide SOAP????????? I know Sun is working on JSR-172
      (XML-RPC) but the completion date seems far away.

      Please help me out.

      Thanks in Advance!
    • nasseam_02754
      Both XML-RPC and SOAP both support transporting binary data using base64-encoding. You can use Apache s XML-RPC implementation found here:
      Message 2 of 2 , Mar 9, 2003
      • 0 Attachment
        Both XML-RPC and SOAP both support transporting binary data using
        base64-encoding.

        You can use Apache's XML-RPC implementation found here:
        http://ws.apache.org/xmlrpc/
        You'll be interested in the org.apache.xmlrpc.Base64 class.

        Apache's SOAP implementation can be found here:
        http://ws.apache.org/axis/
        You'll be interested in the org.apache.axis.encoding.Base64 class.

        Additionally, the XML Schema encoding specifies two other binary
        data types:

        base64Binary (Base64-encoded binary data)
        hexBinary (hexadecimal-encoded binary data)

        Apache has a custom class for supporting the primitive XSD data type
        hexBinary called org.apache.axis.types.HexBinary.

        The Apache projects are open source so you can take out optional
        classes to meet the requirements of your embedded environment.

        SOAP with Attachments (SwA) is another option but you will have to
        use SwA APIs or the JavaMail APIs. The JavaMail APIs require the
        JavaBeans Activation Framework package so for both of those packages
        you are looking at about a 350 KB footprint.

        J2ME does not provide a SOAP implementation. However, there are a
        lot of open source SOAP implementations for Java that you could
        possibly port to J2ME, but to save you the headache there are
        already XML-RPC and SOAP implementation for J2ME from Enhydra.

        Enhydra has an XML-RPC API for J2ME found here:
        http://kxmlrpc.enhydra.org/index.html
        The org.kobjects.base64 package provides support for Base64 encoding
        of byte arrays.

        Enhydra has a SOAP API for J2ME called kSOAP which you can find
        here: http://ksoap.enhydra.org/index.html
        There is a Base64 (de)serializer class called
        org.ksoap.marshal.MarshalBase64.

        kSOAP does not support SwA so if you really want SwA, you can
        combine kSOAP with JavaMail or some other mail attachment API
        available for J2ME. I heard Nextel has one but I can't seem to find
        it. There is a commercial product that offers it here:
        http://www.reqwireless.com/products-email.html

        LINKS:
        XML, SOAP and Binary Data -
        http://www.xml.com/pub/a/2003/02/26/binaryxml.html
        Transporting Binary Data in SOAP -
        http://webservices.xml.com/pub/a/ws/2002/08/28/endpoints.html
        JavaMail - http://java.sun.com/products/javamail/

        -Nasseam
        http://www.myspotter.com

        --- In soapbuilders@yahoogroups.com, "Gaurav" <grana_13@y...> wrote:
        > Hello,
        > I am working on the J2ME platform on an embedded device
        that
        > may need to provide certain Web services. My requirement is that
        I
        > need to marshall the data in XML format. But the glitch is that
        the
        > data I will sending will be a Binary payload. Now is SOAP better
        for
        > such an implemetation or XML-RPC. I believe XML-RPC does not allow
        > you to send data as a binary, whereas in SOAP I could send it as
        an
        > attachment???
        >
        > Please let me know.
        >
        > Also does J2ME provide SOAP????????? I know Sun is working on JSR-
        172
        > (XML-RPC) but the completion date seems far away.
        >
        > Please help me out.
        >
        > Thanks in Advance!
      Your message has been successfully submitted and would be delivered to recipients shortly.