Dear Haisini:
May I disturb you with a short question?
Could you plese tell me if the following is a correct way of setting in the
service client's option the user name for rampart?:
"
configurationContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(repositoryPath,
axis2XmlPath);
accountCreationServiceStub = new
AccountCreationServiceStub(configurationContext);
serviceClient
= accountCreationServiceStub._getServiceClient();
options
= serviceClient.getOptions();
options.setProperty(RampartMessageData.KEY_CUSTOM_ISSUED_TOKEN, Boolean.TRUE);
options.setProperty(WSHandlerConstants.USER, "marginalen"); // 2012-04-28,
RunoB: Required for UsernameToken
options.setProperty(WSHandlerConstants.PW_CALLBACK_CLASS,
"com.tieto.ws.axis2.callback.UsernameTokenCallbackManager");
"
Med vänlig hälsning, / Best regards,,
Runo Barrdahl, civ. ing, tekn. lic.
Tieto Sweden AB, Financial Services
From: Hasini Gunasinghe [mailto:[email protected]]
Sent: den 27 maj 2012 14:26
To: [email protected]
Subject: Re: FW: No user value in rampart configuration policy
Hi Runo,
The error you have reported occur if the user name is not found either in
service client's options or in rampart config at the time of creating User name
token.
According to your description, you have used code generated client stub from
the wsdl file which embeds the security policy.
In that case you need to programetically add rampart configuration to the
policy.
Please refer step 6 (Setting the Rampart specific configuration details) at
http://wso2.org/library/3415#securing_the_client for the correct steps to add
rampart config at the client side.
HTH & let us know if you encounter further issues.
Thanks,
Hasini.
On Sun, May 27, 2012 at 2:22 AM,
<[email protected]<mailto:[email protected]>> wrote:
Med vänlig hälsning, / Best Regards,
Runo Barrdahl, civ ing, tekn lic
Tieto Sweden AB, Financial Services
From: Barrdahl Runo
Sent: den 26 maj 2012 18:12
To: '[email protected]<mailto:[email protected]>'
Subject: No user value in rampart configuration policy
Dear Axis2 Specialist:
I have a problem with an axis2-1.6.2 client using UsernameToken and Addressing.
In no way can I avoid an AxisFault to be thrown in the Stub "No user value in
the rampart configuration policy".
First, I have added a policy according to the literature in the wsdl file, see
enclosed file, and added in the client axis2.xml the following section at the
top:
"
<axisconfig name="AxisJava2.0">
<module ref="rampart"/>
<module ref="metadataExchange" />
<parameter name="OutflowSecurity">
<action>
<items>UsernameToken</items>
<passwordType>PasswordText</passwordType>
</action>
</parameter>
"
I use adb binding, but have also tried xmlbeans, see the Java code generation
command:
"
@SET JAVA_HOME=C:\IBM\WAS61\WebSphere\AppServer\java
@SET AXIS2_HOME=C:\axis2-1.6.2
@SET PATH=%JAVA_HOME%\bin;%PATH%
@REM xmlBeans, new WSDL: Axis2-1.6.2
@REM @C:\axis2-1.6.2\bin\wsdl2java.bat -uri ./wsdl/CustomerCreationService.wsdl
-o ./ -p com.tieto.ws.axis2.customercreation.service -ss -sd -or -d xmlbeans -g
-u -S ./src -R ./resourcesCustomerCreation
@REM ADB - Axis2-1.6.2
@C:\axis2-1.6.2\bin\wsdl2java.bat -uri ./wsdl/CustomerCreationService.wsdl -o
./ -p com.tieto.ws.axis2.customercreation.service -ss -sd -or -d adb -g -u -S
./src -R ./resourcesCustomerCreation
"
After that, I have, as alternatvies, tried to load the policy in the client,
instantiating a RampartConfig object in the client, and numerous other
different ways to get rid of the AxisFault in the client.
My laptop is Windows 7, 64 bit, and I can run the client in Eclipse, in Tomcat
or in IBM WebSphere 6.1, with identical result. Whether the service is
available or not does not affect the result, i. e. the thrown AxisFault.
I have even run debug mode in Eclipse using Rampart and wss4j source code, only
to find that somewhere inside there a userMissing message is displayed.
I have tested using http and SSL, with identical result.
I have tried all possible combinations in the client Java to set user, and in
all various combinations, all with negative result:
"
// UsernameToken:
// 2012-05-21, RunoB String policyPath = new
String("C:/IBM/WAS61/WebSphere/AppServer/profiles/AppSrv01/installedApps/WL2007481Node01Cell/marginalenAxis2WSClient_war.ear/marginalenAxis2WSClient-localhostWAS.war/WEB-INF/properties/clientPolicy.xml");
// 2012-05-21, RunoB
options.setProperty(RampartMessageData.KEY_RAMPART_POLICY,
loadPolicy(policyPath));
// 2012-05-23, RunoB options.setUserName("marginalen"); //
removing this, results in: "No user value in the rampart configuration policy"
// 2012-05-23, RunoB: options.setPassword("largimanen"); // 2012-05-23,
RunoB: this one causes: com.ctc.wstx.exc.WstxUnexpectedCharException:
Unexpected character 'E' (code 69) in prolog; expected '<' at [row,col
{unknown-source}]: [1,1]
/* 2012-05-23, RunoB: no effect:
RampartConfig rampartConfig = new RampartConfig();
rampartConfig.setUser("marginalen");
rampartConfig.setPwCbClass("com.tieto.ws.axis2.callback.UsernameTokenCallbackManager");
options.setProperty(RampartConfig.RAMPART_CONFIG_LN,
rampartConfig);
*/
options.setProperty(RampartMessageData.KEY_CUSTOM_ISSUED_TOKEN, Boolean.TRUE);
options.setProperty(WSHandlerConstants.USER,
"marginalen"); // 2012-04-28, RunoB: Required for UsernameToken
options.setProperty(WSHandlerConstants.PW_CALLBACK_CLASS,
"com.tieto.ws.axis2.callback.UsernameTokenCallbackManager");
//
options.setProperty(Constants.Configuration.ENABLE_REST,Constants.VALUE_FALSE);
// options.setProperty(Constants.Configuration.ENABLE_MTOM,
Constants.VALUE_TRUE);
"
The message never reaches the web service on the server, only if I configure
the client erroneously, it might arrive to the service, where some other
configuration erros message is displayed, telling me more explicitly that
something is wrong. But, as soon as I have changed the client to produce a
"correct" soap message, the client throws the axisFault "No user value in the
rampart configuration policy"..
I have (for http) in all cases intercepted the final SOAP message in the client
stub, just after the AxisFault has been thrown, and and used it to execute it
in soapUI with success!
This means that the generated soap message is OK. Nevertheless, the axis2
client throws an AxisFault "No user value in the rampart configuration policy".
I have previously, a few years back, successfully implemented an axis2-1.4.1
client (but at the time, I had to manually complement the policy statement in
the stub to avoid errors). Now, for my current problem, I have looked back to
configure client and axis2.xml analogously, without success.
I am at a loss as to what could possibly cause the error. Please find enclosed
the wsdl file.
I hae seen reported on the web the same text error, but not found any
conclusive solution (In fact, there was some instruction, that I followed, but
it did not resolve my problem).
In case you have experience from this issue, please send me some advice.
Med vänlig hälsning, / Best Regards,
Runo Barrdahl, civ ing, tekn lic
Tieto Sweden AB, Financial Services
mail: [email protected]<mailto:[email protected]>
tel (direct): 0709-790 407 / +46-709 790 407<tel:%2B46-709%20790%20407>
tel (central): 010 481 00 00 / +46-10 481 00 00<tel:%2B46-10%20481%2000%2000>
fax: 08-86 30 56 / +46-8 86 30 56<tel:%2B46-8%2086%2030%2056>
web: www.tieto.com<http://www.tieto.com>
---------------------------------------------------------------------
To unsubscribe, e-mail:
[email protected]<mailto:[email protected]>
For additional commands, e-mail:
[email protected]<mailto:[email protected]>