[AXIS2] - How to control To element in the SOAP header?

2008-06-04 Thread Victor Solakhian
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



RE: [AXIS2] - How to control To element in the SOAP header?

2008-06-04 Thread Victor Solakhian
Hi Chinthaka,

 

Actually createSOAPEnvelope() method is mine. It creates an envelope
that has To element in the header according to specs of the Web
Servcies server. The Axis2 code that sends the message adds another To
header block using the value that was set in options.setTo() method.

 

The problem is that sometimes servers expect values in the To element
that differ from the value of the endpoint reference used to send
messages. I do not know if this is a bug in Axis2. I know that some
developers used Axis1 to successfully implement desired behavior.

 

Thanks

 



From: Eran Chinthaka [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 04, 2008 5:41 PM
To: axis-user@ws.apache.org
Subject: Re: [AXIS2] - How to control To element in the SOAP header?

 

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 



RE: {AXIS2] Rampart 1.3.mar throws error with Axis2 1.3

2008-05-02 Thread Victor Solakhian
Hi Tezcan,

 

I copied axis2-codegen-1.3.jar to WEB-INF/lib and now it works.

 

There is a bug in the axis2-1.3\webapp\build.xml file I used to create 
axis2.war file. The create.war target excludes axis2-codegen*.jar file:

 

  target depends=init,prepare.repo name=create.war

war destfile=dist/axis2.war webxml=webapp/WEB-INF/web.xml

  lib dir=lib

include name=** /

exclude name=**servlet** /

exclude name=ant*.jar /

exclude name=axis2-adb-codegen*.jar/

exclude name=axis2-codegen*.jar/

exclude name=jibx-bind*.jar/

  /lib

  webinf dir=${temp}/WEB-INF /

  fileset dir=${temp}

include name=**/axis2-web/** /

  /fileset

/war

delete dir=${temp} /

  /target

 

Thank you very much for help.

 

Victor

 

   _  

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 02, 2008 3:32 AM
To: axis-user@ws.apache.org
Subject: AW: {AXIS2] Rampart 1.3.mar throws error with Axis2 1.3

 

Hi Victor

Is axis2-codegen-1.3.jar is in the class path?

In my case I have it under WEB-INF/lib with rest of the axis2 jars.

One other thing I had this error but I was using axis2 v1.3 with rampart v1.1 
so I replaced rampart with v1.3 and the error is now resolved.

Also the error is not there whe I try out samples with rampart v1.4 and axis2 
v1.4 (both RC) 

 

Hope it helps?

 

cheers

Tezcan

-Ursprüngliche Nachricht-
Von: Victor Solakhian [mailto:[EMAIL PROTECTED] 
Gesendet: Mittwoch, 30. April 2008 18:13
An: axis-user@ws.apache.org
Betreff: {AXIS2] Rampart 1.3.mar throws error with Axis2 1.3

When I start Tomcat with Axis2 1.3 (includes Rampant 1.3) I get the following 
error:

 

[ERROR] The rampart-1.3.mar module, which is not valid, caused 
org/apache/axis2/wsdl/codegen/extension/ModulePolicyExten

sion

java.lang.NoClassDefFoundError: 
org/apache/axis2/wsdl/codegen/extension/ModulePolicyExtension

 

I found many references on the web and in this mailing list about this error 
and one of them is

 

HYPERLINK 
https://issues.apache.org/jira/browse/RAMPART-76?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12522580https://issues.apache.org/jira/browse/RAMPART-76?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12522580

 

assuring that this bug is RESOLVED.

 

I downloaded Axis2 1.3 a week ago and this bug is still there. Question: where 
can I get the fixed version?

 

Thanks,

 

Victor

 

 

No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 269.23.6/1407 - Release Date: 4/30/2008 
11:35 AM


No virus found in this incoming message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 269.23.7/1411 - Release Date: 5/2/2008 8:02 
AM



No virus found in this outgoing message.
Checked by AVG. 
Version: 7.5.524 / Virus Database: 269.23.7/1411 - Release Date: 5/2/2008 8:02 
AM
 


{AXIS2] Rampart 1.3.mar throws error with Axis2 1.3

2008-04-30 Thread Victor Solakhian
When I start Tomcat with Axis2 1.3 (includes Rampant 1.3) I get the following 
error:

 

[ERROR] The rampart-1.3.mar module, which is not valid, caused 
org/apache/axis2/wsdl/codegen/extension/ModulePolicyExten

sion

java.lang.NoClassDefFoundError: 
org/apache/axis2/wsdl/codegen/extension/ModulePolicyExtension

 

I found many references on the web and in this mailing list about this error 
and one of them is

 

HYPERLINK 
https://issues.apache.org/jira/browse/RAMPART-76?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12522580https://issues.apache.org/jira/browse/RAMPART-76?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12522580

 

assuring that this bug is RESOLVED.

 

I downloaded Axis2 1.3 a week ago and this bug is still there. Question: where 
can I get the fixed version?

 

Thanks,

 

Victor

 


No virus found in this outgoing message.
Checked by AVG. 
Version: 7.5.524 / Virus Database: 269.23.6/1407 - Release Date: 4/30/2008 
11:35 AM