Send XML Document over SOAP

Discussion in 'Ruby' started by Scott Rubin, Apr 8, 2004.

  1. Scott Rubin

    Scott Rubin Guest

    Hello again,

    While I wait for SOAP/SSL to be implemented I have another problem. I
    have a web service running with many clients. The way it is set up is
    that through a web interface the admin will change the configurations of
    the clients. The clients will all have XML documents stored locally
    containing their settings. When changes are made the web service will
    send a new version of that XML document to the client VIA soap. My
    problem is that I can't seem to embed the XML document into the SOAP
    envelope and have it work on the other end. Many sites on the net say
    to use a SOAP attachment, but this wont work for our purposes.

    The best I've gotten it to do is have the response be a
    SOAP::Mapping:Object. This kind of works, but it doesn't give me access
    to attributes, multiple elements of the same name, or the type of the
    root element in the xml document.

    Let me re-phrase the question again, to be sure. I want to do the
    following. First, connect to a webservice using soap4r
    SOAP::RPC::Driver. Then call a function and recieve a response. I want
    that response to be, or be turned into, something I can pass to rexml to
    be parsed. Something like a Document object or a string of the xml
    document.

    Thanks for help.

    Scott
     
    Scott Rubin, Apr 8, 2004
    #1
    1. Advertising

  2. Scott Rubin

    James Britt Guest

    Scott Rubin wrote:
    > Hello again,
    >
    > While I wait for SOAP/SSL to be implemented I have another problem. I
    > have a web service running with many clients. The way it is set up is
    > that through a web interface the admin will change the configurations of
    > the clients. The clients will all have XML documents stored locally
    > containing their settings. When changes are made the web service will
    > send a new version of that XML document to the client VIA soap. My
    > problem is that I can't seem to embed the XML document into the SOAP
    > envelope and have it work on the other end. Many sites on the net say
    > to use a SOAP attachment, but this wont work for our purposes.


    I'm not a big fan of SOAP; too complicated for my tastes, and, as I
    recall, there are a few restrictions on what you may include as content.
    For example, you may not include an XML doc that has a DOCTYPE
    declaration. It breaks SOAP. (But check this; it's been a while since
    I did any serious research on SOAP. I tend to prefer XML-RPC)

    You could perhaps base64 encode the XML package and send it as "simple"
    string, then decode it at the client. Or it may be possible to wrap the
    payload doc in a CDATA section (but watch that the payload itself
    doesn't contain CDATA sections).



    James
     
    James Britt, Apr 9, 2004
    #2
    1. Advertising

  3. Scott Rubin

    dhtapp Guest

    "James Britt" <> wrote in message
    news:...

    >
    > You could perhaps base64 encode the XML package and send it as "simple"
    > string, then decode it at the client. Or it may be possible to wrap the
    > payload doc in a CDATA section (but watch that the payload itself
    > doesn't contain CDATA sections).
    >


    Scott,

    Something like this sounds way easier and more flexible than trying to break
    down the XML doc into key-value pairs and re-assemble it on the other side.

    One of the more useful treatments I've found on SOAP is Chapter 2 of
    Elliotte Rusty Harold's detailed explanation, at
    http://www.ibiblio.org/xml/books/xmljava/chapters/.


    - dan
     
    dhtapp, Apr 9, 2004
    #3
  4. Hi,

    > From: "Scott Rubin" <>
    > Sent: Friday, April 09, 2004 5:05 AM


    > While I wait for SOAP/SSL to be implemented I have another problem. I


    Same man responding. :)

    > The best I've gotten it to do is have the response be a
    > SOAP::Mapping:Object. This kind of works, but it doesn't give me access
    > to attributes, multiple elements of the same name, or the type of the
    > root element in the xml document.


    > Let me re-phrase the question again, to be sure. I want to do the
    > following. First, connect to a webservice using soap4r
    > SOAP::RPC::Driver. Then call a function and recieve a response. I want
    > that response to be, or be turned into, something I can pass to rexml to
    > be parsed. Something like a Document object or a string of the xml
    > document.


    If I understand the problem correctly, your client wants to call the
    service with "rpc/encoded" and want to get response with
    "document/literal" or "rpc/literal" right?

    Current soap4r rpc driver implementation can handle rpc/encoded,
    rpc/literal, document/literal, but has some restrictions.
    * call and response must be the same mode.
    * literal XML cannot have CDATA, PI, etc. etc.

    Can I see the call and response sample XML, could be privately?
    I might be able to find a workaround.
    If not, I'll show you examples for you to find one.

    Regards,
    // NaHi
     
    NAKAMURA, Hiroshi, Apr 9, 2004
    #4
  5. Hi,

    > From: "James Britt" <>
    > Sent: Friday, April 09, 2004 9:35 AM


    > I'm not a big fan of SOAP; too complicated for my tastes, and, as I
    > recall, there are a few restrictions on what you may include as content.
    > For example, you may not include an XML doc that has a DOCTYPE
    > declaration. It breaks SOAP. (But check this; it's been a while since
    > I did any serious research on SOAP. I tend to prefer XML-RPC)


    I know James already know, but for ML people, I point out
    that it's not SOAP's fault about including XML document problem.
    It's the issue about XML in XML. If you must embed any kind
    of XML document to send, you cannot use XML directly as a wire format.

    Sorry if it's unnecessary addition.

    Regards,
    // NaHi
     
    NAKAMURA, Hiroshi, Apr 9, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tony Prichard
    Replies:
    0
    Views:
    754
    Tony Prichard
    Dec 12, 2003
  2. Manish Hatwalne
    Replies:
    1
    Views:
    405
    Martin Honnen
    Jul 13, 2004
  3. Nagesh
    Replies:
    2
    Views:
    9,446
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=
    Aug 12, 2006
  4. Andrew 2006

    XML over TCP vs SOAP

    Andrew 2006, Jan 6, 2008, in forum: XML
    Replies:
    3
    Views:
    1,681
    Martin Honnen
    Jan 6, 2008
  5. Dan Fitzpatrick
    Replies:
    1
    Views:
    364
    NAKAMURA, Hiroshi
    Jul 16, 2005
Loading...

Share This Page