Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8484853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:29:10+00:00 2026-06-10T20:29:10+00:00

I have a PHP web service with NuSOAP i have a complex type then

  • 0

I have a PHP web service with NuSOAP i have a complex type then same as another post on stack see below:

#SERVER    
$server->wsdl->addComplexType('User',
'complexType','struct', 'all', '',
array(  'id' => array('name' => 'id', 'type' => 'xsd:int'),
    'username' => array('name' => 'username','type' => 'xsd:string'),
    'password' => array('name' => 'password','type' => 'xsd:string'),
    'email' => array('name' => 'email','type' => 'xsd:string'),
    'authority' => array('name' => 'authority','type' => 'xsd:int'),
    'isActive' => array('name' => 'isActive','type' => 'xsd:int'),
    'area' => array('name' => 'area','type' => 'xsd:string')
)
);
$server->register('ws_getUser',
    array('user_id' => 'xsd:integer'),
    array('user' =>  'tns:User'),
    $namespace,
    "$namespace#ws_getUser",
    'rpc',
    'encoded',
    'Retorna un usuario'
);

function ws_getUser($user_id){
    return new soapval('return', 'tns:User', getUser($user_id));
}

#CLIENT
require_once('./classes/nusoaplib/nusoap.php');
$client = new soapclient('http://localhost/api.php?wsdl');
$result = $client->__call('ws_getUser', array('id' => '1', 'username' => 'user', 'password' => 'pass', 'email' => 'user@email.co.za', 'authority' => '1', 'isActive' => '1', 'area' => 'usa'));

// Display the result
var_dump($result);

But i keep getting errors from the service i have tried a lot of different type of changes to the complex type but keep getting the same errors.

ERROR

Fatal error: Uncaught SoapFault exception: [Client] looks like we got no XML document in C:\wamp\www\api.php:26 Stack trace: #0 C:\wamp\www\api.php(26): SoapClient->__call(‘ws_getUser’, Array) #1 {main} thrown in C:\wamp\www\api.php on line 26

Im using wamp with PHP 5.4.3 and Nusoap library 0.9.5
If anyone can tell me what the problem is
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T20:29:11+00:00Added an answer on June 10, 2026 at 8:29 pm

    I figured it out using wamp i enabled soap extensions and every time i registered the client or server it found the classes for the default soap instead of nusoap

    CORRECT
    $client = new nusoap_client(‘http://localhost/nusoap/server.php?wsdl’);
    INCORRECT
    $client = new soapclient(‘http://localhost/nusoap/server.php?wsdl’);

    same with the servers.

    The php error i receive was because of this as well as it is not formatted in the correct way. Normal soap ext returns it as a stdClass.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP web service built with the NuSOAP library. I've adapted the
I have a PHP web service that I am building. I can for see
i have a web service developed with PHP bith (client and server ) using
i have created a simple web service using Php Nusoap. its working correctly but
I have a php web service that takes the request from android/iphone app and
I have created a RESTful PHP web service using Lithium which contains comments, each
I have an iOS app sending requests to a PHP based web service ,
I have a web service, defined(WSDL) and implemented in PHP. This one is relatively
So I have a PHP Soap service that is running nusoap and I am
Can any body have idea how to consume php soap web service that have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.