Create a Webservice using nusoap

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
navinkumarank
Forum Newbie
Posts: 6
Joined: Thu Apr 05, 2007 8:52 am

Create a Webservice using nusoap

Post 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
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Post by Zoxive »

Sounds like you are including the class twice, try include_once, or remove one of the two includes.
User avatar
navinkumarank
Forum Newbie
Posts: 6
Joined: Thu Apr 05, 2007 8:52 am

Post 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
Steve Mellor
Forum Commoner
Posts: 49
Joined: Thu Aug 02, 2007 8:18 am

Re: Create a Webservice using nusoap

Post 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?
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post 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.
User avatar
navinkumarank
Forum Newbie
Posts: 6
Joined: Thu Apr 05, 2007 8:52 am

Problem with <complexType> while using Nusoap

Post 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]
Post Reply