NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
calling webservice getting error-please help me


Joined: 03 Sep 2007
Posts: 1
Reply with quote
Hi guyz,
I am facing problem when i am calling .net webservice in PHP. the webservice is as follows..

http://localhost/A1W/custinfo.soap?wsdl -- this is .net webservice

This websrvice takes some input and gives some output parameters. parameters is as follows...

Input parameters

Parameter name : Description

string sCode : Code to be passed
string sStaffID : StaffID
string sType : customer Type
string sName : customer name
string sAddress1 : Customer First Addresss
string sTelephone1 : Telephone

Output Parameters

Parameter name : Description

String CustomerID : CustomerID
String UserID : User Name
String Password : Password


My PHP code is as follows..::

require_once('include/lib/nusoap.php');
$client = New soapclient('http://localhost/A1W/custinfo.soap?wsdl');
$params=array(
'sCode'=>'9999',
'sStaffID'=>'9999',
'sType'=>'I',
'sName'=>'NAG',
'sAddress1'=>'US',
'sTelephone1'=>'242244'
)
$result=$client->call('NewCustomer',$params,'http://localhost/A1W');

echo($result);


When i am running this code giving error as "Response not of type text/xml". Please tell me where i am wrong. help me.. I found in mnay sites they r calling webservice like this only.. but i don't know y i am getting error..

Thanks in Advance,
nag.
View user's profileFind all posts by nagendraSend private message
echo


Joined: 30 Oct 2007
Posts: 2
Reply with quote
you can't do echo or print for output. output has to be valid xml.
View user's profileFind all posts by praxedisSend private message
Re: calling webservice getting error-please help me


Joined: 16 Jul 2007
Posts: 9
Reply with quote
nagendra wrote:
When i am running this code giving error as "Response not of type text/xml".


Negendra, the nusoap client->call() function does not return raw xml. The library converts returning XML from the soap envelope into a php array and the return variable is assigned the results. If your webservice call had any error resulting in a soap fault, that too is returned from the call as a php array.

phpEd has a debugger included, use it to view the results returned from the 'call()' function. If you see an array, with the three values you described as expected output, then your call was successful.
Smile
View user's profileFind all posts by bob_bharrisSend private message
calling webservice getting error-please help me
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic