logo       

Re: Problem consuming dot net webservice usign nusoap: msg#00046

php.nusoap.general

Subject: Re: Problem consuming dot net webservice usign nusoap

Hi Scott,
 
Thanks for finding time and replying.
I am still facing the same problem.
 
I am getting the message
Array ( [faultcode] => soap:Client [faultstring] => The request element <GetMsg xmlns='http://tempuri.org'> was not recognized. [detail] => )
 
Can u plz go through my code (its a small one) and tell me exactly where I'm going wrong and also the soln to it.
 
 

require_once("nusoap.php");

$wsdl="http://localhost/GreetingService/Service1.asmx?wsdl";
$client=new soapclient($wsdl,"wsdl");

$param=array(
'abc'=>'Hello'
);

$resp=$client->call('GetMsg',$param);
print_r($resp);

I also tried making the call as :

$resp =$client->call('GetMsg', array('parameters' => $param));
print_r($resp);

But still getting the same error message


My WebMethod code is :
<WebMethod()> _
Public Function GetMsg(ByVal abc As String) As String
Dim Text As String
Dim sr As StreamWriter
sr = File.CreateText("E:\Amol\test\Webservicetest.txt")
sr.Write("<Start>")
sr.Write(abc)
sr.Write("<End>")
sr.Close()
sr = Nothing
Return "Sucessful"
End Function

 
 
 
Regards
Amol Dalvi
 
 
You are not passing parameters correctly from your PHP code.  First, parameters to
$client->call must be in an array.  As such, a more typical call would be

     $params = array("abc" => "Test");
     $resp = $client->call("GetMsg", $params);

However, unless you explicitly specify otherwise, a .NET method will use document/literal
instead of rpc/encoded SOAP.  For document/literal, the method parameters are wrapped in an
additional element that .NET names "parameters".  Your could would look like

     $params = array("abc" => "Test");
     $resp = $client->call("GetMsg", array("parameters" => $params));

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message -----
From: "Amol Dalvi" < amol.007@xxxxx>
To: <nusoap-general@xxxxx>
Sent: Tuesday, April 12, 2005 1:46 AM
Subject: [Nusoap-general] Problem consuming dot net webservice usign nusoap.
 
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise