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

  • SEARCH
  • Home
  • 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 6587657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:56:43+00:00 2026-05-25T16:56:43+00:00

I’m writing a web service using NuSOAP in PHP. To test it, I have

  • 0

I’m writing a web service using NuSOAP in PHP. To test it, I have written both a server and a client. On the server end, I register the function like so:

$server->register(
    "testFunction",
    array("param1" => "xsd:string", "param2" => "xsd:string"),
    array("result" => "xsd:string"),
    "http://localhost/testApp"
);

And on the client looks like this:

require_once("./lib/nusoap.php");

$client = new soapclient("http://localhost/testApp/server.php");
$function = $_GET["function"];
unset($_GET["function"]);
$result = $client->call($function, $_GET);

echo "<pre>". print_r($result, true) ."</pre>";

When I call it like

http://localhost/testApp/client.php?function=testFunction&param1=value1&param2=value2

it works fine, but if I switch param1 and param2 and say

http://localhost/testApp/client.php?function=testFunction&param2=value2&param1=value1

then param1 gets the value value2 and param2 gets the value value1. So obviously, it just goes by the order of the parameters, not the names.

I figured that since I registered the function with specific parameter names and then called the function, specifying those parameter names, that they would be assigned accordingly.

Am I missing something? What’s the point of specifying the parameter names if they will just be thrown out and assigned in whatever order you entered them? Is there a way to make it so that I can enter the parameters in any order and have them map correctly?

  • 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-05-25T16:56:44+00:00Added an answer on May 25, 2026 at 4:56 pm

    maybe go for a default map in the client:

        $default = array(
            'param1' => '',
            'param2' => 'test',
        );
        $params = $defaults;
        foreach ( $_GET as $param_name => $param_value ) {
            if ( isset( $params[ $param_name ] ) ) $params[$param_name] = $param_value;
        }
        $client->call( $function, $params );
    

    Simple hack, even though it doesnt “really” answer your questions.

    One note, the url you’re passing to the client MUST be a SOAP WSDL if you expect the client to know anything about the format of the calls being made. Is yours ? ( It’s been a long time I’ve used nuSoap, but i recall simply adding “?wsdl” param to the server url was enough to have the server respond with a valid wsdl )

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
That's pretty much it. I'm using Nokogiri to scrape a web page what has
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am writing an app with both english and french support. The app requests
I have thousands of HTML files to process using Groovy/Java and I need to
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't

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.