Answer the question
In order to leave comments, you need to log in
Authorization via soap?
There is a soar service, in it a wsdl document, I access this document through soapUI and see a list of its methods, when I select the method I need, I get xml:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:out="http://realobs.com/service/outgoing2">
<soapenv:Header/>
<soapenv:Body>
<out:hotelSearchStep1Request outOperatorIncID="?" dateFrom="?" nightsDuration="?" availableOnly="?">
<out:persons adults="?">
<out:childAges/>
</out:persons>
<out:locationIds>
<!--Zero or more repetitions:-->
<out:long>?</out:long>
</out:locationIds>
<!--Optional:-->
<out:hotelIds>
<!--Zero or more repetitions:-->
<out:long>?</out:long>
</out:hotelIds>
<!--Optional:-->
<out:hotelServices>
<!--Zero or more repetitions:-->
<out:long>?</out:long>
</out:hotelServices>
</out:hotelSearchStep1Request>
</soapenv:Body>
</soapenv:Envelope>
Answer the question
In order to leave comments, you need to log in
What exactly to emulate? PHP working with SOAP? So there are special functions and classes: fi2.php.net/manual/en/class.soapclient.php
In general, SoapUI has an "http log" button at the bottom, which shows all outgoing and incoming requests. And in the service you specified, WS-authorization is used. It is implemented in the xml head like this:
$login="login";
$password="pass";
$xml='<soapenv:Envelope xmlns:out="http://realobs.com/service/outgoing2" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header><wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><wsse:UsernameToken><wsse:Username>'.$login.'</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></soapenv:Header>
<soapenv:Body>
<out:hotelSearchStep1Request outOperatorIncID="?" dateFrom="?" nightsDuration="?" availableOnly="?">
<out:persons adults="?">
<out:childAges/>
</out:persons>
<out:locationIds>
<!--Zero or more repetitions:-->
<out:long>111756</out:long>
</out:locationIds>
<!--Optional:-->
<out:hotelIds>
<!--Zero or more repetitions:-->
<out:long>?</out:long>
</out:hotelIds>
<!--Optional:-->
<out:hotelServices>
<!--Zero or more repetitions:-->
<out:long>?</out:long>
</out:hotelServices>
</out:hotelSearchStep1Request>
</soapenv:Body>
</soapenv:Envelope>';
$c=new SoapClient("http://test.bestoftravel.cz:8080/booking/public/ws/searchHotel.wsdl");
$resp=$c->__doRequest($xml,"http://test.bestoftravel.cz:8080/booking/public/ws/searchHotel","hotelSearchStep1","1.1");
echo $resp;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question