Looks like this will do it: ( modified from the WS-Addressing example in CXF 
2.1.3 samples )

      final ApplicationContext context =
         new ClassPathXmlApplicationContext( "/clientAppContext.xml" );

      final JaxWsProxyFactoryBean factory =
         ( JaxWsProxyFactoryBean ) context.getBean( "clientFactory" );

      final Client client = factory.getClientFactoryBean(  ).create(  );

      // get Message Addressing Properties instance
      final AddressingBuilder builder =
         AddressingBuilder.getAddressingBuilder(  );
      final AddressingProperties maps =
         builder.newAddressingProperties(  );

      // set MessageID property
      final AttributedURIType messageID = new AttributedURIType(  );
      messageID.setValue( "urn:uuid:" + "TRANSACTION_ID" );
      maps.setMessageID( messageID );

      // associate MAPs with request context
      final Map<String, Object> requestContext =
         client.getRequestContext(  );
      requestContext.put( 
         CLIENT_ADDRESSING_PROPERTIES,
         maps );

Thanks for the input and suggestions. I guess did not look *close* enough at 
the CXF 2.1.3 WS-Addressing sample code. (see "explicitPropagation" method in 
the Client.java)

Now I just have to determine when to set this MesssageID and how to ensure it 
is unique. More fun for me.

The server will have to access this MessageID in the inbound SOAP messages and 
include it in any transaction logging but I am guessing I can write an 
interceptor to handle this task. 

Thanks to all,

Jeff

-----Original Message-----
From: Ulhas Bhole [mailto:ulhas.bh...@progress.com] 
Sent: Wednesday, March 18, 2009 8:51 AM
To: users@cxf.apache.org
Subject: Re: Tacking messages across several SOAP Request

Can adding out-of-band SOAP Header in message be of any help to you? 
Which will allow you to set the ID as well as read it from SOAP Message?

But this will involve writing some code though.

If you want to take a look at how the SOAP out-of-band header works you 
can have a look at test case here.
http://svn.eu.apache.org/repos/asf/cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/outofband/header/

Regards,

Ulhas

jeffrey.constan...@cox.com wrote:
> I will talk to our design team about a lightweight workflow system. I really 
> want a unique transactionID generated by the client to follow the SOAP calls 
> throughout our backend provisioning systems. I just don't know how to embed 
> it in the SOAP message. We had an XML over HTTP architecture and we embedded 
> a transactionID in *every* XML schema we passed around. I could add a 
> transactionID to *every* SOAP call but that is not a good solution. I really 
> want it outside of the content.
>
> I could use the MessageID in WS-Addressing if I can set it programmatically 
> but I have not found a way to intercept the MessageID creation. I can read it 
> before it goes out but I don't see how to set it prior to sending the SOAP 
> message. Is this possible?
>
> Thanks for the ideas,
>
> jeff
>
> -----Original Message-----
> From: Bryan Kearney [mailto:bkear...@redhat.com] 
> Sent: Tuesday, March 17, 2009 4:32 PM
> To: users@cxf.apache.org
> Subject: Re: Tacking messages across several SOAP Request
>
> jeffrey.constan...@cox.com wrote:
>   
>> Thanks Andrew.
>>
>> I am attempting to do this without a "home-grown" solution. If this can be 
>> done using WS-Addressing or some other well-known method I will be happy. As 
>> a last resort I will be writing something like you did.
>>
>> Thanks,
>>
>> Jeff
>>     
>
> Can you use a light weigh orchestration/workflow system? This seems to 
> be what BPEL was designed for.
>
> -- bk
>
>
>
>   


Reply via email to