You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Du...@euroclear.com on 2005/04/15 15:52:59 UTC

transforming bytes to SOAP Message

Hello, I hope someone can help.

We're sending SOAP messages to our web service via a simple proxy. the 
proxy sets up input and output streams and passes with SOAP message on to 
the web service with no problems. Now what we want to do is add fields to 
the body of the SOAP message when it passes through the proxy.

I suppose an ideal way to do this would be to transform the bytes stream 
back to a SOAP message and manipulate the body, before passing it on. does 
anyone know how to do this? The main problem is that the proxy is not in a 
J2EE container so we can't use HTTPRequest.

Ideally I don't want to have to do string manipulation on the input and 
repopulate a new envelope, if I can help it.

I'd be grateful of any help.

cheers
Duncan

This email message, including any attachments transmitted with it, is CONFIDENTIAL and may contain legally privileged information.  
This message is intended solely for the use of the individual or entity to whom it is addressed.  If you are not the intended recipient you should not read, copy, distribute, disclose or otherwise use this information. 
If you have received this message in error, please notify us immediately and delete it from your system.  The integrity and security of this message cannot be guaranteed and it may be subject to data corruption and unauthorised amendment, for which we accept no liability. 
Euroclear reserves the right to retain email messages on its systems and to the extent and under circumstances permitted by applicable law, to monitor and intercept email messages to and from its systems.
Euroclear is the marketing name for the Euroclear system, Euroclear plc, Euroclear SA/NV and their affiliates.

http://www.euroclear.com


Re: transforming bytes to SOAP Message

Posted by Du...@euroclear.com.
hi Scott,

thanks for that. it was pretty much the conclusion I was coming too - I 
just didn't know if there might be a way to re-use the SOAP envelope 
rather than parse the message and create a new one?

Duncan



"Scott Nichol" <sn...@scottnichol.com> 
15/04/2005 16:59
Please respond to
soap-user@ws.apache.org


To
<so...@ws.apache.org>
cc

Subject
Re: transforming bytes to SOAP Message






If the fields you add will depend on the contents of the SOAP envelope 
being passed through the proxy, you pretty definitely will want to parse 
the envelope into something, then create a new envelope to pass through. 
You could do this with a standard XML parser.  Creating and traversing the 
DOM to see what you have received is not too onerous; likewise for 
subsequently adding elements and serializing the modified DOM to a stream.

If you are always going to add the same fields, you might try to cheat and 
not do full parsing, but I would guess that in the long run, you would be 
better off using a parser and manipulating a DOM.

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message ----- 
From: <Du...@euroclear.com>
To: <so...@ws.apache.org>
Sent: Friday, April 15, 2005 9:52 AM
Subject: transforming bytes to SOAP Message


> Hello, I hope someone can help.
> 
> We're sending SOAP messages to our web service via a simple proxy. the 
> proxy sets up input and output streams and passes with SOAP message on 
to 
> the web service with no problems. Now what we want to do is add fields 
to 
> the body of the SOAP message when it passes through the proxy.
> 
> I suppose an ideal way to do this would be to transform the bytes stream 

> back to a SOAP message and manipulate the body, before passing it on. 
does 
> anyone know how to do this? The main problem is that the proxy is not in 
a 
> J2EE container so we can't use HTTPRequest.
> 
> Ideally I don't want to have to do string manipulation on the input and 
> repopulate a new envelope, if I can help it.
> 
> I'd be grateful of any help.
> 
> cheers
> Duncan
> 
> This email message, including any attachments transmitted with it, is 
CONFIDENTIAL and may contain legally privileged information. 
> This message is intended solely for the use of the individual or entity 
to whom it is addressed.  If you are not the intended recipient you should 
not read, copy, distribute, disclose or otherwise use this information. 
> If you have received this message in error, please notify us immediately 
and delete it from your system.  The integrity and security of this 
message cannot be guaranteed and it may be subject to data corruption and 
unauthorised amendment, for which we accept no liability. 
> Euroclear reserves the right to retain email messages on its systems and 
to the extent and under circumstances permitted by applicable law, to 
monitor and intercept email messages to and from its systems.
> Euroclear is the marketing name for the Euroclear system, Euroclear plc, 
Euroclear SA/NV and their affiliates.
> 
> http://www.euroclear.com
> 
> 


Re: transforming bytes to SOAP Message

Posted by Scott Nichol <sn...@scottnichol.com>.
If the fields you add will depend on the contents of the SOAP envelope being passed through the proxy, you pretty definitely will want to parse the envelope into something, then create a new envelope to pass through.  You could do this with a standard XML parser.  Creating and traversing the DOM to see what you have received is not too onerous; likewise for subsequently adding elements and serializing the modified DOM to a stream.

If you are always going to add the same fields, you might try to cheat and not do full parsing, but I would guess that in the long run, you would be better off using a parser and manipulating a DOM.

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message ----- 
From: <Du...@euroclear.com>
To: <so...@ws.apache.org>
Sent: Friday, April 15, 2005 9:52 AM
Subject: transforming bytes to SOAP Message


> Hello, I hope someone can help.
> 
> We're sending SOAP messages to our web service via a simple proxy. the 
> proxy sets up input and output streams and passes with SOAP message on to 
> the web service with no problems. Now what we want to do is add fields to 
> the body of the SOAP message when it passes through the proxy.
> 
> I suppose an ideal way to do this would be to transform the bytes stream 
> back to a SOAP message and manipulate the body, before passing it on. does 
> anyone know how to do this? The main problem is that the proxy is not in a 
> J2EE container so we can't use HTTPRequest.
> 
> Ideally I don't want to have to do string manipulation on the input and 
> repopulate a new envelope, if I can help it.
> 
> I'd be grateful of any help.
> 
> cheers
> Duncan
> 
> This email message, including any attachments transmitted with it, is CONFIDENTIAL and may contain legally privileged information.  
> This message is intended solely for the use of the individual or entity to whom it is addressed.  If you are not the intended recipient you should not read, copy, distribute, disclose or otherwise use this information. 
> If you have received this message in error, please notify us immediately and delete it from your system.  The integrity and security of this message cannot be guaranteed and it may be subject to data corruption and unauthorised amendment, for which we accept no liability. 
> Euroclear reserves the right to retain email messages on its systems and to the extent and under circumstances permitted by applicable law, to monitor and intercept email messages to and from its systems.
> Euroclear is the marketing name for the Euroclear system, Euroclear plc, Euroclear SA/NV and their affiliates.
> 
> http://www.euroclear.com
> 
> 

RE: transforming bytes to SOAP Message

Posted by mdonaghue <md...@mZeal.com>.
Right. Maybe you could have your app import some of api's used by soap
servers to package and parse soap messages.  

 

Regards,

Mark

 

  _____  

From: Duncan.Harper@euroclear.com [mailto:Duncan.Harper@euroclear.com] 
Sent: Friday, April 15, 2005 12:01 PM
To: soap-user@ws.apache.org
Subject: RE: transforming bytes to SOAP Message

 


Hi Mark, 

thanks for this - unfortunately the proxy has to be a stand-alone app
sitting on a gateway machine, and definitely can't be on a server... 

cheers anyway 
Duncan 




"mdonaghue" <md...@mZeal.com> 

15/04/2005 16:15 


Please respond to
soap-user@ws.apache.org


To

<so...@ws.apache.org> 


cc

 


Subject

RE: transforming bytes to SOAP Message

 


 

 




Hi, 
  
The problem seems to be that the proxy doesn't give you access to the apis
that you need to manipulate the soap message. It might be easier to rewrite
the proxy and have it live on a soap-enabled server. 
  
Regards, 
Mark 
  

 

  _____  


From: Duncan.Harper@euroclear.com [mailto:Duncan.Harper@euroclear.com] 
Sent: Friday, April 15, 2005 9:53 AM
To: soap-user@ws.apache.org
Subject: transforming bytes to SOAP Message 
  

Hello, I hope someone can help. 

We're sending SOAP messages to our web service via a simple proxy. the proxy
sets up input and output streams and passes with SOAP message on to the web
service with no problems. Now what we want to do is add fields to the body
of the SOAP message when it passes through the proxy. 

I suppose an ideal way to do this would be to transform the bytes stream
back to a SOAP message and manipulate the body, before passing it on. does
anyone know how to do this? The main problem is that the proxy is not in a
J2EE container so we can't use HTTPRequest. 

Ideally I don't want to have to do string manipulation on the input and
repopulate a new envelope, if I can help it. 

I'd be grateful of any help. 

cheers 
Duncan

This email message, including any attachments transmitted with it, is
CONFIDENTIAL and may contain legally privileged information. 
This message is intended solely for the use of the individual or entity to
whom it is addressed. If you are not the intended recipient you should not
read, copy, distribute, disclose or otherwise use this information. 
If you have received this message in error, please notify us immediately and
delete it from your system. The integrity and security of this message
cannot be guaranteed and it may be subject to data corruption and
unauthorised amendment, for which we accept no liability. 
Euroclear reserves the right to retain email messages on its systems and to
the extent and under circumstances permitted by applicable law, to monitor
and intercept email messages to and from its systems.
Euroclear is the marketing name for the Euroclear system, Euroclear plc,
Euroclear SA/NV and their affiliates.

http://www.euroclear.com 


RE: transforming bytes to SOAP Message

Posted by Du...@euroclear.com.
Hi Mark,

thanks for this - unfortunately the proxy has to be a stand-alone app 
sitting on a gateway machine, and definitely can't be on a server...

cheers anyway
Duncan



"mdonaghue" <md...@mZeal.com> 
15/04/2005 16:15
Please respond to
soap-user@ws.apache.org


To
<so...@ws.apache.org>
cc

Subject
RE: transforming bytes to SOAP Message






Hi,
 
The problem seems to be that the proxy doesn?t give you access to the apis 
that you need to manipulate the soap message. It might be easier to 
rewrite the proxy and have it live on a soap-enabled server. 
 
Regards,
Mark
 

From: Duncan.Harper@euroclear.com [mailto:Duncan.Harper@euroclear.com] 
Sent: Friday, April 15, 2005 9:53 AM
To: soap-user@ws.apache.org
Subject: transforming bytes to SOAP Message
 

Hello, I hope someone can help. 

We're sending SOAP messages to our web service via a simple proxy. the 
proxy sets up input and output streams and passes with SOAP message on to 
the web service with no problems. Now what we want to do is add fields to 
the body of the SOAP message when it passes through the proxy. 

I suppose an ideal way to do this would be to transform the bytes stream 
back to a SOAP message and manipulate the body, before passing it on. does 
anyone know how to do this? The main problem is that the proxy is not in a 
J2EE container so we can't use HTTPRequest. 

Ideally I don't want to have to do string manipulation on the input and 
repopulate a new envelope, if I can help it. 

I'd be grateful of any help. 

cheers 
Duncan

This email message, including any attachments transmitted with it, is 
CONFIDENTIAL and may contain legally privileged information. 
This message is intended solely for the use of the individual or entity to 
whom it is addressed. If you are not the intended recipient you should not 
read, copy, distribute, disclose or otherwise use this information. 
If you have received this message in error, please notify us immediately 
and delete it from your system. The integrity and security of this message 
cannot be guaranteed and it may be subject to data corruption and 
unauthorised amendment, for which we accept no liability. 
Euroclear reserves the right to retain email messages on its systems and 
to the extent and under circumstances permitted by applicable law, to 
monitor and intercept email messages to and from its systems.
Euroclear is the marketing name for the Euroclear system, Euroclear plc, 
Euroclear SA/NV and their affiliates.

http://www.euroclear.com

RE: transforming bytes to SOAP Message

Posted by mdonaghue <md...@mZeal.com>.
Hi,

 

The problem seems to be that the proxy doesn't give you access to the apis
that you need to manipulate the soap message. It might be easier to rewrite
the proxy and have it live on a soap-enabled server. 

 

Regards,

Mark

 

  _____  

From: Duncan.Harper@euroclear.com [mailto:Duncan.Harper@euroclear.com] 
Sent: Friday, April 15, 2005 9:53 AM
To: soap-user@ws.apache.org
Subject: transforming bytes to SOAP Message

 


Hello, I hope someone can help. 

We're sending SOAP messages to our web service via a simple proxy. the proxy
sets up input and output streams and passes with SOAP message on to the web
service with no problems. Now what we want to do is add fields to the body
of the SOAP message when it passes through the proxy. 

I suppose an ideal way to do this would be to transform the bytes stream
back to a SOAP message and manipulate the body, before passing it on. does
anyone know how to do this? The main problem is that the proxy is not in a
J2EE container so we can't use HTTPRequest. 

Ideally I don't want to have to do string manipulation on the input and
repopulate a new envelope, if I can help it. 

I'd be grateful of any help. 

cheers 
Duncan

This email message, including any attachments transmitted with it, is
CONFIDENTIAL and may contain legally privileged information. 
This message is intended solely for the use of the individual or entity to
whom it is addressed. If you are not the intended recipient you should not
read, copy, distribute, disclose or otherwise use this information. 
If you have received this message in error, please notify us immediately and
delete it from your system. The integrity and security of this message
cannot be guaranteed and it may be subject to data corruption and
unauthorised amendment, for which we accept no liability. 
Euroclear reserves the right to retain email messages on its systems and to
the extent and under circumstances permitted by applicable law, to monitor
and intercept email messages to and from its systems.
Euroclear is the marketing name for the Euroclear system, Euroclear plc,
Euroclear SA/NV and their affiliates.

http://www.euroclear.com