[jboss-user] [JBossWS] - How to prefix a SOAP Message with a Processing Instruction?

bsheward do-not-reply at jboss.com
Thu Apr 17 15:13:42 EDT 2008


Hi,

I have a very simple piece of code to invoke a web service:


  | ReService service = new ReService();
  | RePortType re = service.getRePort();
  | results = re.getReResult( query, username, password);
  | 

It results in the following SOAP message being posted:


  | <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
  |  <env:Header/>
  |  <env:Body>
  |   <GetRelevanceResult xmlns='http://myns'>
  |    <reExpr>select * from tbl</reExpr>
  |    <username>user</username>
  |    <password>xxxxxxxx</password>
  |   </GetRelevanceResult>
  |  </env:Body>
  | </env:Envelope>
  | 

The problem is that this request is rejected by the server. However, when I prefix the SOAP message with a processing instruction, the server responds correctly:


  | <?xml version="1.0" encoding="UTF-8"?>
  | <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
  |  <env:Header/>
  |  <env:Body>
  |   <GetRelevanceResult xmlns='http://myns'>
  |    <reExpr>select * from tbl</reExpr>
  |    <username>user</username>
  |    <password>xxxxxxxx</password>
  |   </GetRelevanceResult>
  |  </env:Body>
  | </env:Envelope>
  | 

(I tested this theory using SOAP UI (http://www.soapui.org/))

My question is, what is the best way, to prefix the processing instruction to the SOAP message?

Are HandlerChains the right way to go?

Are there any examples of this type of message manipulation?

Thanks and Regards,

Barry

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4144983#4144983

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4144983



More information about the jboss-user mailing list