note 110031 added to book.soap

From: Date: Thu, 13 Sep 2012 14:13:49 +0000
Subject: note 110031 added to book.soap
Groups: php.notes 
Request: Send a blank email to php-notes+get-190716@lists.php.net to get a copy of this message
I am having a problem figuring out how to encapsulate messages for transmission, I think the issue is that the server is requiring a nested object inside of the request that gives authentication details, but I cannot figure out how to adapt the code above to make this nested object go over using SoapVar... here is my original code.. if someone can show me how to do this using SoapVar or SoapParam I would be very appreciative: <?php // SET PARAMETERS ... //CREATE OBJECT FOR SOAP TRANSMISSION $authInfo = array( 'username' => (string)$username, 'password' => (string)$password, 'appKey' => (string)$appkey, 'version' => (string)$version); $proxRequest = array( 'lat' => (float)$lat, 'lon' => (float)$lon, 'range' => (float)$range, 'unit' => (string)$unit, 'authInfo' => $authInfo); // PERFORM SOAP REQUEST $wsdURL = "http://xxxxxxxxxxxx.com/soap?wsdl&v=".$version $client = new SoapClient($wsdURL, array('trace' => true)); $result = $client->fccGetProxCallsigns($proxRequest); // DEBUG: display the XML sent from the request, along with the resulting object returned by the server. // NOTE: Code never makes it this far, authentication failure when the actual query is made causes PHP script to crash in the above line... receiving server claims no authentication data was sent. However there is no error when creating the SoapClient and reading the description file. echo "REQUEST:\n" . htmlentities($client->__getLastRequest()) . "\n"; var_dump($result); ?> here is the original xsd description: <message name="fccGetProxCallsignsRequest"> <part name="lat" type="xsd:decimal"/> <part name="lon" type="xsd:decimal"/> <part name="range" type="xsd:decimal"/> <part name="unit" type="xsd:string"/> <part name="authInfo" type="tns:authInfo"/> </message> <xsd:complexType name="authInfo"> <xsd:all> <xsd:element name="username" type="xsd:string"/> <xsd:element name="password" type="xsd:string"/> <xsd:element name="appKey" type="xsd:string"/> </xsd:all> </xsd:complexType> ---- Server IP: 69.147.83.197 Probable Submitter: 24.146.194.181 ---- Manual Page -- http://www.php.net/manual/en/book.soap.php Edit -- https://master.php.net/note/edit/110031 Del: integrated -- https://master.php.net/note/delete/110031/integrated Del: useless -- https://master.php.net/note/delete/110031/useless Del: bad code -- https://master.php.net/note/delete/110031/bad+code Del: spam -- https://master.php.net/note/delete/110031/spam Del: non-english -- https://master.php.net/note/delete/110031/non-english Del: in docs -- https://master.php.net/note/delete/110031/in+docs Del: other reasons-- https://master.php.net/note/delete/110031 Reject -- https://master.php.net/note/reject/110031 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#190716) next »