2

I am writing a Java SOAP Client where multiple responses comes back asynchronously into a Client WebService. Since the response are asynchronous the client must pass in a MessageId into the SOAPHeader. The multiple responses will then pass back the same MessageId enabling the client to map up their requests with the many responses.

I have two Handler (Protocal and Logical). My SOAPHandler is picking up the MessageId and LogicalHander is picking up the Payload or real response. I wanted to hook these two pieces of information together somehow.

My problem is I have two different pieces of code one pulls MessageId and the other the Payload but I don't have a way of attaching the two reliably.

I am not sure if I am over looking something. Can I pull both the Header and Payload from a Protocal or Logical handler?

Peter Delaney
  • 5,278
  • 9
  • 33
  • 40

1 Answers1

12

You can do it all in the SOAP Handler.

"JAX-WS supports two types of SOAP message handlers: SOAP handlers and logical handlers. SOAP handlers can access the entire SOAP message, including the message headers and body. Logical handlers can access the payload of the message only, and cannot change any protocol-specific information (like headers) in a message."

see this for some explanation, and a nice picture :) also you can read Oracle documentation Overview of SOAP Message Handlers:

lpinto.eu
  • 2,077
  • 4
  • 21
  • 45