You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by tranchida <gi...@tranchida.ch> on 2007/12/28 17:57:49 UTC

WS-Security UsernameToken

I have a problem to configure WS-Security UsernameToken

My config

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:http="http://servicemix.apache.org/http/1.0"
	xmlns:p="http://www.vd.ch/tutorial/smx/pojo">

	<http:endpoint xmlns:soap="http://servicemix.apache.org/soap/1.0"
		service="p:PaysService" endpoint="PaysServiceSOAP" role="consumer"
		soap="true" soapVersion="1.1" targetService="p:PaysService"
		locationURI="http://localhost:8192/PaysService"
		defaultMep="http://www.w3.org/2004/08/wsdl/in-out">
		<http:policies>
			<soap:ws-security receiveAction="UsernameToken"/>
		</http:policies>
	</http:endpoint>


</beans>

I receive always the same fault response

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
   <soap:Body>
      <soap:Fault>
         <soap:Code>
            <soap:Value>soap:Receiver</soap:Value>
         </soap:Code>
         <soap:Reason>
            <soap:Text
xml:lang="en">java.lang.NullPointerException</soap:Text>
         </soap:Reason>
      </soap:Fault>
   </soap:Body>
</soap:Envelope>



-- 
View this message in context: http://www.nabble.com/WS-Security-UsernameToken-tp14528308s12049p14528308.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: WS-Security UsernameToken

Posted by tranchida <gi...@tranchida.ch>.
Thank you

I just add keystore="default" and it works.

Documentation must be updated



Michal wrote:
> 
> Try to define keystore attribute for ws-security element - just point to a
> default keystore that is defined in conf/security.xml.
> 
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/WS-Security-UsernameToken-tp14528308s12049p14550922.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: WS-Security UsernameToken

Posted by Michal <ca...@yahoo.com>.
Try to define keystore attribute for ws-security element - just point to a
default keystore that is defined in conf/security.xml.





-- 
View this message in context: http://www.nabble.com/WS-Security-UsernameToken-tp14528308s12049p14546839.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: WS-Security UsernameToken

Posted by tranchida <gi...@tranchida.ch>.
Hello,

I try to recreate a totaly new projet but same result

<?xml version="1.0" encoding="utf-8"?>
<beans xmlns:http="http://servicemix.apache.org/http/1.0"
	xmlns:c="http://service.country.tranchida.ch">
	<http:endpoint service="c:CountryService"
		endpoint="CountryServiceJBIPort" role="consumer" soap="true"
		locationURI="http://localhost:8192/CountryService/"
		defaultMep="http://www.w3.org/2004/08/wsdl/in-out">
		<http:policies xmlns:soap="http://servicemix.apache.org/soap/1.0">
			<soap:ws-security receiveAction="UsernameToken">
			</soap:ws-security>
		</http:policies>
	</http:endpoint>
</beans>

SOAP request

<soap:Envelope xmlns:ser="http://service.country.tranchida.ch"
xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
   <soap:Header>
      <wsse:Security soap:mustUnderstand="true"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <wsse:UsernameToken wsu:Id="UsernameToken-1809155"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <wsse:Username>smx</wsse:Username>
            <wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">smx</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </soap:Header>
   <soap:Body>
      <ser:getCountryByCode>
         <ser:in0>41</ser:in0>
      </ser:getCountryByCode>
   </soap:Body>
</soap:Envelope>

By the way, servicemix-http do not process soap:mustUnderstand="true" ?


mattrpav wrote:
> 
> Can you post the SOAP message you are sending to the service?
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/WS-Security-UsernameToken-tp14528308s12049p14533576.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: WS-Security UsernameToken

Posted by mattrpav <ma...@airband.com>.
Can you post the SOAP message you are sending to the service?


-- 
View this message in context: http://www.nabble.com/WS-Security-UsernameToken-tp14528308s12049p14533427.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.