Hi all!
I have a problem with enabling WS-security on Axis client. I am using
Axis, not Axis2. The problem is, that when the security is enabled, Axis
doesn't encode special characters (like "<") in XML-elements, and I am
getting an error from server:
----------------------------------------------------
org.xml.sax.SAXParseException: The content of elements must consist of
well-formed character data or markup.
----------------------------------------------------
When the security is not enabled, characters encoded just fine.
The name of my service is "SendSms". I am configuring the service using
following construction:
----------------------------------------------------
EngineConfiguration config = new FileProvider("conf/client_deploy.wsdd");
SendSmsServiceLocator serviceLocator = new SendSmsServiceLocator(config);
SendSms_PortType serviceStub = serviceLocator.getSendSms();
Stub stub = (Stub) serviceStub;
stub._setProperty(UsernameToken.PASSWORD_TYPE, WSConstants.PASSWORD_DIGEST);
stub._setProperty(WSHandlerConstants.USER, userName);
stub._setProperty(WSHandlerConstants.PW_CALLBACK_REF, callbackHandler);
----------------------------------------------------
The content of the "conf/client_deploy.wsdd" is the following:
----------------------------------------------------
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<transport name="http"
pivot="java:org.apache.axis.transport.http.HTTPSender"/>
<globalConfiguration >
<requestFlow >
<handler type="java:org.apache.ws.axis.security.WSDoAllSender" >
<parameter name="action" value="UsernameToken"/>
<parameter name="passwordType" value="PasswordDigest"/>
</handler>
</requestFlow >
</globalConfiguration >
</deployment>
----------------------------------------------------
Thanks for your help in advance!
--
Sergei Fedulov
Euro-Baltic Software Alliance
Mobile: +372 56 984026
ICQ#: 257838427
MSN: [EMAIL PROTECTED]
Skype: fedulows
Y!ID: fedulows
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]