Hi All!
I am sending this emai to wssj4 and axis list.
Please, I need help in this question. Seems a simple problem, but I
really can't resolve it .
I want set a usernametoken programmatically in the client side. I am
using axis2 and rampart module. This is the error:
Exception in thread "main" java.lang.NullPointerException
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:578)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:328)
at
org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:279)
at org.apache.ws.axis2.ClientStub.getUpdate(ClientStub.java:118)
at org.apache.ws.axis2.TestClient.main(TestClient.java:72)
I will very glad if someone could helpe me. The piece of my code client
side is following:
//-----------------------
ConfigurationContext ctx =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(path/to/repository,
"\\axis2.xml");
ClientStub stub = new ClientStub(ctx,target);
stub._getServiceClient().getOptions().setProperty("user", "teste"); //
here I am setting the username
//-------------------
I tried the following too:
//-----------------
ConfigurationContext ctx =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(path/to/repository,
"\\axis2.xml");
ClientStub stub = new ClientStub(ctx,target);
ServiceClient serviceClient = stub._getServiceClient();
Options options = serviceClient.getOptions();
options.setProperty("user", "teste");
serviceClient.setOptions(options);
stub._setServiceClient(serviceClient);
//----------------------
In the axis2.xml I am not using the "user" element. The piece of this
file is following:
// -----------------
<axisconfig name="AxisJava2.0">
<module ref="rampart" />
<parameter name="OutflowSecurity">
<action>
<items>UsernameToken</items>
<!-- <user>teste</user> -->
<passwordCallbackClass>org.apache.ws.axis2.PWCBHandler</passwordCallbackClass>
</action>
</parameter>
<parameter name="hotdeployment" locked="false">true</parameter>
<parameter name="hotupdate" locked="false">true</parameter>
<messageReceiver mep="INOUT"
class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
<transportSender name="http"
class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
<parameter name="PROTOCOL" locked="false">HTTP/1.0</parameter>
</transportSender>
<phaseOrder type="inflow">
<!--
Continue
--->
// ------------------------------------------
Please, Where is the problem? There are other way to set the
usernametoken programmatically?
Thanks in advance,
Edson
--
Edson Tavares de Camargo - Instituto Stela
Florianópolis - SC - Brasil
(48) 3239 2572
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]