I'm testing a webservice thats based on CXF
I've added the following to the Soap header:
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-EFE11D3CEA7EFDCC4A14488809292421">
<wsse:Username>abc</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">edfewdw</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">AmAK2EvHMZWobr6KBJ4nOA==</wsse:Nonce>
<wsu:Created>2015-11-30T10:55:29.240Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
But inspite of this I'm getting the following soap fault
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>General security error (WSSecurityEngine: No password callback supplied)</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
Any suggesstions?
You need to define a CallbackHandler implementation on the receiving side, to validate the password. There are some examples here if you are using CXF: http://cxf.apache.org/docs/ws-security.html
Related
I am getting the error
INCOMPATIBLE PARAMETERS ERROR Nested Exception : avax.xml.stream.XMLStreamException: DS Fault Message: Error in 'CallQuery.extractParams', cannot find parameter with type:query-param name:p_orderdetailcode"
for the below structure
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:dat="http://ws.wso2.org/dataservice">
<soap:Header/>
<soap:Body>
<dat:hdhs_testdetail>
<dat:p_ordercode>1</dat:p_ordercode>
<!--1 or more repetitions:-->
<dat:p_orderdetailcodes>
<dat:p_orderdetailcode>11</dat:p_orderdetailcode>
<dat:p_orderdetailcode>12</dat:p_orderdetailcode>
</dat:p_orderdetailcodes>
</dat:hdhs_testdetail>
</soap:Body>
</soap:Envelope>
But it is working fine without nested "p_orderdetailcodes" like below
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:dat="http://ws.wso2.org/dataservice">
<soap:Header/>
<soap:Body>
<dat:hdhs_testdetail>
<dat:p_ordercode>1</dat:p_ordercode>
<!--1 or more repetitions:-->
<dat:p_orderdetailcode>11</dat:p_orderdetailcode>
<dat:p_orderdetailcode>12</dat:p_orderdetailcode>
</dat:hdhs_testdetail>
</soap:Body>
</soap:Envelope>
I'm trying to implement a soap mock service using SoapUI (v5.2.1). More specifically, I want to associate specific soap responses with specific requests. For example:
QUERY_MATCH configuration:
XPath:
declare namespace mynamespace1="http://my.namespace1.com/";
declare namespace mynamespace2="http://my.namespace2.com/xsd";
//mynamespace1:myrequest/cmd[1]/mynamespace2:myparam[1]
Expected Value:
12345
Dispatch to:
myMockResponse
Soap Request:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:mynamespace1="http://my.namespace1.com/" xmlns:mynamespace2="http://my.namespace2.com">
<soap:Header/>
<soap:Body>
<mynamespace1:myrequest>
<!--Optional:-->
<cmd>
<!--Optional:-->
<mynamespace2:id>1</mynamespace2:id>
<!--Optional:-->
<mynamespace2:myparam>12345</mynamespace2:myparam>
</cmd>
</mynamespace1:myrequest>
</soap:Body>
</soap:Envelope>
However, when I perform this request in SoapUI, I get the following response:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Body>
<soap:Fault>
<soap:Code>
<soap:Value>Server</soap:Value>
</soap:Code>
<soap:Reason>
<!--1 or more repetitions:-->
<soap:Text xml:lang="en">Failed to find MockResponse</soap:Text>
</soap:Reason>
</soap:Fault>
</soap:Body>
</soap:Envelope>
can anyone tell me what I'm doing wrong? Thank you in advance for your help.
Best regards.
I'm trying to add a role using the WSO2 GReg admin service addRole using SoapUI. Unfortunately I get an error.
Using the following request I get the error "java.lang.ArrayIndexOutOfBoundsException: 3":
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:mgt="http://mgt.user.carbon.wso2.org">
<soap:Header/>
<soap:Body>
<mgt:addRole>
<!--Optional:-->
<mgt:addRole>test</mgt:addRole>
</mgt:addRole>
</soap:Body>
</soap:Envelope>
Using the following request I get the error "Role name not valid. Role name must be a non null string with following format, ^[^~!#$;%^*+={}\|\\<>,\'\"]{3,30}$":
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:mgt="http://mgt.user.carbon.wso2.org">
<soap:Header/>
<soap:Body>
<!--Optional:-->
<mgt:addRole>test</mgt:addRole>
</soap:Body>
</soap:Envelope>
Any idea's what I'm doing wrong?
Regards, nidkil
Can you try with the following Envelope?
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:mgt="http://mgt.user.carbon.wso2.org">
<soap:Header/>
<soap:Body>
<mgt:addRole>
<mgt:roleName>test</mgt:roleName>
</mgt:addRole>
</soap:Body>
</soap:Envelope>
I created a webservice producer from wsdl file using cxf.response is
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http://esb.tiaa.org/life-insurance-correspondence-v1/types" xmlns:ns3="http://esb.tiaa.org/indianarmyshortservice">
<soap:Body>
<ns2:getSourcesResponse xmlns:ns2="http://channelmapwebservice.service.web.ccad/">
<return>
<sourceId>3</sourceId>
<sourceName>DUMMY9</sourceName>
</return>
The expected result is
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:getSourcesResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://com.ccadllc.dac.web.service.channelmapwebservice">
<getSourcesReturn soapenc:arrayType="xsd:anyType[644]"
xsi:type="soapenc:Array" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<getSourcesReturn xsi:type="ns2:SourceInfo" xmlns:ns2="http://channelmapwebservice.service.web.ccad">
<sourceId xsi:type="xsd:int">3</sourceId>
<sourceName xsi:type="xsd:string">DUMMY9</sourceName>
</getSourcesReturn>
How to obtain the exptected result
My WSO2 Identity Server version is 4.0.0 final. I have turned on admin service.
Here are the two requests.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mgt="http://mgt.user.carbon.wso2.org">
<soapenv:Header/>
<soapenv:Body>
<mgt:listUsers>
<!--Optional:-->
<mgt:filter>*</mgt:filter>
</mgt:listUsers>
</soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mgt="http://mgt.user.carbon.wso2.org">
<soapenv:Header/>
<soapenv:Body>
<mgt:getAllRolesNames/>
</soapenv:Body>
</soapenv:Envelope>
If i call them separately in Test Case, it is okay. If i call listUsers first, and then getAllRolesNames (In SOAPUI, call listUser first, then change the Envelope to getAllRolesName one), it shows
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>unknown</faultstring>
<detail>
<ns:UserAdminUserAdminException xmlns:ns="http://mgt.user.carbon.wso2.org">
<UserAdminException xsi:type="ax2566:UserAdminException" xmlns="http://mgt.user.carbon.wso2.org" xmlns:ax2566="http://common.mgt.user.carbon.wso2.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ax2566:errorMessage xsi:nil="true"/>
</UserAdminException>
</ns:UserAdminUserAdminException>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
Does it mean there are some bug inside server side implementation ?
I tested them in SOAPUI. The login session is not expired, i can still use it for querying. Does it mean i have to create ws client bean using request scope instead of session scope?
Thanks a lot.