Advertisement
Guest User

Untitled

a guest
Apr 27th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <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">
  3. <soap:Body>
  4. <GetLineCharacteristics xmlns="http://llu.webservices.opalonline.co.uk/LineCharacteristicsWS">
  5. <request>
  6. <UserCredentials>
  7. <Username>user</Username>
  8. <Password>pass</Password>
  9. <AgentID>1234</AgentID>
  10. </UserCredentials>
  11. <RequestDetails xsi:type="PostcodeRequest">
  12. <Postcode>SW1A 1AA</Postcode>
  13. </RequestDetails>
  14. <UserConsent>Yes</UserConsent>
  15. <ServiceType>MPF</ServiceType>
  16. </request>
  17. </GetLineCharacteristics>
  18. </soap:Body>
  19. </soap:Envelope>
  20.  
  21. $url2 = "https://mercuryllu.webservices.opalonline.co.uk/LineCharacteristicsWSV6/LineCharacteristicsWS.asmx?wsdl";
  22. $params = array(
  23. 'encoding' => 'UTF-8',
  24. 'use' => SOAP_LITERAL,
  25. 'trace' => 1,
  26. 'uri' => 'http://llu.webservices.opalonline.co.uk/LineCharacteristicsWS',
  27. 'connection_timeout' => 2000);
  28. $namespace = 'http://llu.webservices.opalonline.co.uk/LineCharacteristicsWS';
  29. $client2 = new SoapClient($url2, $params);
  30. class PostCodeRequest
  31. {
  32. function __construct($pc)
  33. {
  34. $this->Postcode = $pc;
  35. }
  36. }
  37. class UserCredentials
  38. {
  39. function __construct($pc, $pass, $ag)
  40. {
  41. $this->Username = $pc;
  42. $this->Password = $pass;
  43. $this->AgentID = $ag;
  44. }
  45. }
  46. class request
  47. {
  48. function __construct($pc, $pass, $ag, $rd)
  49. {
  50. $this->UserCredentials = $pc;
  51. $this->UserConsent = $pass;
  52. $this->ServiceType = $ag;
  53. $this->RequestDetails = $rd;
  54. }
  55. }
  56. $credentialsCls = new UserCredentials('User','pass', 9999);
  57. $credentials = new SoapVar($credentialsCls, SOAP_ENC_OBJECT, '',$namespace);
  58. $postCodeRequestCls = new PostcodeRequest('SW1A 1AA');
  59. $postCodeRequest = new SoapVar($postCodeRequestCls,SOAP_ENC_OBJECT,'PostcodeRequest',$namespace);
  60. $requestCls = new request($credentials, 'Yes', 'MPF', $postCodeRequest);
  61. $request = new SoapVar($requestCls, SOAP_ENC_OBJECT,'');
  62. $res3 = $client2->GetLineCharacteristics(new SoapParam($request, 'WhatIsThisdoingHrere'));
  63. header('Content-type:text/xml');
  64. echo $client2->__getLastRequest();
  65.  
  66. <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">
  67.  
  68. <GetLineCharacteristics xmlns="http://llu.webservices.opalonline.co.uk/LineCharacteristicsWS">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement