note 62388 deleted from ref.soap by nlopess
| From: | nlopess@php.net | Date: | Mon, 27 Feb 2006 16:38:05 +0000 |
| Subject: | note 62388 deleted from ref.soap by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-104497@lists.php.net to get a copy of this message | ||
Note Submitter: Raghuraman
----
Hi,
I am trying to consume a WS with PHP 5.1.2 using native soap implementation. I am quite to new to
webservice with PHP. In doing so, i face an exception message, can someone correct me or tell me
what should i do to make this executable.
Also It would be great if someone has a link or example to showcase how to pass/receive objects
while consuming a service with PHP from a provider which is based on .NET or Java.
My wsdl section:
<s:complexType name="Credential">
<s:sequence/>
</s:complexType>
<s:complexType name="EnterpriseCredential">
<s:complexContent>
<s:extension base="s0:Credential">
<s:sequence/>
<s:attribute name="Login" type="s:string" use="required"/>
<s:attribute name="Password" type="s:string" use="optional"/>
</s:extension>
</s:complexContent>
</s:complexType>
<s:element name="login">
<s:complexType>
<s:sequence>
<s:element name="credential" type="s0:Credential"/>
</s:sequence>
</s:complexType>
</s:element>
My Client code:-
$wsdl = "path_2_wsdl";
$client = new SoapClient($wsdl);
$loginCredential = array( "login" => "QA", "password" =>
"QA");
$es = new SoapVar($loginCredential, XSD_ANYTYPE , "Credential", "session");
$param = new SoapParam($es,"Login");
$result = $client->login($es);
It throws following exception
Notice: Undefined property: SoapFault::$faultstring in Unknown on line 0
Fatal error: Uncaught SoapFault exception: [soapenv:Server.generalException] (null) in C:\Program
Files\Apache Group\Apache2\htdocs\webservice\index.php:12 Stack trace: #0 [internal function]:
SoapClient->__call('login', Array) #1 C:\Program Files\Apache
Group\Apache2\htdocs\webservice\index.php(12): SoapClient->login(Object(SoapVar)) #2 {main}
thrown in C:\Program Files\Apache Group\Apache2\htdocs\webservice\index.php on line 12
Any feedback or help is always helpful.