Treba da komuniciram sa nekim serverom, i ovo mi je dato kao promer zahteva koji bih trebao da posaljem:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"
xmlns:rad="http://schemas.datacontract.or...07/Radixx.ConnectPoint.Request"
xmlns:rad1="http://schemas.datacontract.or....ConnectPoint.Security.Request">
<soapenv:Header/>
<soapenv:Body>
<tem:RetrieveSecurityToken>
<!--Optional:-->
<tem:RetrieveSecurityTokenRequest>
<rad:CarrierCodes>
<!--Zero or more repetitions:-->
<rad:CarrierCode>
<rad:AccessibleCarrierCode>FZ</rad:AccessibleCarrierCode>
</rad:CarrierCode>
</rad:CarrierCodes>
<rad1:LogonID>xxx</rad1:LogonID>
<rad1:Password>xxxx</rad1:Password>
</tem:RetrieveSecurityTokenRequest>
</tem:RetrieveSecurityToken>
</soapenv:Body>
</soapenv:Envelope>
Php koji sam ja pisao izgleda ovako:
$url = "http://xxxx?wsdl";
$data = array( "LogonID"=>"xxxxx", "Password"=>"xxxxx");
$client = new SoapClient($url);
$client->__soapCall("RetrieveSecurityToken", $data);
Puca mi kod ove linije gde pozivam funkciju RetrieveSecurityToken sa greskom:
The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message
for operation 'RetrieveSecurityToken'. End element 'Body' from namespace 'http://schemas.xmlsoap.org/soap/envelope/' expected.
Found element 'param1' from namespace ''. Line 2, position 162. in J:\WORK\web\xxx\index.php:25 Stack trace: #0 J:\WORK\web\xxx\index.php(25):
SoapClient->__soapCall('RetrieveSecurit...', Array)
#1 {main} thrown in J:\WORK\web\xxxi\index.php on line 25`
Tamo na serveru na koji se kacim ($url), kad otvorim stranicu bez "?wsdl", imam sledeci opis:
svcutil.exe http://xxx.svc?wsdl
You can also access the service description as a single file:
http://.svc?singleWsdl
Totalno sam pogubljen kako i sta, cenim da nisam dobro napisao ovaj $data array.
Pa ako moze neko da me uputi u pravom smeru i kaze mi gde gresim, bilo bi super