Page 1 of 1

[Solved]SOAP Request

Posted: Mon Feb 26, 2007 5:04 am
by dude81
I need to set the following headers

Code: Select all

POST /io_query/queryservice.aspx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: lengthofstring
SOAPAction: "http://teuri.org/queryservice"
before the soap body. How do I do this with soap client class. I need to use soap client class only. I'm unable to send and take a request back. Kindly help

Thanks in advance

Posted: Mon Feb 26, 2007 10:27 am
by pickle
I'm not sure what soap client class you're using. A link to the source code/tutorial pages would be helpful. To be honest, I don't know a whole lot about SOAP so I personally won't be able to help, but some more information would help others I'm sure.

Posted: Mon Feb 26, 2007 11:01 am
by dude81
I'm using a simple SOAP-PHP5 client class available in PHP5. I cannot use new classes written by many because I've a restriction.

1)Firstly I've an API developed by other team within internal network available in some other location.
They have provided me an several API functions of which I need to use atleast one for first short. All the API's wsdl is written in one wsdl file .(Cannot provide any information of wsdl file details,I've a limitation on that too ).
2)The API function requires an xml string(which is also given) in which I'll be embedding two of the XML param values.
3)Along with the xmlstring I need to send headers as required by the API.
4)The xml string and soap headers use an internal namespace for an internal IP (I doubt this is the culprit killing all my code, but not sure of it).
I used soapClient->_Call(), soapClient->_doRequest(); not sure they are used in right fashion or not

Code: Select all

//Note class is declared above
$client->__soapCall('Getresult',  array(new SoapParam('1 4','user_ids'), new SoapParam('23','server_id')), array('uri'=>'http://uri.org','soapaction'=>'http://uri.org/GetResult')
using client->__doRequest

Code: Select all

$client->__doRequest($string,'http://192.1.1.1/Service/Service.aspx?va=GetResult','http://uri.org/GetResult','1.1')

Posted: Mon Feb 26, 2007 11:50 am
by volka
dude81 wrote:I'm using a simple SOAP-PHP5 client class available in PHP5.
That is the php5 soap extension, http://de2.php.net/soap ?

try

Code: Select all

<?php
$client = new SoapClient('http://www.webservicex.net/geoipservice.asmx?WSDL');
$response = $client->GetGeoIP(array('IPAddress'=>'88.72.14.195'));
$georesult = $response->GetGeoIPResult;

echo "<pre>\n";
echo $georesult->IP, "\n";
echo $georesult->CountryName, "\n";
echo "</pre>\n";
?>

Posted: Mon Feb 26, 2007 9:15 pm
by dude81
I've tried this volka, but my service provider asks me to send some headers also. It returned a blank object.
I think becuase I didnt send the headers.

Posted: Mon Feb 26, 2007 9:36 pm
by dude81
:P :P :P SOLVED..My mistake :roll: . I didn't pass the param variable name right

Thanks volka, The thing you posted is what I searched for whole ONE day, I think it needs to be documented or a tutorial on it somewhere in the forum. About SOAP Client usage and SOAP Server Usage. Its not available much on the net.


thanks to all