[ Milos911 @ 06.08.2016. 16:40 ] @
Totalno sam nov kad je SOAP u pitanju, pa ne zamerite ako kazem nesto totalno pogresno. Treba da komuniciram sa nekim serverom, i ovo mi je dato kao promer zahteva koji bih trebao da posaljem: Code: <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: Code: $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: Code: 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: Citat: To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax: 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 |