Hello, I have the following problem...
I'm trying to use a SOAP service ... and i made the following client code using nusoap :
$fono=312232322;
$name="Test";
include("lib/nusoap.php");
$soapclient = new soapclient("http://webservices.telemigcelular.com.br/SrvWapPush/SrvWapPush.asmx");
$params = array("Telefone"=>$fono,"Mensagem"=>$name,"Url"=>"http://games.telemig.andinatech.com/?m=sms&i=$id");
$namespace = "http://webservices.telemigcelular.com.br/srvWapPush";
$result= $soapclient->call('SendPush',$params,$namespace,"http://webservices.telemigcelular.com.br/srvWapPush/SendPush"); //array("soapaction"=>"http://webservices.telemigcelular.com.br/srvWapPush/SendPush")
print "$soapclient->request --- $soapclient->response ";
this is the formed REQUEST:
POST /SrvWapPush/SrvWapPush.asmx HTTP/1.0
Host: webservices.telemigcelular.com.br
User-Agent: NuSOAP/0.7.2 (1.94)
Content-Type: text/xml; charset=ISO-8859-1
SOAPAction: "http://webservices.telemigcelular.com.br/srvWapPush/SendPush"
Content-Length: 694
<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1212:SendPush xmlns:ns1212="http://webservices.telemigcelular.com.br/srvWapPush"><Telefone xsi:type="xsd:string">3197641500</Telefone><Mensagem xsi:type="xsd:string">Space Massacre</Mensagem><Url xsi:type="xsd:string">http://games.telemig.andinatech.com/?m=sms&i=435</Url></ns1212:SendPush></SOAP-ENV:Body></SOAP-ENV:Envelope>
and this is the RESPONSE:
HTTP/1.1 500 Internal Server Error.
Server: Microsoft-IIS/5.0
Date: Tue, 09 Aug 2005 20:50:23 GMT
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Content-Length: 488
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Server was unable to process request. --> Object reference not set to an instance of an object.</faultstring>
<detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>
in the docs about the use of this service the request appears as <soap: ... > not <soap-env: ...>
and <SendPush xmlns= ....> not <ns1212:SendPush xmlns=...>
I dont know if this has something to do with the error...."Object reference not set to an instance of an object", but keeps going...
The service is up and running... i know the problem is in my client...
maybe there is another way to use SOAP with php...
please help me!!!!
PD: According to my docs, this should be the Request:
POST /SrvWapPush/SrvWapPush.asmx HTTP/1.1
Host: webservices.telemigcelular.com.br
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://webservices.telemigcelular.com.br/srvWapPush/SendPush"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<SendPush xmlns="http://webservices.telemigcelular.com.br/srvWapPush">
<Telefone>string</Telefone>
<Mensagem>string</Mensagem>
<Url>string</Url>
</SendPush>
</soap:Body>
</soap:Envelope>