SOAP request in R - r

Does anyone know how to formulate following SOAP request with R?
POST /API/v201010/AdvertiserService.asmx HTTP/1.1
Host: advertising.criteo.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://advertising.criteo.com/API/v201010/clientLogin"
<?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>
<clientLogin xmlns="https://advertising.criteo.com/API/v201010">
<username>string</username>
<password>string</password>
<source>string</source>
</clientLogin>
</soap:Body>
</soap:Envelope>

This solves the problem:
library(RCurl)
headerFields =
c(Accept = "text/xml",
Accept = "multipart/*",
'Content-Type' = "text/xml; charset=utf-8",
SOAPAction = "https://advertising.criteo.com/API/v201010/clientLogin")
body = '<?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>
<clientLogin xmlns="https://advertising.criteo.com/API/v201010">
<username>string</username>
<password>string</password>
<source>string</source>
</clientLogin>
</soap:Body>
</soap:Envelope>'
curlPerform(url = "https://advertising.criteo.com/API/v201010/AdvertiserService.asmx",
httpheader = headerFields,
postfields = body
)

Related

"AAA" before booking a segment (EnhancedAirbook) and issue ticket (AirTicket)

I'm trying make a search in one particular PCC and then jump to another PCC which is Change AAA before EnhancedAirBook.
searching (Bargin Finder Max-BFM) from one particular PCC and jump in 'AAA' - ChangeContext to other PCC before booking - (EnhancedAirBook) & issuing ticket(AirTicket)
We already have the permission granted to jump in between the PCC's from Sabre.
I tried Change AAA - ChangeContext before booking - (EnhancedAirBook) but the service is failing with an error
Below are the request & response.
Request
`<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Header>
<m:MessageHeader xmlns:m="http://www.ebxml.org/namespaces/messageHeader">
<m:From>
<m:PartyId type="urn:x12.org:IO5:01">info#test.com</m:PartyId>
</m:From>
<m:To>
<m:PartyId type="urn:x12.org:IO5:01">webservices3.sabre.com</m:PartyId>
</m:To>
<m:CPAId>YYYY</m:CPAId>
<m:ConversationId>1555434991</m:ConversationId>
<m:Service m:type="OTA">ContextChangeLLSRQ</m:Service>
<m:Action>ContextChangeLLSRQ</m:Action>
<m:MessageData>
<m:MessageId>mid:1555434991</m:MessageId>
<m:Timestamp>2019-04-16T17-16-31Z</m:Timestamp>
<m:TimeToLive>2019-04-16T17-16-31Z</m:TimeToLive>
</m:MessageData>
<m:DuplicateElimination />
<m:Description>ContextChangeLLSRQ</m:Description>
</m:MessageHeader>
<wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext">
<wsse:BinarySecurityToken valueType="String" EncodingType="wsse:Base64Binary">Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/RESF!ICESMSL</wsse:BinarySecurityToken>
</wsse:Security>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ContextChangeRQ Version="2.0.3">
<ChangeAAA PseudoCityCode="xxxx" />
</ContextChangeRQ>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>`
Response
`<?xml version="1.0" encoding="UTF-8"?>
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header>
<eb:MessageHeader xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" eb:version="1.0" soap-env:mustUnderstand="1">
<eb:From>
<eb:PartyId eb:type="URI">webservices3.sabre.com</eb:PartyId>
</eb:From>
<eb:To>
<eb:PartyId eb:type="URI">info#test.com</eb:PartyId>
</eb:To>
<eb:CPAId>YYYY</eb:CPAId>
<eb:ConversationId>1555434991</eb:ConversationId>
<eb:Service eb:type="OTA">ContextChangeLLSRQ</eb:Service>
<eb:Action>ContextChangeLLSRS</eb:Action>
<eb:MessageData>
<eb:MessageId>9418687622788650624</eb:MessageId>
<eb:Timestamp>2019-04-16T17:17:59</eb:Timestamp>
<eb:RefToMessageId>mid:1555434991</eb:RefToMessageId>
</eb:MessageData>
</eb:MessageHeader>
<wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext">
<wsse:BinarySecurityToken valueType="String" EncodingType="wsse:Base64Binary">Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/RESF!ICESMSLB</wsse:BinarySecurityToken>
</wsse:Security>
</soap-env:Header>
<soap-env:Body>
<soap-env:Fault>
<faultcode>soap-env:Client.Validation</faultcode>
<faultstring>ERR.SWS.CLIENT.VALIDATION_FAILED</faultstring>
<detail>
<stl:ApplicationResults xmlns:stl="http://services.sabre.com/STL/v01" status="NotProcessed">
<stl:Error timeStamp="2019-04-16T12:17:59-05:00" type="Validation">
<stl:SystemSpecificResults>
<stl:Message>cvc-elt.1: Cannot find the declaration of element 'ContextChangeRQ'.</stl:Message>
<stl:ShortText>ERR.SWS.CLIENT.VALIDATION_FAILED</stl:ShortText>
</stl:SystemSpecificResults>
</stl:Error>
</stl:ApplicationResults>
</detail>
</soap-env:Fault>
</soap-env:Body>
</soap-env:Envelope>`
Your missing with the namespace xmlns="http://webservices.sabre.com/sabreXML/2011/10"
<soap:Body>
<ContextChangeRQ xmlns="http://webservices.sabre.com/sabreXML/2011/10" ReturnHostCommand="true" Version="2.0.3">
<ChangeAAA PseudoCityCode="xxxx"/>
</ContextChangeRQ>
</soap:Body>
I try to changeAAA but response
<Message>?FORMAT?</Message>
<ShortText>ERR.SWS.HOST.ERROR_IN_RESPONSE</ShortText>
bellow RQ
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sec="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:mes="http://www.ebxml.org/namespaces/messageHeader" xmlns:ns="http://www.opentravel.org/OTA/2002/11">
<soapenv:Header>
<sec:Security>
<sec:BinarySecurityToken>Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/ACPCRTD!ICESMSLB\/CRT.LB!1575253138274!5391!13</sec:BinarySecurityToken>
</sec:Security>
<mes:MessageHeader mes:id="?" mes:version="?">
<mes:From>
<mes:PartyId >WebServiceClient</mes:PartyId>
</mes:From>
<mes:To>
<mes:PartyId >WebServiceSupplier</mes:PartyId>
</mes:To>
<mes:CPAId>VN</mes:CPAId>
<mes:ConversationId>fOV1LWT3EJIUnGC0Yh1</mes:ConversationId>
<mes:Service ></mes:Service>
<mes:Action>ContextChangeLLSRQ</mes:Action>
<mes:MessageData>
<mes:MessageId>mid:20001209-133003-2333#clientofsabre.com1</mes:MessageId>
<mes:Timestamp>2019-06-15</mes:Timestamp>
</mes:MessageData>
</mes:MessageHeader>
</soapenv:Header>
<soapenv:Body>
<ContextChangeRQ Version="2.0.3" xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ChangeAAA PseudoCityCode="xxxx"/>
</ContextChangeRQ>
</soapenv:Body>
</soapenv:Envelope>

How do I add SSR OSI to SABRE 2.2.1 API

Below is sample request I made, and below is the response I'm getting.
If you can post sample SpecialServiceRq OSI entry request and response sample that would help a lot.
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<SpecialServiceRQ ReturnHostCommand="false" TimeStamp="2018-03-05T19:02:32.219-05:00" Version="2.2.1" xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:ns2="http://services.sabre.com/STL/v01">
<SpecialServiceInfo>
<SecureFlight SegmentNumber="A">
<PersonName DateOfBirth="1969-02-25" Gender="M" NameNumber="1.1">
<GivenName>LIAM</GivenName>
<Surname>JACKSON</Surname>
</PersonName>
</SecureFlight>
<Service SSR_Code="OSI">
<Text>CTCE/ACCEPT//TEST.CORP.COMPANY.COM</Text>
</Service>
</SpecialServiceInfo>
</SpecialServiceRQ>]
[03-05-18 19:02:32.462] [SplitAgentBooker_10009498321_10009498321_2139481603] INFO SABREpl_timings - : T:0.234 secs S:ABE_ABEBOOKD01_9RVB_000000000002 A:SpecialServiceLLSRS M:2139481603_37114603_37772403_14 RSP: [<?xml version="1.0" encoding="UTF-8"?>
<SpecialServiceRS Version="2.2.1" xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:stl="http://services.sabre.com/STL/v01" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<stl:ApplicationResults status="NotProcessed">
<stl:Error timeStamp="2018-03-05T18:02:32-06:00" type="BusinessLogic">
<stl:SystemSpecificResults>
<stl:Message>.CHECK ENTRY FORMAT.NOT ENT BGNG WITH</stl:Message>
<stl:Message>3OSI CTCE/ACCEPT//TEST.CORP.COMPANY.COM</stl:Message>
<stl:ShortText>ERR.SWS.HOST.ERROR_IN_RESPONSE</stl:ShortText>
</stl:SystemSpecificResults>
</stl:Error>
</stl:ApplicationResults>
</SpecialServiceRS>
If your intention is to create the 3CTCEA/ACCEPT//TEST.CORP.COMPANY.COM-1.1 format, then you don't have to use the SecureFlight node, as that one creates the 3DOCS format.
I would advise to remove it altogether:
<SpecialServiceRQ TimeStamp="2018-03-05T19:02:32.219-05:00" Version="2.2.1" xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:ns2="http://services.sabre.com/STL/v01" ReturnHostCommand="true">
<SpecialServiceInfo>
<Service SSR_Code="CTCE" SegmentNumber="A">
<PersonName NameNumber="1.1"/>
<Text>ACCEPT//TEST.CORP.COMPANY.COM</Text>
</Service>
</SpecialServiceInfo>
This way you will create the above format. If this is not the format let me know which one is and I will help with that one as well.

How to submit XML to Web Service using R [duplicate]

Does anyone know how to formulate following SOAP request with R?
POST /API/v201010/AdvertiserService.asmx HTTP/1.1
Host: advertising.criteo.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://advertising.criteo.com/API/v201010/clientLogin"
<?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>
<clientLogin xmlns="https://advertising.criteo.com/API/v201010">
<username>string</username>
<password>string</password>
<source>string</source>
</clientLogin>
</soap:Body>
</soap:Envelope>
This solves the problem:
library(RCurl)
headerFields =
c(Accept = "text/xml",
Accept = "multipart/*",
'Content-Type' = "text/xml; charset=utf-8",
SOAPAction = "https://advertising.criteo.com/API/v201010/clientLogin")
body = '<?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>
<clientLogin xmlns="https://advertising.criteo.com/API/v201010">
<username>string</username>
<password>string</password>
<source>string</source>
</clientLogin>
</soap:Body>
</soap:Envelope>'
curlPerform(url = "https://advertising.criteo.com/API/v201010/AdvertiserService.asmx",
httpheader = headerFields,
postfields = body
)

Alfresco: CMIS web services binding: Why alfresco gives cmis:item by protocol cmis 1.0?

I'm trying to get a document from Alfresco 5.2 using CMIS web services binding (http://server:8080/alfresco/cmisws/cmis?wsdl) and get an error.
Using the wireshark I found that the problem is that the alfresco in the response returns cmis:item element. But according to cmis 1.0 protocol it should not be returned. Why is this happening?
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="0">
<wsu:Timestamp
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsu:Created>2017-10-06T15:33:27.634Z</wsu:Created>
</wsu:Timestamp>
<wsse:UsernameToken>
<wsse:Username>admin</wsse:Username>
<wsse:Password wsse:Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">0000</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<ns2:getTypeDescendants xmlns:ns2="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns="http://docs.oasis-open.org/ns/cmis/core/200908/">
<ns2:repositoryId>53131d3f-d80b-4964-87d9-08b614fe7861</ns2:repositoryId>
<ns2:depth>-1</ns2:depth>
<ns2:includePropertyDefinitions>false</ns2:includePropertyDefinitions>
</ns2:getTypeDescendants>
</soapenv:Body>
</soapenv:Envelope>
Response(part):
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<getTypeDescendantsResponse xmlns="http://docs.oasis-open.org/ns/cmis/messaging/200908/" xmlns:ns2="http://docs.oasis-open.org/ns/cmis/core/200908/">
<types>
<type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:cmisTypeItemDefinitionType">
<ns2:id>cmis:item</ns2:id>
<ns2:localName>item</ns2:localName><ns2:localNamespace>http://www.alfresco.org/model/cmis/1.0/cs01</ns2:localNamespace>
<ns2:displayName>Item Type</ns2:displayName>
<ns2:queryName>cmis:item</ns2:queryName>
<ns2:description>CMIS Item</ns2:description>
<ns2:baseId>cmis:item</ns2:baseId>
<ns2:creatable>false</ns2:creatable>
<ns2:fileable>false</ns2:fileable>
<ns2:queryable>false</ns2:queryable>
<ns2:fulltextIndexed>true</ns2:fulltextIndexed>
<ns2:includedInSupertypeQuery>true</ns2:includedInSupertypeQuery>
<ns2:controllablePolicy>true</ns2:controllablePolicy>
<ns2:controllableACL>true</ns2:controllableACL>
</type>

Add namespace to WSDL definition

I have a very BASIC WCF service with WSDL defition as follows:
<wsdl:definitions
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:tns="urn:MyService"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"
xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy"
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:wsa10="http://www.w3.org/2005/08/**addressing"
xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
name="MyService" targetNamespace="urn:MyService">
I want to add the namespace xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" to the definition but i don't know where and how.
How do i add that namespace ? Thank you
Just edit and add the string xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
An example:
<definitions
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tns="http://example.com/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
name="WebServiceName"
targetNamespace="http://example.com/"
xmlns="http://schemas.xmlsoap.org/wsdl/">

Resources