How to make web service tell request that SOAP header is required? -


i created web service, written in java , generated using eclipse & axis2. created ws-security policy in services.xml file , created authentication handler. new web services, forgive if statements wrong. after have generated web service , have wsdl, create soapui project , generates requests. soapui generated requests have soap header blank, when run request receive security exception authentication failed. when enter proper header:

<soapenv:header xmlns:wsa="http://www.w3.org/2005/08/addressing"> <wsse:security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustunderstand="1"> <wsu:timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:id="timestamp-12468716"> <wsu:created>2008-06-23t13:17:13.841z</wsu:created> <wsu:expires>2008-06-23t13:22:13.841z</wsu:expires> </wsu:timestamp> <wsse:usernametoken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:id="usernametoken-31571602"> <wsse:username>alice</wsse:username> <wsse:password type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#passwordtext">bobpw</wsse:password> </wsse:usernametoken> </wsse:security> <wsa:to>http://localhost:8081/axis2/services/sample01</wsa:to> <wsa:messageid>urn:uuid:aedba74a8d1fc94b631214227032877</wsa:messageid> <wsa:action>urn:echo</wsa:action> </soapenv:header> 

then works. there wsdl missing tells soapui automatically generate header question marks, ?, in username , password fields? because have used soapui other wsdl's did generate these headers automatically.

you can specify username , password on soap ui, can set @ test request properties tab or test properties.

try : http://www.soapui.org/soap-and-wsdl/authenticating-soap-requests.html


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -