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:[email protected]]
Sent: 31 January 2012 18:54
To: [email protected]
Subject: Completly lost
Importance: High
Hello everybody,
I am puzzled L 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 J
- 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(AsymmetricBi
ndingBuilder.java:722)
at
org.apache.rampart.builder.AsymmetricBindingBuilder.doSignBeforeEncrypt(Asym
metricBindingBuilder.java:419)
at
org.apache.rampart.builder.AsymmetricBindingBuilder.build(AsymmetricBindingB
uilder.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(OutInAxisOperatio
n.java:402)
at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisO
peration.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at
com.gemalto.test.axis2.SimpleWSEJBServiceStub.helloWorld(SimpleWSEJBServiceS
tub.java:187)
at
com.gemalto.test.axis2.TestSimpleWSAxis2ClientX509.main(TestSimpleWSAxis2Cli
entX509.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(OutInAx
isOperation.java:375)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperatio
n.java:421)
at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisO
peration.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at
com.gemalto.test.axis2.SimpleWSEJBServiceStub.helloWorld(SimpleWSEJBServiceS
tub.java:187)
at
com.gemalto.test.axis2.TestSimpleWSAxis2ClientX509.main(TestSimpleWSAxis2Cli
entX509.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 L
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_S
ERVICE_POLICY, rampartConfig);
Any advice to replace this deprecated method because I have seen nothing in
the javadoc for that L
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: www.infoshare-is.com
E-mail: [email protected]
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?