Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Send XML Document over SOAP

Reply
Thread Tools

Send XML Document over SOAP

 
 
Scott Rubin
Guest
Posts: n/a
 
      04-08-2004
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:river. 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



 
Reply With Quote
 
 
 
 
James Britt
Guest
Posts: n/a
 
      04-09-2004
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



 
Reply With Quote
 
 
 
 
dhtapp
Guest
Posts: n/a
 
      04-09-2004

"James Britt" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

>
> 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


 
Reply With Quote
 
NAKAMURA, Hiroshi
Guest
Posts: n/a
 
      04-09-2004
Hi,

> From: "Scott Rubin" <(E-Mail Removed)>
> 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:river. 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


 
Reply With Quote
 
NAKAMURA, Hiroshi
Guest
Posts: n/a
 
      04-09-2004
Hi,

> From: "James Britt" <(E-Mail Removed)>
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VOIP over VPN over TCP over WAP over 3G Theo Markettos UK VOIP 2 02-14-2008 03:27 PM
SOAP over JMS vs SOAP over HTTP Nagesh Java 2 08-12-2006 12:31 AM
SOAP XML Generation from a SOAP Object (Soap4r 1.5.4) Dan Fitzpatrick Ruby 1 07-16-2005 01:01 PM
Refer to an XML document from within an XML document Manish Hatwalne XML 1 07-13-2004 10:24 AM
Help on including one XML document within another XML document using XML Schemas Tony Prichard XML 0 12-12-2003 03:18 PM



Advertisments