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 9089703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:12:29+00:00 2026-06-16T22:12:29+00:00

I have a working webService using NuSOAP. Now, I have to make a validation

  • 0

I have a working webService using NuSOAP. Now, I have to make a validation before returning the data requested. If everything is ok, I return it normally, otherwise I would like to return a String message explaining why I’m not giving the information requested. Problem is that I can’t get to add two different types of return to RegisterFunction of NuSOAP. If I add a ComplexType as return, I can’t return a String.

  • 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-16T22:12:29+00:00Added an answer on June 16, 2026 at 10:12 pm

    The function can’t have two return-values. You should add the error-message-string to your complex type. If you don’t wanna touch your complex type, then you should create another
    complex type wich contains your datatype and a string.

    Example – the complex type you have right now:

    $server->wsdl->addComplexType('myData','complexType','struct','all','',
        array(  'important'  => array('name' => 'important','type' => 'xsd:string'),
                'stuff'      => array('name' => 'stuff','type' => 'xsd:string')
        )
    );
    

    the extra complex type:

    $server->wsdl->addComplexType('package','complexType','struct','all','',
        array(  'data'      => array('name' => 'data','type' => 'tns:myData'),
                'errormsg'  => array('name' => 'errormsg','type' => 'xsd:string')
        )
    );
    

    registration of the function:

    $server->register(
                    'getData',     
                    array('validation'=>'xsd:string'), 
                    array('return'=>'tns:package'),
                    $namespace,
                    false,
                    'rpc',
                    'encoded',
                    'description'
    );
    

    the function:

    function GetData($validation)
    {
        if($validation == "thegoodguy") {
            $result['data'] = array(
                "important"    => "a top secret information",
                "stuff"        => "another one"
            );
            $result['errormsg'] = null;
        } else {
            $result['data'] = null;
            $result['errormsg'] = "permission denied!";
        }
        return $result;
    }
    

    That way the client could try to analyse the received data and if it is null then he
    shows up the errormessage.

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

Sidebar

Related Questions

I have web service urls that were working fine and are now returning the
I have a list of objects that I return using webservice. And I try
i have created a simple web service using Php Nusoap. its working correctly but
I'm using NLog to record my logging, everything is working fine, but now I
I have a webservice that produce XML result. I have been working on this
I am working with the iPhone SDK and I have to process a webservice
Im working on a Web-Application (MyWebApp). I have a Service-Reference to a WCF-Webservice. The
Using Visual Studio 2008 and VB.Net: I have a working web app that uses
I'm building a REST webservice in Java using Spring, Jersey and Hibernate (JPA). Now
I am working on a project to call a webservice from different domain using

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.