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 jason zhang <ja...@gmail.com> on 2008/04/01 06:52:29 UTC
Re: Axis2 with rampart sample, username hardcoded
Hi, Nandana
I am using rampart 1.3 and axis 1.3. Is this a bug or is there any error
with my code?
thanks
-jason
jason zhang wrote:
> Hi, Nandana
> I used this poicy in my service.xml, deployed the service. I then
> generated stub using wsdl which contains the policy element.
>
> My client code is like this
> ConfigurationContext ctx =
> ConfigurationContextFactory.createConfigurationContextFromFileSystem(repo_dir,
> null);
> stub = new net.sf.webcommand.ws.client.ProgramwsStub(ctx,
> "http://localhost:9090/cmdportal1/services/programws");
> ServiceClient sc=stub._getServiceClient();
> sc.engageModule("rampart");
> Options options = sc.getOptions();
> options.setUserName("apache");
> options.setPassword("password");
> But the client does not send the username and password. It just
> sends an empty security header. This header is like this
> <soapenv:Header>
> <wsse:Security
> xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
> soapenv:mustUnderstand="true" /></soapenv:Header>
>
> any suggestion?
>
> thanks
>
> -jason
>
>
> Nandana Mihindukulasooriya wrote:
>> Hi Jason,
>> You need to have that Username Token assertion inside a
>> supporting token assertion.
>>
>> <wsp:Policy wsu:Id="UToverHTTP"
>>
>> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
>>
>> xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
>> xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
>> <wsp:ExactlyOne>
>> <wsp:All>
>> <sp:SupportingTokens>
>> <wsp:Policy>
>> <sp:UsernameToken/>
>> </wsp:Policy>
>> </sp:SupportingTokens>
>> <ramp:RampartConfig
>> xmlns:ramp="http://ws.apache.org/rampart/policy">
>> <ramp:user>Alice</ramp:user>
>>
>> <ramp:passwordCallbackClass>org.apache.testing.clients.WSS11Client</ramp:passwordCallbackClass>
>>
>> </ramp:RampartConfig>
>> </wsp:All>
>> </wsp:ExactlyOne>
>> </wsp:Policy>
>>
>> But here the password is in clear text. If you are using Rampart
>> SNAPSHOT , you can use WS Security Policy 1.2 to send the hashed
>> password. The policy for that is given below.
>>
>> <wsp:Policy wsu:Id="HashedPasswordoverHTTP"
>>
>> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
>>
>> xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
>>
>> xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
>> <wsp:ExactlyOne>
>> <wsp:All>
>> <sp:SupportingTokens>
>> <wsp:Policy>
>> <sp:UsernameToken>
>> <wsp:Policy>
>> <sp:HashPassword/>
>> </wsp:Policy>
>> </sp:UsernameToken>
>> </wsp:Policy>
>> </sp:SupportingTokens>
>> <ramp:RampartConfig
>> xmlns:ramp="http://ws.apache.org/rampart/policy">
>> <ramp:user>Alice</ramp:user>
>>
>> <ramp:passwordCallbackClass>org.apache.testing.clients.WSS11Client</ramp:passwordCallbackClass>
>>
>> </ramp:RampartConfig>
>> </wsp:All>
>> </wsp:ExactlyOne>
>> </wsp:Policy>
>>
>> thanks,
>> /nandana
>>
>>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Axis2 client accessing SOAP12 operation
Posted by Phani <ph...@in.fiorano.com>.
Hi,
Iam using axis2 client to invoke a share point webservice.
I am invoking getListCollection() method.
If I invoke SOAP11 method, my client is working fine..
But if I invoke SOAP12 methos, iam getting the below exception.
I don't know why EPR is null even if I set EPR in Options to
"http://www.wssdemo.com/_vti_bin/lists.asmx".
Iam attaching my sample client code..
caused by
org.apache.axis2.AxisFault: Address information does not exist in the
Endpoint Reference (EPR).The system cannot infer the transport mechanism.
at
org.apache.axis2.description.ClientUtils.inferOutTransport(ClientUtils.java:
65)
at
org.apache.axis2.client.OperationClient.prepareMessageContext(OperationClien
t.java:302)
at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisO
peration.java:174)
at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at
com.fiorano.services.webserviceconsumer.engine.WSClient.invoke(WSClient.java
:104)
Thanks
Phani Bandanakanti