I have been trying to cancel reservation on Amadeus and each time I do that with a valid PNR, it returns an empty response. Below is the sample code
cancelPNR Request XML
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<wmPNRCancel xmlns="http://traveltalk.com/wsPNRCancel">
<OTA_CancelRQ>
<POS>
<Source PseudoCityCode="*******" ISOCurrency="NGN">
<RequestorID Type="21" ID="********"/>
</Source>
<TPA_Extensions>
<Provider>
<Name>Amadeus</Name>
<System>Test</System>
<Userid>******</Userid>
<Password>**********</Password>
</Provider>
</TPA_Extensions>
</POS>
<UniqueID ID="******"/>
</OTA_CancelRQ>
</wmPNRCancel>
</soap:Body>
</soap:Envelope>
cancelPNR response
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<wmPNRCancelResponse xmlns="http://traveltalk.com/wsPNRCancel" />
</soap:Body>
</soap:Envelope>
What could be wrong ? Please I need help
Related
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", "")
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.
Magento 1.9.1.0, SOAP, WS-I compliant. i'm trying to update product qty, magento returns "success", qty stays as it was before (didn't changed). How to change product qty from SOAP ?
request:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<catalogInventoryStockItemMultiUpdateRequestParam xmlns="urn:Magento">
<sessionId xmlns="">32efdfffb0f27f43f3ee0073a9351de3</sessionId>
<productIds xmlns="">
<complexObjectArray>9198</complexObjectArray>
</productIds>
<productData xmlns="">
<complexObjectArray>
<qty>17</qty>
<is_in_stock>1</is_in_stock>
</complexObjectArray>
</productData>
</catalogInventoryStockItemMultiUpdateRequestParam>
</s:Body>
</s:Envelope>
response:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:Magento">
<SOAP-ENV:Body>
<ns1:catalogInventoryStockItemMultiUpdateResponseParam>
<result>true</result>
</ns1:catalogInventoryStockItemMultiUpdateResponseParam>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
I just tried this and it worked
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Magento">
<soapenv:Header/>
<soapenv:Body>
<urn:catalogInventoryStockItemMultiUpdateRequestParam>
<sessionId>ddaf6e2b9bf7055ae59b7cbeeca9c894</sessionId>
<productIds>
<!--Zero or more repetitions:-->
<complexObjectArray>764</complexObjectArray>
</productIds>
<productData>
<!--Zero or more repetitions:-->
<complexObjectArray>
<!--Optional:-->
<qty>9</qty>
<use_config_notify_stock_qty>1</use_config_notify_stock_qty>
</complexObjectArray>
</productData>
</urn:catalogInventoryStockItemMultiUpdateRequestParam>
</soapenv:Body>
</soapenv:Envelope>
Here are the results
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:Magento">
<SOAP-ENV:Body>
<ns1:catalogInventoryStockItemMultiUpdateResponseParam>
<result>true</result>
</ns1:catalogInventoryStockItemMultiUpdateResponseParam>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Here is a screen shot of the updated qty
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
I'm sending the following:
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">
<soap:Body>
<GetList xmlns=\"http://schemas.microsoft.com/sharepoint/soap/\">
<listName>{5DB680A5-EFCB-4F48-AC80-835AFBCE9FDA}</listName>
</GetList>
</soap:Body>
</soap:Envelope>
but am getting back results for GetListCollection
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetListCollectionResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/"><GetListCollectionResult>...
am I doing something wrong?