WSO2 DSS - INCOMPATIBLE PARAMETERS ERROR Nested Exception - wso2

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>

Related

Error reading XMLStreamReader by django request

My xml data:
xml_payload =
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<Authentication >
<username>blabla</username>
<password>123456789</password>
</Authentication>
</soap:Header>
<soap:Body>
<data>
<title>Test title</title>
<content>Test body format</content>
</data>
</soap:Body>
</soap:Envelope>
My request in django project:
try:
url = "http://someurls.com"
res = requests.post(url=url, data=xml_payload, headers={'Content-type': 'application/xml'})
return response.content, response.status_code
except Exception as e:
print(e)
return None, 500
When i hit the request using postman then i get response is given bellow:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>Error reading XMLStreamReader.</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>'
It returns an error. I am surfing around the internet but didn't find any answer which is fulfilled my query.
Try to pass the xml payload as follows:
xml_payload = """<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<Authentication >
<username>blabla</username>
<password>123456789</password>
</Authentication>
</soap:Header>
<soap:Body>
<data>
<title>Test title</title>
<content>Test body format</content>
</data>
</soap:Body>
</soap:Envelope>"""
Afterd days, i finally found the answer. When i create a xml payload by python then python invisibly add "\n" at the end of every line. So when i replaced those "\n" then i works perfectly.
xml_payload = xml_payload.replace("\n", "")

How to remove specific xmlns:ns from SOAP response

Below is my sample SOAP response.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns4:createReservationResponse xmlns:ns2="http://www.xyz2.com/documentation/createEnvironment/input" xmlns:ns3="http://webservices.xyz.com/documentation/reservations/createReservation/output" xmlns:ns4="http://webservices.xyz.com/documentation/reservations/createReservation/input" xmlns:ns5="http://webservices.xyz.com/documentation/reservations/cancelReservation/input" xmlns:ns6="http://webservices.xyz.com/documentation/reservations/cancelReservation/output">
<return>
<!-- response data -->
</return>
</ns4:createReservationResponse>
</soap:Body>
</soap:Envelope>
How do i remove unwanted namespaces here in my case xmlns:ns2, xmlns:ns4, xmlns:ns5 and xmlns:ns6. I should only keep xmlns:ns3 in the response.
What should i change in my wsdl so that i can get the expected response as below.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns4:createReservationResponse xmlns:ns3="http://webservices.xyz.com/documentation/reservations/createReservation/output">
<return>
<!-- response data -->
</return>
</ns4:createReservationResponse>
</soap:Body>
</soap:Envelope>
Please help me out from this.
Thanks in adv.

XIAdapter Error in Soap UI

I'm trying to submit the request and get the response in SOAP UI but getting the following error.
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP:Body>
<SOAP:Fault>
<faultcode>SOAP:Server</faultcode>
<faultstring>Server Error</faultstring>
<detail>
<s:SystemError xmlns:s="http://sap.com/xi/WebService/xi2.0">
<context>XIAdapter</context>
<code>ADAPTER.JAVA_EXCEPTION</code>
<text>See log trace with id: n/a</text>
</s:SystemError>
</detail>
</SOAP:Fault>
</SOAP:Body>
</SOAP:Envelope>
The request i'm sending is
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:seg="http://intel.com/xi/Intel-MDM/Project/Segment">
<soapenv:Header/>
<soapenv:Body>
<seg:ListSegment_Request>
<!--Optional:-->
<SegmentName></SegmentName>
<!--Optional:-->
<StatusCode></StatusCode>
<!--Optional:-->
<PendingInd></PendingInd>
<!--Optional:-->
<ChangeDateFrom></ChangeDateFrom>
<!--Optional:-->
<ChangeTimeFrom></ChangeTimeFrom>
<!--Optional:-->
<ChangeDateTo></ChangeDateTo>
<!--Optional:-->
<ChangeTimeTo></ChangeTimeTo>
<!--Optional:-->
<List>
<!--Zero or more repetitions:-->
<Item>
<SegmentIdentifier>?</SegmentIdentifier>
</Item>
</List>
</seg:ListSegment_Request>
</soapenv:Body>
</soapenv:Envelope>
Is the issue with server or SOapUI or am i missing something here?

Soap UI: Failed to find MockResponse

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.

Add role using WSO2 GReg admin service addRole

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>