Hi Victor,
If createSOAPEnvelope() method adds wsa:To header, then it is a bug, IMO.
Please create a bug in JIRA and someone will look in to this (but it might
take some time for me to commit in to this :( )
Thanks,
Chinthaka
On Wed, Jun 4, 2008 at 10:37 AM, Victor Solakhian <[EMAIL PROTECTED]>
wrote:
> I have code that creates a SOAP envelope and sends it using Axis2
> ServiceCLient.
>
>
>
> EndpointReference targetEPR =
>
> *new* EndpointReference("https://...");
>
>
>
> String action = "...";
>
> client = *new* ServiceClient(ctx, *null*);
>
> operationClient =
> client.createClient(ServiceClient.ANON_OUT_IN_OP);
>
>
>
> MessageContext outMsgCtx = *new* MessageContext();
>
> Options options = outMsgCtx.getOptions();
>
> options.setTo(targetEPR);
>
>
> options.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
>
> options.setProperty(HTTPConstants.CHUNKED, *false*);
>
> options.setAction(action);
>
>
>
> outMsgCtx.setEnvelope(createSOAPEnvelope(operation, payload));
>
> operationClient.addMessageContext(outMsgCtx);
>
> operationClient.execute(*true*);
>
>
>
> Now the createSOAPEnvelope(operation, payload)) method creates an envelope
> with a header that includes:
>
>
>
> <soapenv:Header>
>
> …
>
> <wsa:To
>
> xmlns:wsa="
> http://schemas.xmlsoap.org/ws/2004/08/addressing">
>
> urn:xxx.yyy.com.zzz
>
> </wsa:To>
>
>
>
> which is expected by the web services server, but Axis2 code adds another
> To" element:
>
>
>
> <wsa:To>
>
> https://...
>
> </wsa:To>
>
>
>
> to the header (using the endpoint reference set by
> options.setTo(targetEPR)).
>
>
>
> We need to set the targetEPR to the options so that messages are sent to
> the right place, but we need to have control on what is put in the header.
>
>
>
> Is there a way to avoid adding the targetEPR to the header?
>
>
>
> Thanks,
>
>
>
> Victor
>
--
With Mettha,
Eran Chinthaka
--------------------------------------------------------------------
Health is the greatest gift; contentment is the greatest wealth; trusting is
the best relationship; nirvana is the highest joy. - Dhammapada