axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Hanshew <jhans...@visa.com>
Subject Re: How to send WS-Addressing headers in AXIOM based client
Date Mon, 15 Oct 2007 15:41:27 GMT

Your "setAction" code will be overwritten in the generated
<serviceName>stub.java code on the client.

Search for "setAction" in the <serviceName>stub.java code.  You will see
that the Action is driven by the WSDL.  If the WSDL is not alterable, you
will have to modify the generated code.

Good Luck,

Jon



Ralph Fernandes wrote:
> 
> I have Axis2-1.3 and am trying to send WS-Addressing headers in the
> request
> using the code snippet below. The only header that gets set is the
> SOAPAction (HTTP) header, but none of the SOAP envelope headers, viz. To,
> From, Action, MessageID. If I try to explicitly engage the module, I get a
> runtime error "unable to engage module". I understood that to enable the
> addressing module, the axis2.xml file needs to have the module entry
> un-commented, which it is by default.
> 
> What should I be doing to get the To, Action, From, Msg. ID sent in the
> SOAP
> header? Besides the default module configuration in axis2.xml, is there
> any
> other configuration?
> 
> (I am not using the wsdl2java ADB code generation since it does not work
> for
> our WSDLs.)
> 
> 
> Thanks
> 
> -----------------------------------------------------------------------------
> 
> // TestAXIOMClient.java
> ...
> public static void main(String[] args) {
> // TODO Auto-generated method stub
> OMElement req = createRequestDocument();
> Options options = new Options();
> options.setTo (targetEPR);
> options.setAction(wsaAction);
> options.setFrom(wsaFrom);
> options.setMessageId("ab838db4-c0e5-11da-90b6-7be9a196b6d2");
> options.setTransportInProtocol (Constants.TRANSPORT_HTTP);
> 
> try {
> ServiceClient sender = new ServiceClient();
> sender.engageModule("addressing"); // throws runtime exception below
> sender.setTargetEPR (targetEPR);
> 
> sender.setOptions(options);
> sender.sendReceive(req);
> } catch (java.lang.Exception e) {
> e.printStackTrace();
> }
> 
> }
> 
> 
> 
> -----------
> 
> org.apache.axis2.AxisFault: Unable to engage module : addressing
> at org.apache.axis2.client.ServiceClient.engageModule(ServiceClient.java
> :339)
> at com.frk.corp.noam.sharedservices.TestAXIOMClient.main(
> TestAXIOMClient.java :53)
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-send-WS-Addressing-headers-in-AXIOM-based-client-tf4611331.html#a13214829
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Mime
View raw message