Page 1 of 1

Create a Webservice using nusoap

Posted: Tue Aug 28, 2007 10:05 am
by navinkumarank
Hi all,
I am new to Webservices and am trying to create Webservice using nusoap. I tried a simple example code provided in the internet - but the same throws the following error.

Fatal error: Cannot redeclare class soapclient in C:\xampp\htdocs\test_webservice\nusoapprogwsdl\lib\nusoap.php on line 7240

Any help in this regards... Please.....


Regards,
Navin

Posted: Tue Aug 28, 2007 10:11 am
by Zoxive
Sounds like you are including the class twice, try include_once, or remove one of the two includes.

Posted: Tue Aug 28, 2007 10:33 am
by navinkumarank
I am using " require_once('lib/nusoap.php'); " in my client php file.

but I am not sure where exactly I have to make change in "nusoap.php" because it is a famous class used... and I think there might not be any problem in that class file.

The client codes which I downloaded and used are from this URL http://www.scottnichol.com/nusoapintro.htm

Hope you will get an Idea if you see this above URL...

Note: If you have done some webservices in php can you help me out how to create a webservice in php and manipulate that ?


Regards,
Navin

Re: Create a Webservice using nusoap

Posted: Tue Aug 28, 2007 10:51 am
by Steve Mellor
navinkumarank wrote:Fatal error: Cannot redeclare class soapclient in C:\xampp\htdocs\test_webservice\nusoapprogwsdl\lib\nusoap.php on line 7240
That makes me think it's a problem in one of the class files. Either that or; do you have over 7000 lines of code?

Posted: Tue Aug 28, 2007 11:05 am
by anjanesh
navin - SoapClient is a built-in class that exists in PHP5 (when php is compiled with --enable-soap). This is conflicting with nuSOAP's soapclient class (case doesnt matter in PHP).
You dont require nuSOAP anymore.

Problem with <complexType> while using Nusoap

Posted: Mon Sep 03, 2007 12:13 pm
by navinkumarank
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


hi,
           I am now able to create a Webservice using "Nusoap" but I am facing problems while trying to create a Webservice with the WSDL containing "[b]<complexType>[/b]".

       When I run the service using the client I get the following fault response..... And I am not sure what it represents....
 

       [syntax="xml"]

<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>
      <SOAP-ENV:Fault>
         <faultcode xsi:type="xsd:string">Server</faultcode>
         <faultactor xsi:type="xsd:string"/>
         <faultstring xsi:type="xsd:string">unable to serialize result</faultstring>
         <detail xsi:type="xsd:string"/>
      </SOAP-ENV:Fault>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

     
any help in this regards please.....

Regards,
Navin


feyd | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]