Mikhail
My rampart.xml example was just that. A *cut-down* example!
I think you need more in there. Have you looked at the samples that
come with Rampart?
Paul
On 5/17/07, Mikhail Maroukhine <[EMAIL PROTECTED]> wrote:
Hello Paul,
I still could not do this :)
I got an error showed below.
I suppose that something wrong with policy files... but I could not
realize what is exactly wrong because I'm new in this area.
I attached policy files and client and it will be good if you look there.
PolicyCache.xml - policy file from workable .net client
rampart.policy - contains configuration for the rampart
Client.java - test code for the web service
Error:
[EMAIL PROTECTED] classes]$
/home/mikolg/job/axis2/axis2-1.1/bin/axis2.sh org.tempuri.Client
Using AXIS2_HOME: /home/mikolg/job/axis2/axis2-1.1
Using JAVA_HOME: /etc/alternatives/java_sdk_1.5.0
17.05.2007 16:03:25 org.apache.axis2.deployment.DeploymentEngine doDeploy
INFO: Deploying module : soapmonitor-1.1
17.05.2007 16:03:25 org.apache.axis2.deployment.DeploymentEngine doDeploy
INFO: Deploying module : addressing-1.1
17.05.2007 16:03:26 org.apache.axis2.deployment.DeploymentEngine doDeploy
INFO: Deploying module : rahas-1.1
17.05.2007 16:03:27 org.apache.axis2.deployment.DeploymentEngine doDeploy
INFO: Deploying module : rampart-1.1
17.05.2007 16:03:27 org.apache.axis2.deployment.DeploymentEngine doDeploy
INFO: Deploying Web service version.aar
Unknown top level PED found:
org.apache.neethi.builders.xml.XmlPrimtiveAssertion
Unknown top level PED found:
org.apache.neethi.builders.xml.XmlPrimtiveAssertion
Unknown top level PED found:
org.apache.neethi.builders.xml.XmlPrimtiveAssertion
Unknown top level PED found:
org.apache.neethi.builders.xml.XmlPrimtiveAssertion
Exception in thread "main" java.lang.NullPointerException
at
org.apache.rampart.util.RampartUtil.addWsuIdToElement(RampartUtil.java:463)
at
org.apache.rampart.builder.AsymmetricBindingBuilder.doSignBeforeEncrypt(AsymmetricBindingBuilder.java:277)
at
org.apache.rampart.builder.AsymmetricBindingBuilder.build(AsymmetricBindingBuilder.java:85)
at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:129)
at
org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:59)
at org.apache.axis2.engine.Phase.invoke(Phase.java:381)
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:518)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:651)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:365)
at
org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:295)
at org.tempuri.JobStub.ListJobAreas(JobStub.java:185)
at org.tempuri.Client.main(Client.java:44)
Paul Fremantle wrote:
> Let me know if it works.
>
> Paul
>
> On 5/16/07, Mikhail Maroukhine <[EMAIL PROTECTED]> wrote:
>> Thanks Paul
>>
>> I'll try to do it in this way...
>>
>> Paul Fremantle wrote:
>> > Mikhail
>> >
>> > Yes I have experience of doing this. The latest Axis2 1.2 release will
>> > embed the policy into the code-generated stub and attempt to engage
>> > Rampart with that policy.
>> >
>> > Alternatively you can explicitly set the policy using:
>> >
>> > StAXOMBuilder builder = new StAXOMBuilder(xmlPath);
>> > Policy policy = PolicyEngine.getPolicy(builder.getDocumentElement());
>> >
>>
stub._getServiceClient().getOptions().setProperty(RampartMessageData.KEY_RAMPART_POLICY,
>>
>> >
>> > policy);
>> >
>> > In general you also need to configure Rampart with information like
>> > passwords etc.
>> >
>> > You do this using another policy file like this:
>> >
>> > <ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy">
>> > <ramp:timestampTTL>303</ramp:timestampTTL>
>> > <ramp:encryptionUser>me</ramp:encryptionUser>
>> > <ramp:passwordCallbackClass>PWCallback</ramp:passwordCallbackClass>
>> > ,,,
>> > </ramp:RampartConfig>
>> >
>> > You can merge the two policies first - so:
>> >
>> > StAXOMBuilder builder = new StAXOMBuilder(dotnetPolicy);
>> > Policy dotnetPolicy =
>> > PolicyEngine.getPolicy(builder.getDocumentElement());
>> > StAXOMBuilder builder2 = new StAXOMBuilder(rampartPolicy);
>> > Policy rampartPolicy =
>> > PolicyEngine.getPolicy(builder.getDocumentElement());
>> > Policy policy = dotnetPolicy.merge(rampartPolicy);
>> >
>> > And then set it onto the stub or service client as above.
>> >
>> > Paul
>> >
>>
>> --
>> WBR,
>> Mikhail
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
--
WBR,
Mikhail
<ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy">
<ramp:timestampTTL>500</ramp:timestampTTL>
<ramp:encryptionUser>NO</ramp:encryptionUser>
<ramp:passwordCallbackClass>org.tempuri.PWCallback</ramp:passwordCallbackClass>
</ramp:RampartConfig>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Paul Fremantle
VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
http://bloglines.com/blog/paulfremantle
[EMAIL PROTECTED]
"Oxygenating the Web Service Platform", www.wso2.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]