You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Beytullah Yildiz <be...@gmail.com> on 2005/03/13 23:07:56 UTC

Incorrect injection into response SOAP Envelope in message style service.

Hi all,

I am using message style web service.  When I try to send response
back from server , the original SOAPEnvelope is being modified. There
exist four valid signatures for message-style service methods. Since I
need the header,  I am using following method :

public void method(SOAPEnvelope request, SOAPEnvelope response);

The problem starts when I try to inject my
org.apache.axis.message.SOAPEnvelope by using getBody getHeader
setBody and setHeader methods of SOAPEnvelope. After injection, 
SOAPBody and SOAPHeader includes different prefixes than those which
are  original. When I send response in this way, I get exception in
client part  because of changes in the original message.

The scenario is as follows;
Firstly, I create a valid SOAPEnvelope:
org.apache.axis.message.SOAPEnvelope soapEnvelope;

I got SOAPBody and SOAPHeader from envelope:

org.apache.axis.message.SOAPBody soapBody = (org.apache.axis.message.
          SOAPBody) soapEnvelope.getBody();
org.apache.axis.message.SOAPHeader soapHeader = (org.apache.axis.message.
          SOAPHeader) soapEnvelope.getHeader();

I insert them into response:
response.setBody(soapBody);
response.setHeader(soapHeader);

At this point, client throws exception.

I tried  setSOAPEnvelope method  of SOAPEnvelope class. Somehow, it
does not work.  The response message reaches empty to the client.
response.setEnvelope(soapEnvelope);

So, my question is  how I can send a SOAPEnvelope without modification
through response SOAPEnvelope?

thanks
b.y