if you want to engage the addressing you have to set a configuration context
to the service client

ConfigurationContext configurationContext =

ConfigurationContextFactory.createConfigurationContextFromFileSystem(AXIS2_REPOSITORY,
AXIS2_CONF);
        this.serviceClient = new ServiceClient(configurationContext, null);

here axis2 repository should have the addressing.mar

Amila.

On 10/12/07, Ralph Fernandes <[EMAIL PROTECTED]> 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)
>
>


-- 
Amila Suriarachchi,
WSO2 Inc.

Reply via email to