I need a little guide please. An external application will send to my webapp several times a day this info (push in my application). My app is developed in php with symfony3 as framework).
The information I will receive will be something like this (soap definition):
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header/>
<soap:Body>
<RoomRateListUpdRequest>
<RoomRateListUpdRQ Language="es" Version="1">
<Login User="hdynastic" Password="Dynastic2017" HotelCode="1">
</Login>
<RoomRateListUpd>
<Contracts>
<Contract id="104595" DateFrom="2019-08-03" DateTo="2019-08-03">
<Rates>
<Rate DateFrom="2019-08-03" DateTo="2019-08-03">
<Rooms>
<Room RoomTypeID="440">
<Allotments>
<Allotment AllotmentDate="2019-08-03" IsAvailable="true">98</Allotment>
</Allotments>
</Room>
</Rooms>
</Rate>
</Rates>
</Contract>
</Contracts>
</RoomRateListUpd>
</RoomRateListUpdRQ>
</RoomRateListUpdRequest>
</soap:Body>
</soap:Envelope>
What kind of webservice should I create to read this type of information? How to listen & receive this soap definition?
Thank you very much for any help provided!
Related
im trying to build a soap request for the following wsdl method= "GetData"
note that not all the values are required, i've been struggling with this for a week, any help would be very appreciated
Host: xxxxxxxxxxxxxxxx
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "xxxxxxxxxxx"
<?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>
<GetData xmlns="xxxxxx">
<key>string</key>
<transferDef>
<Where />
<OrderBy>
<OrderByItems>
<BinaryArithmetic xsi:nil="true" />
<Categorization xsi:nil="true" />
<Function xsi:nil="true" />
<QueryField xsi:nil="true" />
<QueryForm xsi:nil="true" />
</OrderByItems>
</OrderBy>
<ProjectId>string</ProjectId>
<DbType>Production or Test</DbType>
</transferDef>
<token>
<Id>guid</Id>
<LastResponseIdReturned>long</LastResponseIdReturned>
<FirstResponseIdReturned>long</FirstResponseIdReturned>
<NumberOfResponsesReturned>long</NumberOfResponsesReturned>
<DatasetsReturned>long</DatasetsReturned>
<LastDataSet>boolean</LastDataSet>
<ProjectId>string</ProjectId>
<ChangeTrackingVersion>long</ChangeTrackingVersion>
</token>
</GetData>
</soap:Body>
</soap:Envelope>
Nowadays, the best way to consume SOAP WS in PHP is to use a WSDL to PHP such as the PackageGenerator project which will generate the classes to construct the request, then to send the request then to handle the response all that using PHP objects. The generated classes are sufficiently intuitive to construct the request. In addition, it uses composer as the autoloader.
kind of resolved the issue, the problem was with the <token></token> part.
Since it needs a value of type:guid <Id>guid</Id> that as mentioned in the wsdl and xml request, is a dataset created by a .Net library, and it's used to iterate over the samples, it's quite a complicated request, since it needs previous steps to be fulfilled, so i did the request, by omitting the <token> section
I am in the process of developing process to communicate with the Unique Student Identifier (USI) Webservice. I have a Vanguard token, courtesy of some nice (SoapClient avoiding) code by Sergey Vidusov (thanks!) and I'm trying to use the contents of that token in my (also SoapClient avoiding) SOAP request to the USI service. I am using the "example security header" from the V2.0 Technical Services contract (P79) as a template and trying to fill in the blanks from the token and despite a few dozen slightly varied iterations, I constantly get:
An error occurred when verifying security for the message.
in the SOAP fault section of the response. I won't be surprised to learn that I am going about this the wrong way, but I am, for the moment out of ideas.
From the token, I am taking the Binary Secret and using it as the Signature value and the SecurityTokenReference->KeyIdentifier as the KeyIdentifier in my request. I've also copied the entire EncryptedAssertion section from the token in to the request.
My (supposedly valid) XML is like
<s:Envelope
xmlns:s="http://www.w3.org/2003/05/soap-envelope"
xmlns:a="http://www.w3.org/2005/08/addressing"
xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s:Header>
<a:Action s:mustUnderstand="1">http://usi.gov.au/ws/2015/VerifyUSI</a:Action>
<a:MessageID>urn:uuid-594a3e4f2c463</a:MessageID>
<a:ReplyTo>
<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
</a:ReplyTo>
<a:To s:mustUnderstand="1"> http://usi.gov.au/ws/2015/VerifyUSI </a:To>
<o:Security s:mustUnderstand="1"
xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<u:Timestamp u:Id="_0">
<u:Created>2017-06-21T09:37:19.000Z</u:Created>
<u:Expires>2017-06-21T10:37:19.000Z</u:Expires>
</u:Timestamp>
<EncryptedAssertion
xmlns="urn:oasinametc:SAML:2.0:assertion">
<EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element" xmlnxenc="http://www.w3.org/2001/04/xmlenc#">
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/>
<KeyInfo
xmlns="http://www.w3.org/2000/09/xmldsig#">
<EncryptedKey xmlne="http://www.w3.org/2001/04/xmlenc#">
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
</EncryptionMethod>
<KeyInfo>
<SecurityTokenReference xmlno="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<X509Data>
<X509IssuerSerial>
<X509IssuerName>CN=Australian Government Notary Services OCA, OU=For Development purposes ONLY, OU=Australian Authentication and Notary Services, O=Australian Government, C=AU</X509IssuerName>
<X509SerialNumber>137894267415199651126496945754681728351</X509SerialNumber>
</X509IssuerSerial>
</X509Data>
</SecurityTokenReference>
</KeyInfo>
<CipherData>
<CipherValue>Bc30iHzG4b9ypeC0q8+wvCRox6jTplCg4hKMUpNAXhmhzQyCfFgb3ROihGMB6wLb1moTT/+WpxsMljpeBTKu3oYo8anxwQQf6921Sz7lJCGUrWWMg9IZxq9qEfE85DBqo7tuhs7qkpHlgsUEC/D3IMRycze7x2wJphs6AFBtNDZwVogrQNyp76AUVCGqMSy7EA5woNOuPZqYYHWUDU7/Lv9Jzp6ccOwYXpmnwsW7dMecN6sJbZeopCNf9FuVHS0OJi/l7uadi3VDwRJuiPEB09tETvYN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xdsr3a5RSOJWjWeqjkOD11AGMfRyYBcL5LOPqxDbVBAoL162k9j5rYFqvW6DzgGLgHBGfXEnzZnTo5dm6dk/kSNma4paXiuD1zhEhWLXM20p4lR3CQCHR6vC2RxJOAYc4OThiEDPvxQ6OJDwIsLuM0IFAJZ3nji0vo2wBm6jFep2VX3x8CatC8LA2H5Y9nw+vkO810e+FTggU+8xLfNTawdtin/KwhA0hnWaARCRyEvPUnNdPCUyP+PGa5cIOGz+z8xjZkbDVsjr41Z6Tkf0tufMgsWYoYfd166JhKbkJo+70G0JIO5Ieb5kca1GGubULG/RjnB7TN8XM8xoIBA4KkiqPbVC7KyIjJw8hSks8SdYGhfm3iEidqYXx51LyB1ukItSOe/H+8agpkpNG9s7b+CJrZOwqQoqFW7Pxz4YJEcTBQH1/rGEZDjeUcyHC8BoiSnfoBGFKggBh1MWpz63td4TnGc8bQ9sMpFMBMUD0gWOhhV4QWlhTsJr4PR7Rh4to1zR+Wq1ydobj4u36Vu+Vo96Tm15JzW9TWzLaotVx/Lc6VkfIx8DqCPToq4m3GDdMNO9QN2rI</CipherValue>
</CipherData>
</EncryptedData>
</EncryptedAssertion>
<Signature
xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></CanonicalizationMethod>
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"></SignatureMethod>
<Reference URI="#_0">
<Transforms>
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></Transform>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></DigestMethod>
<DigestValue>3d5GbpTJJ2uX3t4fJz3oT3TuaUA=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>3zexIO6yp7PTD1M7H7BD3rURd2Yj35ELKRSSuLqVHso=</SignatureValue>
<KeyInfo>
<o:SecurityTokenReference k:TokenType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1"
xmlns:k="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd">
<o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.0#SAMLAssertionID">_ef36244c-da95-47ed-9abf-ddce3c85edd1</o:KeyIdentifier>
</o:SecurityTokenReference>
</KeyInfo>
</Signature>
</o:Security>
</s:Header>
<s:Body>
<soap:Body
xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<u:VerifyUSI
xmlns:u="http://usi.gov.au/2015/ws">
<u:OrgCode>970003</u:OrgCode>
<u:USI>ABCDEFGHJK</u:USI>
<u:FirstName>John</u:FirstName>
<u:FamilyName>Smith</u:FamilyName>
<u:DateOfBirth>1971-12-01</u:DateOfBirth>
</u:VerifyUSI>
</soap:Body>
</s:Body>
I feel I am close ... but just need another clue to propel me forward
I just ran your XML through an online XML validator at http://www.xmlvalidation.com, and it says XML document structures must start and end within the same entity.. Looking at your XML (and this might just be a screwed copy paste to SO), it appears you don't have a closing tag for </s:Envelope>.
Add that first if it isn't there. If it is, you'll need to look in your PHP error_log and get the real error message and stack trace so you can debug a little further.
I've done a few soap-client projects already but this time I am a bit stuck. I need to submit more then just an array this time - the XML looks like this:
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<InsertAddr xmlns="http://example.com/Service/">
<item>
<ID>long</ID>
<Text>string</Text>
<Fields>
<FieldItem>
<Name>string</Name>
<Value>string</Value>
</FieldItem>
<FieldItem>
<Name>string</Name>
<Value>string</Value>
</FieldItem>
</Fields>
</item>
</InsertAddr>
</soap12:Body>
</soap12:Envelope>
Normally I would call this like
$response = $client->InsertAddr(array('ID' => $submID, 'Text' => $submText, .....)
I've tried to submit id,text and an array with the fileds but it won't work.
Any advice what I should submit?
Thanks
I strongly advise you to use a WSDL to php generator so you won't wonder how to construct the request. In addition you'll handle the response very easily (depending on the generator you use).
You could try the PackageGenerator project which is very complete.
How should I implement a SOAP client that consumes a service using ws-security.
I have this binding information
<wsHttpBinding>
<binding name="WSHttpBinding_Service" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text"
textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="false" />
</security>
</binding>
</wsHttpBinding>
To my understanding this a .Net configuration and must be mapped to corresponding definitions in PHP.
The wsHttpBinding to my understanding means that SOAP1.1 must be used, and that seems to be working fine.
However, it the security settings are a big problem.
Is there any PHP library that supports WS Security?
I have tried to add a security header to PHP call:
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>username</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</wsse:Password>
</wsse:UsernameToken></wsse:Security>
However, this does not help. Am I missing something?
There are many questions in Stackoverflow on PHP and WS-Security, but I have not found any of them helpful.
EDIT: It turned out that there were problems in the server side.
You can use the vanilla PHP SoapClient (and friends) by using SoapVar to set the SOAP headers. For example;
$objSoapClient = new \SoapClient([...]);
$strXML = <<<XML
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>username</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
XML;
$objAuthVar = new \SoapVar($strXML, XSD_ANYXML);
$objAuthHeader = new \SoapHeader("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", 'Security', $objAuthVar, false);
$objSoapClient->__setSoapHeaders(array($objAuthHeader));
I'm attempting to implement FedEx Package Tracking in a project using the XML api. The following is my tracking request:
'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v6="http://fedex.com/ws/track/v6">
<soapenv '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v6="http://fedex.com/ws/track/v6">
<soapenv:Header/>
<soapenv:Body>
<v6:TrackRequest>
<v6:WebAuthenticationDetail>
<v6:UserCredential>
<v6:Key>'.fedex_accesskey.'</v6:Key>
<v6:Password>'.fedex_password.'</v6:Password>
</v6:UserCredential>
</v6:WebAuthenticationDetail>
<v6:ClientDetail>
<v6:AccountNumber>'.fedex_account.'</v6:AccountNumber>
<v6:MeterNumber>'.fedex_meter.'</v6:MeterNumber>
<v6:IntegratorId></v6:IntegratorId>
<v6:Localization>
<v6:LanguageCode>EN</v6:LanguageCode>
<v6:LocaleCode>US</v6:LocaleCode>
</v6:Localization>
</v6:ClientDetail>
<v6:TransactionDetail>
<v6:CustomerTransactionId>Track By Number</v6:CustomerTransactionId>
<v6:Localization>
<v6:LanguageCode>EN</v6:LanguageCode>
<v6:LocaleCode>US</v6:LocaleCode>
</v6:Localization>
</v6:TransactionDetail>
<v6:Version>
<v6:ServiceId>trck</v6:ServiceId>
<v6:Major>6</v6:Major>
<v6:Intermediate>0</v6:Intermediate>
<v6:Minor>0</v6:Minor>
</v6:Version>
<v6:PackageIdentifier>
<v6:Value>'.$tracking_number.'</v6:Value>
<v6:Type>TRACKING_NUMBER_OR_DOORTAG</v6:Type>
</v6:PackageIdentifier>
</v6:TrackRequest>
</soapenv:Body>
</soapenv:Envelope>';:Header/>
<soapenv:Body>
<v6:TrackRequest>
<v6:WebAuthenticationDetail>
<v6:UserCredential>
<v6:Key>'.fedex_accesskey.'</v6:Key>
<v6:Password>'.fedex_password.'</v6:Password>
</v6:UserCredential>
</v6:WebAuthenticationDetail>
<v6:ClientDetail>
<v6:AccountNumber>'.fedex_account.'</v6:AccountNumber>
<v6:MeterNumber>'.fedex_meter.'</v6:MeterNumber>
<v6:IntegratorId></v6:IntegratorId>
<v6:Localization>
<v6:LanguageCode>EN</v6:LanguageCode>
<v6:LocaleCode>US</v6:LocaleCode>
</v6:Localization>
</v6:ClientDetail>
<v6:TransactionDetail>
<v6:CustomerTransactionId>Track By Number</v6:CustomerTransactionId>
<v6:Localization>
<v6:LanguageCode>EN</v6:LanguageCode>
<v6:LocaleCode>US</v6:LocaleCode>
</v6:Localization>
</v6:TransactionDetail>
<v6:Version>
<v6:ServiceId>trck</v6:ServiceId>
<v6:Major>6</v6:Major>
<v6:Intermediate>0</v6:Intermediate>
<v6:Minor>0</v6:Minor>
</v6:Version>
<v6:PackageIdentifier>
<v6:Value>'.$tracking_number.'</v6:Value>
<v6:Type>TRACKING_NUMBER_OR_DOORTAG</v6:Type>
</v6:PackageIdentifier>
</v6:TrackRequest>
</soapenv:Body>
</soapenv:Envelope>';
All values are being swapped in correctly, and I am getting a success response back from FedEx. The issue is the response only has one tracking event. The event appears to be the last tracking update from FedEx (in this case, delivery time, date, and address) but is not showing any tracking events along the way.
Here is the response I get: Pastebin
As you can see, the package status is delivered, and the delivery address is listed in , but the origin and the steps along the way are not. Any suggestions on how to get all the tracking info and not just the most recent step? Help appreciated.
You were missing to set to true the IncludeDetailedScans element. Here is an example of a SOAP Envelope:
<?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>
<TrackRequest xmlns="http://fedex.com/ws/track/v6">
<WebAuthenticationDetail>
<CspCredential>
<Key>CSP_KEY</Key>
<Password>CSP_PASSWORD</Password>
</CspCredential>
<UserCredential>
<Key>DEVELOPER_KEY</Key>
<Password>DEVELOPER_PASSWORD</Password>
</UserCredential>
</WebAuthenticationDetail>
<ClientDetail>
<AccountNumber>ACCOUNT_NUMBER</AccountNumber>
<MeterNumber>METER_NUMBER</MeterNumber>
<ClientProductId>CLIENT_PRODUCT_ID</ClientProductId>
<ClientProductVersion>CLIENT_PRODUCT_VERSION</ClientProductVersion>
</ClientDetail>
<Version>
<ServiceId>trck</ServiceId>
<Major>6</Major>
<Intermediate>0</Intermediate>
<Minor>0</Minor>
</Version>
<PackageIdentifier>
<Value>TRACKING_NUMBER</Value>
<Type>TRACKING_NUMBER_OR_DOORTAG</Type>
</PackageIdentifier>
<IncludeDetailedScans>true</IncludeDetailedScans>
</TrackRequest>
</soap:Body>
</soap:Envelope>
Note that the previous request is only valid if you belong to the FedEx CSP program, if you don't, the code below is the right one for your:
<?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>
<TrackRequest xmlns="http://fedex.com/ws/track/v6">
<WebAuthenticationDetail>
<UserCredential>
<Key>DEVELOPER_KEY</Key>
<Password>DEVELOPER_PASSWORD</Password>
</UserCredential>
</WebAuthenticationDetail>
<ClientDetail>
<AccountNumber>ACCOUNT_NUMBER</AccountNumber>
<MeterNumber>METER_NUMBER</MeterNumber>
</ClientDetail>
<Version>
<ServiceId>trck</ServiceId>
<Major>6</Major>
<Intermediate>0</Intermediate>
<Minor>0</Minor>
</Version>
<PackageIdentifier>
<Value>TRACKING_NUMBER</Value>
<Type>TRACKING_NUMBER_OR_DOORTAG</Type>
</PackageIdentifier>
<IncludeDetailedScans>true</IncludeDetailedScans>
</TrackRequest>
</soap:Body>
</soap:Envelope>
Best!
For Version 8, you need to add the following tag, almost at the very bottom of the XML request, right above the closing "TrackRequest" tag:
<ProcessingOptions>INCLUDE_DETAILED_SCANS</ProcessingOptions>
I've found the solution hidden in the FedEx documentation. It is to supply 1 to get the full history. This value defaults to false and omits all that important tracking information.
I know this question wasn't geared towards .NET but if anyone arrives here (like I did) looking for a .NET specific answer to this question, here it is:
Dim request As New TrackRequest()
Dim options(0) As TrackRequestProcessingOptionType
options(0) = TrackRequestProcessingOptionType.INCLUDE_DETAILED_SCANS
request.ProcessingOptions = options