You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by COURTAULT Francois <Fr...@gemalto.com> on 2012/03/09 16:06:39 UTC

RE: Completly lost

Hello again,

Just to warn you that I have performed some tests using cxf framework and I got the same issue.
BUT according to cxf team it is a bug on their side (https://issues.apache.org/jira/browse/CXF-4166).

So my feeling, as axis2 behaved the same, is that it is also an Axis2 issue.

Will somebody, in the axis2 team, be kind enough in order to look at this interoperability issue between axis2 and Weblogic WS stack (eg Metro)  ?

Best Regards.

From: COURTAULT Francois [mailto:Francois.COURTAULT@gemalto.com]
Sent: jeudi 2 février 2012 18:46
To: java-user@axis.apache.org
Subject: RE: Completly lost

Hello again,

OK I have modified my code in order to take into account a policy file which embeds the rampart configuration.
This time the different client runs gave me the same result which I got with the initial code but randomly:
log4j:WARN No appenders could be found for logger (org.apache.axis2.deployment.FileSystemConfigurator).
log4j:WARN Please initialize the log4j system properly.
org.apache.axis2.AxisFault:  Error codes: 3201 Error code:3201
      at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:531)
      at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:375)
      at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421)
      at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
      at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
      at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:555)
      at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:531)
      at com.gemalto.test.axis2.TestSimpleWSAxis2ClientX509.main(TestSimpleWSAxis2ClientX509.java:76)

Again, after having captured the HTTP exchanges, I see that the server seems to not understand the SOAP request  because in the <KeyInfo  <wsse:SecurityTokenReference section, a <wsse:KeyIdentifier section is missing. Do you know what I have to do in my client code in order for the axis2 framework to generate this data in the SOAP request ?

I have also see something linked to my issue at http://metro.1045641.n5.nabble.com/WSS-interop-issue-with-WebLogic-server-td3212102.html but I still don't know if it is a server or a client issue :(

Again any help will be very valuable for me.

Best Regards.


From: COURTAULT Francois [mailto:Francois.COURTAULT@gemalto.com]
Sent: mercredi 1 février 2012 20:41
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: RE: Completly lost
Importance: High

Hello James,

I have made some investigations on my side.
The solution you suggest to me works if you have the policy file including the rampart section on the client side.

But this not what I want to do except if I have no other possibility. In fact the old code I had seems to do exactly what I am trying to do:

-          Take the policy from the stub generated by the wsdl2java.bat utility: sc.getAxisService().getPolicyInclude() but one problem is that this method is deprecated

-          Augment this policy with rampart configuration in order to perform the crypto stuff sc.getAxisService().getPolicyInclude().addPolicyElement(PolicyInclude.AXIS_SERVICE_POLICY, rampartConfig) but one problem is that this method (addPolicyElement is also deprecated)
The other problem I have is by using this code is the client run outputs, if done several times, are not repeatable : behavior change:(

In fact the simple question I have is: Is  there any sample/tutorial  available somewhere in order to have a client code which doesn't need to have an external policy file available at the client side as we already have it in the stub generated and which works with asymmetric bindings ?

Any support from the community will be greatly appreciate !

Best Regards.

From: James Annesley [mailto:james.annesley@infoshare-is.com]
Sent: mercredi 1 février 2012 11:26
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: RE: Completly lost

Hi,

One thing I noticed is that you engage rampart after you have set the options. Better to engage before?
Another thing is that I think you need a policy file because you are using a password callback. I don't need this in my system.
Finally and probably most relevant is that your policy file must be valid xml. I'd say you should be able to validate it against a schema (although the namespaces are not declared properly in mine so I couldn't). The wsdl I use has the policy embedded in it. When I was specifying a policy in axis I noticed it had to be exactly the same as the one in the wsdl otherwise it wouldn't work. In general I have found the error messages have not been too helpful here.

I used to load the file like this:

public static Policy loadPolicy(final String pathandnametopolicy_xml) {

    Policy policy = null;
    try {

      final StAXOMBuilder builder = new StAXOMBuilder(pathandnametopolicy_xml);
      policy = PolicyEngine.getPolicy(builder.getDocumentElement());

    } catch (final XMLStreamException e) {
      service.getLogger().error(AXIS, e);
    } catch (final FileNotFoundException e) {
      service.getLogger().error(AXIS, e);
    }
    return policy;
  }

So replace 'null' with the Policy object. But you'll need to specify a password callback in the XML. Something like this:

<wsp:Policy>
...
<ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy">
...

</ramp:RampartConfig>

</wsp:Policy>

Then you need to implement the callback on your server. This way you'll avoid having to write it all out in Java code as you are trying to do. See an IBM tutorial for more info [1].

James


[1] http://www.ibm.com/developerworks/java/library/j-jws5/index.html

From: COURTAULT Francois [mailto:Francois.COURTAULT@gemalto.com]
Sent: 01 February 2012 10:06
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: RE: Completly lost
Importance: High

Hello James,

Thanks for your answer but it doesn't work :(
In fact I change my client code according to your advice:
                  Options options = sc.getOptions();
                  options.setProperty(RampartMessageData.KEY_RAMPART_POLICY, getRampartConfig());
                  sc.setOptions(options);

                  sc.engageModule("rampart");
instead of
                  sc.getAxisService().getPolicyInclude().addPolicyElement(PolicyInclude.AXIS_SERVICE_POLICY, getRampartConfig());
where
      private Policy getRampartConfig(){

            RampartConfig rampartConfig = new RampartConfig();
            rampartConfig.setUser("keyalias");
            rampartConfig.setPwCbClass("com.gemalto.test.axis2.PWCBHandler");

            CryptoConfig sigCrypto = new CryptoConfig();

            sigCrypto.setProvider("org.apache.ws.security.components.crypto.Merlin");

            Properties props = new Properties();
            props.setProperty("org.apache.ws.security.crypto.merlin.keystore.type", "JKS");
            props.setProperty("org.apache.ws.security.crypto.merlin.file","D:/Temp/Client.jks");
            props.setProperty("org.apache.ws.security.crypto.merlin.keystore.password", "ClientStorePassword");

            sigCrypto.setProp(props);

            rampartConfig.setSigCryptoConfig(sigCrypto);

            Policy policy = new Policy();
            policy.addAssertion(rampartConfig);

            return policy;
      }

I got a new exception, this time, which is:
Exception in thread "main" java.lang.RuntimeException: Undefined 'Security policy namespace cannot be null.' resource property
      at org.apache.rampart.RampartException.getMessage(RampartException.java:81)
      at org.apache.rampart.RampartException.<init>(RampartException.java:41)
      at org.apache.rampart.RampartException.<init>(RampartException.java:57)
      at org.apache.rampart.RampartMessageData.setWSSecurityVersions(RampartMessageData.java:373)
      at org.apache.rampart.RampartMessageData.<init>(RampartMessageData.java:261)
      at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:61)
      at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:65)
      at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340)
      at org.apache.axis2.engine.Phase.invoke(Phase.java:313)
      at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:262)
      at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:427)
      at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:406)
      at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
      at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
      at com.gemalto.test.axis2.SimpleWSEJBServiceStub.helloWorld(SimpleWSEJBServiceStub.java:187)
      at com.gemalto.test.axis2.TestSimpleWSAxis2ClientX509.main(TestSimpleWSAxis2ClientX509.java:50)

Any idea ?

Best Regards.

From: James Annesley [mailto:james.annesley@infoshare-is.com]<mailto:[mailto:james.annesley@infoshare-is.com]>
Sent: mardi 31 janvier 2012 21:10
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: RE: Completly lost

Hi Francois,

I noticed you don't need the server policy file at all on the client side.

I do this:

client.engageModule("rampart");
options.setProperty(RampartMessageData.KEY_RAMPART_POLICY, null);

where client is the ServiceClient.

HTH

James

From: COURTAULT Francois [mailto:Francois.COURTAULT@gemalto.com]
Sent: 31 January 2012 18:54
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: Completly lost
Importance: High

Hello everybody,

I am puzzled :( I use axis2-1.6.0 and rampart-1.6.0 because I have discovered a bug in 1.6.1.
Anyway, I try to write axis2 client code by using this axis2 version in order to access to a WS, hosted in Weblogic,  protected with the policy attached (policy.xml).


When I run my client code several times inside Eclipse, then I met my first issue: the behavior is not the same :)

-          Sometimes I got:   Exception in thread "main" java.lang.NullPointerException

at org.apache.rampart.builder.BindingBuilder.getSignatureBuilder(BindingBuilder.java:274)

at org.apache.rampart.builder.BindingBuilder.getSignatureBuilder(BindingBuilder.java:250)

at org.apache.rampart.builder.AsymmetricBindingBuilder.doSignature(AsymmetricBindingBuilder.java:722)

at org.apache.rampart.builder.AsymmetricBindingBuilder.doSignBeforeEncrypt(AsymmetricBindingBuilder.java:419)

at org.apache.rampart.builder.AsymmetricBindingBuilder.build(AsymmetricBindingBuilder.java:95)

at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:147)

at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:64)

at org.apache.axis2.engine.Phase.invoke(Phase.java:318)

at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:254)

at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:419)

at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)

at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)

at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)

at com.gemalto.test.axis2.SimpleWSEJBServiceStub.helloWorld(SimpleWSEJBServiceStub.java:187)

at com.gemalto.test.axis2.TestSimpleWSAxis2ClientX509.main(TestSimpleWSAxis2ClientX509.java:44)

-          Sometimes I got:  org.apache.axis2.AxisFault:  Error codes: 3201 Error code:3201

                at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:531)

at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:375)

at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421)

at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)

at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)

at com.gemalto.test.axis2.SimpleWSEJBServiceStub.helloWorld(SimpleWSEJBServiceStub.java:187)

at com.gemalto.test.axis2.TestSimpleWSAxis2ClientX509.main(TestSimpleWSAxis2ClientX509.java:44)

Is this random behavior normal ? Have you some explanations ? How can we fix it ?

I have tested the same client code with Axis1.5.6 and rampart-1.5.2 and I have seen the same random behavior :(

I have also seen that I have in my client code some deprecated methods are used: does it explain this random behavior ?
The deprecated code lines are:

-          if (pwcb.getIdentifer().equals("xxx"))

-          sc.getAxisService().getPolicyInclude().addPolicyElement(PolicyInclude.AXIS_SERVICE_POLICY, rampartConfig);
Any advice to replace this deprecated method because I have seen nothing in the javadoc for that :(

When I got the second issue (org.apache.axis2.AxisFault:  Error codes: 3201 Error code:3201), I made a dump of the exchange and compared it a SOAP request which works. According to my analysis the only difference I saw (I have attached also these two SOAP requests for your own analysis or deeper analysis) is that, in the SOAP request generated by Axis2, in the <KeyInfo  <wsse:SecurityTokenReference section, a <wsse:KeyIdentifier section is missing. Do you agree with me or is it something else ?  Is it an axis2 bug ?

Best Regards.

Infoshare Ltd
Millennium House
21 Eden Street
Kingston upon Thames
Surrey
KT1 1BL
United Kingdom
Phone:

+44 (0) 20 8541 0111

Support:

+44 (0) 20 8481 4760

Web:

http://www.infoshare-is.com/

E-mail:

info@infoshare-is.com<ma...@infoshare-is.com>


Infoshare Ltd is registered in England and Wales.
Registered Office as above.
Registered Number 2877612
VAT Number GB 678 1443 10

The content of this e-mail (and any attachment to it) is confidential. Any views or opinions do not represent the views or opinions of Infoshare Ltd. If you have received this e-mail in error please notify the sender and delete it. You may not use, copy or disclose the information in any way.

Infoshare Ltd monitors incoming and outgoing e-mails.

Please consider the environment. Do you really need to print this email?

Infoshare Ltd
Millennium House
21 Eden Street
Kingston upon Thames
Surrey
KT1 1BL
United Kingdom
Phone:

+44 (0) 20 8541 0111

Support:

+44 (0) 20 8481 4760

Web:

http://www.infoshare-is.com/

E-mail:

info@infoshare-is.com<ma...@infoshare-is.com>


Infoshare Ltd is registered in England and Wales.
Registered Office as above.
Registered Number 2877612
VAT Number GB 678 1443 10

The content of this e-mail (and any attachment to it) is confidential. Any views or opinions do not represent the views or opinions of Infoshare Ltd. If you have received this e-mail in error please notify the sender and delete it. You may not use, copy or disclose the information in any way.

Infoshare Ltd monitors incoming and outgoing e-mails.

Please consider the environment. Do you really need to print this email?

RE: Completly lost

Posted by COURTAULT Francois <Fr...@gemalto.com>.
Hello,

Any news regarding my Axis 2 issue ?

Best Regards.

From: COURTAULT Francois [mailto:Francois.COURTAULT@gemalto.com]
Sent: vendredi 9 mars 2012 16:07
To: java-user@axis.apache.org
Subject: RE: Completly lost
Importance: High

Hello again,

Just to warn you that I have performed some tests using cxf framework and I got the same issue.
BUT according to cxf team it is a bug on their side (https://issues.apache.org/jira/browse/CXF-4166).

So my feeling, as axis2 behaved the same, is that it is also an Axis2 issue.

Will somebody, in the axis2 team, be kind enough in order to look at this interoperability issue between axis2 and Weblogic WS stack (eg Metro)  ?

Best Regards.

From: COURTAULT Francois [mailto:Francois.COURTAULT@gemalto.com]
Sent: jeudi 2 février 2012 18:46
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: RE: Completly lost

Hello again,

OK I have modified my code in order to take into account a policy file which embeds the rampart configuration.
This time the different client runs gave me the same result which I got with the initial code but randomly:
log4j:WARN No appenders could be found for logger (org.apache.axis2.deployment.FileSystemConfigurator).
log4j:WARN Please initialize the log4j system properly.
org.apache.axis2.AxisFault:  Error codes: 3201 Error code:3201
      at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:531)
      at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:375)
      at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421)
      at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
      at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
      at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:555)
      at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:531)
      at com.gemalto.test.axis2.TestSimpleWSAxis2ClientX509.main(TestSimpleWSAxis2ClientX509.java:76)

Again, after having captured the HTTP exchanges, I see that the server seems to not understand the SOAP request  because in the <KeyInfo  <wsse:SecurityTokenReference section, a <wsse:KeyIdentifier section is missing. Do you know what I have to do in my client code in order for the axis2 framework to generate this data in the SOAP request ?

I have also see something linked to my issue at http://metro.1045641.n5.nabble.com/WSS-interop-issue-with-WebLogic-server-td3212102.html but I still don't know if it is a server or a client issue :(

Again any help will be very valuable for me.

Best Regards.


From: COURTAULT Francois [mailto:Francois.COURTAULT@gemalto.com]
Sent: mercredi 1 février 2012 20:41
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: RE: Completly lost
Importance: High

Hello James,

I have made some investigations on my side.
The solution you suggest to me works if you have the policy file including the rampart section on the client side.

But this not what I want to do except if I have no other possibility. In fact the old code I had seems to do exactly what I am trying to do:

-          Take the policy from the stub generated by the wsdl2java.bat utility: sc.getAxisService().getPolicyInclude() but one problem is that this method is deprecated

-          Augment this policy with rampart configuration in order to perform the crypto stuff sc.getAxisService().getPolicyInclude().addPolicyElement(PolicyInclude.AXIS_SERVICE_POLICY, rampartConfig) but one problem is that this method (addPolicyElement is also deprecated)
The other problem I have is by using this code is the client run outputs, if done several times, are not repeatable : behavior change:(

In fact the simple question I have is: Is  there any sample/tutorial  available somewhere in order to have a client code which doesn't need to have an external policy file available at the client side as we already have it in the stub generated and which works with asymmetric bindings ?

Any support from the community will be greatly appreciate !

Best Regards.

From: James Annesley [mailto:james.annesley@infoshare-is.com]
Sent: mercredi 1 février 2012 11:26
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: RE: Completly lost

Hi,

One thing I noticed is that you engage rampart after you have set the options. Better to engage before?
Another thing is that I think you need a policy file because you are using a password callback. I don't need this in my system.
Finally and probably most relevant is that your policy file must be valid xml. I'd say you should be able to validate it against a schema (although the namespaces are not declared properly in mine so I couldn't). The wsdl I use has the policy embedded in it. When I was specifying a policy in axis I noticed it had to be exactly the same as the one in the wsdl otherwise it wouldn't work. In general I have found the error messages have not been too helpful here.

I used to load the file like this:

public static Policy loadPolicy(final String pathandnametopolicy_xml) {

    Policy policy = null;
    try {

      final StAXOMBuilder builder = new StAXOMBuilder(pathandnametopolicy_xml);
      policy = PolicyEngine.getPolicy(builder.getDocumentElement());

    } catch (final XMLStreamException e) {
      service.getLogger().error(AXIS, e);
    } catch (final FileNotFoundException e) {
      service.getLogger().error(AXIS, e);
    }
    return policy;
  }

So replace 'null' with the Policy object. But you'll need to specify a password callback in the XML. Something like this:

<wsp:Policy>
...
<ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy">
...

</ramp:RampartConfig>

</wsp:Policy>

Then you need to implement the callback on your server. This way you'll avoid having to write it all out in Java code as you are trying to do. See an IBM tutorial for more info [1].

James


[1] http://www.ibm.com/developerworks/java/library/j-jws5/index.html

From: COURTAULT Francois [mailto:Francois.COURTAULT@gemalto.com]
Sent: 01 February 2012 10:06
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: RE: Completly lost
Importance: High

Hello James,

Thanks for your answer but it doesn't work :(
In fact I change my client code according to your advice:
                  Options options = sc.getOptions();
                  options.setProperty(RampartMessageData.KEY_RAMPART_POLICY, getRampartConfig());
                  sc.setOptions(options);

                  sc.engageModule("rampart");
instead of
                  sc.getAxisService().getPolicyInclude().addPolicyElement(PolicyInclude.AXIS_SERVICE_POLICY, getRampartConfig());
where
      private Policy getRampartConfig(){

            RampartConfig rampartConfig = new RampartConfig();
            rampartConfig.setUser("keyalias");
            rampartConfig.setPwCbClass("com.gemalto.test.axis2.PWCBHandler");

            CryptoConfig sigCrypto = new CryptoConfig();

            sigCrypto.setProvider("org.apache.ws.security.components.crypto.Merlin");

            Properties props = new Properties();
            props.setProperty("org.apache.ws.security.crypto.merlin.keystore.type", "JKS");
            props.setProperty("org.apache.ws.security.crypto.merlin.file","D:/Temp/Client.jks");
            props.setProperty("org.apache.ws.security.crypto.merlin.keystore.password", "ClientStorePassword");

            sigCrypto.setProp(props);

            rampartConfig.setSigCryptoConfig(sigCrypto);

            Policy policy = new Policy();
            policy.addAssertion(rampartConfig);

            return policy;
      }

I got a new exception, this time, which is:
Exception in thread "main" java.lang.RuntimeException: Undefined 'Security policy namespace cannot be null.' resource property
      at org.apache.rampart.RampartException.getMessage(RampartException.java:81)
      at org.apache.rampart.RampartException.<init>(RampartException.java:41)
      at org.apache.rampart.RampartException.<init>(RampartException.java:57)
      at org.apache.rampart.RampartMessageData.setWSSecurityVersions(RampartMessageData.java:373)
      at org.apache.rampart.RampartMessageData.<init>(RampartMessageData.java:261)
      at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:61)
      at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:65)
      at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340)
      at org.apache.axis2.engine.Phase.invoke(Phase.java:313)
      at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:262)
      at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:427)
      at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:406)
      at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
      at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
      at com.gemalto.test.axis2.SimpleWSEJBServiceStub.helloWorld(SimpleWSEJBServiceStub.java:187)
      at com.gemalto.test.axis2.TestSimpleWSAxis2ClientX509.main(TestSimpleWSAxis2ClientX509.java:50)

Any idea ?

Best Regards.

From: James Annesley [mailto:james.annesley@infoshare-is.com]<mailto:[mailto:james.annesley@infoshare-is.com]>
Sent: mardi 31 janvier 2012 21:10
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: RE: Completly lost

Hi Francois,

I noticed you don't need the server policy file at all on the client side.

I do this:

client.engageModule("rampart");
options.setProperty(RampartMessageData.KEY_RAMPART_POLICY, null);

where client is the ServiceClient.

HTH

James

From: COURTAULT Francois [mailto:Francois.COURTAULT@gemalto.com]
Sent: 31 January 2012 18:54
To: java-user@axis.apache.org<ma...@axis.apache.org>
Subject: Completly lost
Importance: High

Hello everybody,

I am puzzled :( I use axis2-1.6.0 and rampart-1.6.0 because I have discovered a bug in 1.6.1.
Anyway, I try to write axis2 client code by using this axis2 version in order to access to a WS, hosted in Weblogic,  protected with the policy attached (policy.xml).


When I run my client code several times inside Eclipse, then I met my first issue: the behavior is not the same :)

-          Sometimes I got:   Exception in thread "main" java.lang.NullPointerException

at org.apache.rampart.builder.BindingBuilder.getSignatureBuilder(BindingBuilder.java:274)

at org.apache.rampart.builder.BindingBuilder.getSignatureBuilder(BindingBuilder.java:250)

at org.apache.rampart.builder.AsymmetricBindingBuilder.doSignature(AsymmetricBindingBuilder.java:722)

at org.apache.rampart.builder.AsymmetricBindingBuilder.doSignBeforeEncrypt(AsymmetricBindingBuilder.java:419)

at org.apache.rampart.builder.AsymmetricBindingBuilder.build(AsymmetricBindingBuilder.java:95)

at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:147)

at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:64)

at org.apache.axis2.engine.Phase.invoke(Phase.java:318)

at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:254)

at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:419)

at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)

at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)

at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)

at com.gemalto.test.axis2.SimpleWSEJBServiceStub.helloWorld(SimpleWSEJBServiceStub.java:187)

at com.gemalto.test.axis2.TestSimpleWSAxis2ClientX509.main(TestSimpleWSAxis2ClientX509.java:44)

-          Sometimes I got:  org.apache.axis2.AxisFault:  Error codes: 3201 Error code:3201

                at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:531)

at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:375)

at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421)

at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)

at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)

at com.gemalto.test.axis2.SimpleWSEJBServiceStub.helloWorld(SimpleWSEJBServiceStub.java:187)

at com.gemalto.test.axis2.TestSimpleWSAxis2ClientX509.main(TestSimpleWSAxis2ClientX509.java:44)

Is this random behavior normal ? Have you some explanations ? How can we fix it ?

I have tested the same client code with Axis1.5.6 and rampart-1.5.2 and I have seen the same random behavior :(

I have also seen that I have in my client code some deprecated methods are used: does it explain this random behavior ?
The deprecated code lines are:

-          if (pwcb.getIdentifer().equals("xxx"))

-          sc.getAxisService().getPolicyInclude().addPolicyElement(PolicyInclude.AXIS_SERVICE_POLICY, rampartConfig);
Any advice to replace this deprecated method because I have seen nothing in the javadoc for that :(

When I got the second issue (org.apache.axis2.AxisFault:  Error codes: 3201 Error code:3201), I made a dump of the exchange and compared it a SOAP request which works. According to my analysis the only difference I saw (I have attached also these two SOAP requests for your own analysis or deeper analysis) is that, in the SOAP request generated by Axis2, in the <KeyInfo  <wsse:SecurityTokenReference section, a <wsse:KeyIdentifier section is missing. Do you agree with me or is it something else ?  Is it an axis2 bug ?

Best Regards.

Infoshare Ltd
Millennium House
21 Eden Street
Kingston upon Thames
Surrey
KT1 1BL
United Kingdom
Phone:

+44 (0) 20 8541 0111

Support:

+44 (0) 20 8481 4760

Web:

http://www.infoshare-is.com/

E-mail:

info@infoshare-is.com<ma...@infoshare-is.com>


Infoshare Ltd is registered in England and Wales.
Registered Office as above.
Registered Number 2877612
VAT Number GB 678 1443 10

The content of this e-mail (and any attachment to it) is confidential. Any views or opinions do not represent the views or opinions of Infoshare Ltd. If you have received this e-mail in error please notify the sender and delete it. You may not use, copy or disclose the information in any way.

Infoshare Ltd monitors incoming and outgoing e-mails.

Please consider the environment. Do you really need to print this email?

Infoshare Ltd
Millennium House
21 Eden Street
Kingston upon Thames
Surrey
KT1 1BL
United Kingdom
Phone:

+44 (0) 20 8541 0111

Support:

+44 (0) 20 8481 4760

Web:

http://www.infoshare-is.com/

E-mail:

info@infoshare-is.com<ma...@infoshare-is.com>


Infoshare Ltd is registered in England and Wales.
Registered Office as above.
Registered Number 2877612
VAT Number GB 678 1443 10

The content of this e-mail (and any attachment to it) is confidential. Any views or opinions do not represent the views or opinions of Infoshare Ltd. If you have received this e-mail in error please notify the sender and delete it. You may not use, copy or disclose the information in any way.

Infoshare Ltd monitors incoming and outgoing e-mails.

Please consider the environment. Do you really need to print this email?