Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> SOAP - jak wysłać zapytanie
ostrylg
post
Post #1





Grupa: Zarejestrowani
Postów: 144
Pomógł: 18
Dołączył: 11.12.2005
Skąd: Gdańsk

Ostrzeżenie: (0%)
-----


Jak wykonać takie zapytanie za pomocą SOAP?

POST /XMLWebService.asmx HTTP/1.1
Host: xml.qa.goglobal.travel
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?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>
<MakeRequest xmlns="http://www.goglobal.travel/">
<requestType>string</requestType>
<xmlRequest>string</xmlRequest>
</MakeRequest>
</soap12:Body>
</soap12:Envelope>

Próbowałem już różnych sposobów ale za chiny nie wiem jak wysłać np. takiego xmla aby otrzymać odpowiedź z listą hoteli

XML

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <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">
  3. <soap12:Body>
  4. <Root>
  5. <Header>
  6. <Agency>1520475</Agency>
  7. <User>PGHPOLXML</User>
  8. <Password>xxxxxx</Password>
  9. <Operation>HOTEL_SEARCH_REQUEST</Operation>
  10. <OperationType>Request</OperationType>
  11. </Header>
  12. <Main>
  13. <SortOrder>0</SortOrder>
  14. <FilterPriceMin>0</FilterPriceMin>
  15. <FilterPriceMax>10000</FilterPriceMax>
  16. <MaximumWaitTime>30</MaximumWaitTime>
  17. <MaxResponses>1000</MaxResponses>
  18. <FilterRoomBasises>
  19. <FilterRoomBasis></FilterRoomBasis>
  20. </FilterRoomBasises>
  21. <HotelName></HotelName>
  22. <CityCode>75</CityCode>
  23. <ArrivalDate>2014-05-06</ArrivalDate>
  24. <Nights>3</Nights>
  25. <Rooms>
  26. <Room Type="TWN" RoomCount="1" CotCount="0"></Room>
  27. </Rooms>
  28. </Main>
  29. </Root>
  30. </soap12:Body>
  31. </soap12:Envelope>


Teraz mam coś takiego

  1. $url = 'http://xml.qa.goglobal.travel/XMLWebService.asmx?WSDL';
  2. $client = new SoapClient($url, array('soap_version' => SOAP_1_2));
  3. var_dump($client->__getFunctions());


var_dump zwraca mi

array(4) { [0]=> string(86) "MakeRequestCompressedResponse MakeRequestCompressed(MakeRequestCompressed $parameters)" [1]=> string(56) "MakeRequestResponse MakeRequest(MakeRequest $parameters)" [2]=> string(86) "MakeRequestCompressedResponse MakeRequestCompressed(MakeRequestCompressed $parameters)" [3]=> string(56) "MakeRequestResponse MakeRequest(MakeRequest $parameters)" }

chciałbym teraz użyć funkcji MakeRequest do wykonania zapytania XML z poprzedniego posta. Jak to ogarnąć?

Ten post edytował ostrylg 6.03.2014, 21:57:33
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 7.10.2025 - 12:45