note 62388 added to ref.soap
| From: | Raghuraman at osu1 dot php dot net | Date: | Mon, 27 Feb 2006 16:36:41 +0000 |
| Subject: | note 62388 added to ref.soap | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-104496@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 203.199.107.94
Probable Submitter: 59.145.145.27
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/ref.soap.php
Edit -- http://master.php.net/note/edit/62388
Del: integrated -- http://master.php.net/note/delete/62388/integrated
Del: useless -- http://master.php.net/note/delete/62388/useless
Del: bad code -- http://master.php.net/note/delete/62388/bad+code
Del: spam -- http://master.php.net/note/delete/62388/spam
Del: non-english -- http://master.php.net/note/delete/62388/non-english
Del: in docs -- http://master.php.net/note/delete/62388/in+docs
Del: other reasons-- http://master.php.net/note/delete/62388
Reject -- http://master.php.net/note/reject/62388
Search -- http://master.php.net/manage/user-notes.php