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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:13:23+00:00 2026-05-28T13:13:23+00:00

i must provide a function via SOAP which is called echo. I don’t know

  • 0

i must provide a function via SOAP which is called “echo”. I don’t know how to do this because echo is already resevered by PHP. Is there any way?

BTW: I can’t use rename_function or override_function. Pecl-Apd isn’t available at the system.

Here is some code-stuff:

PHP:

$soap_server = new SoapServer('service.wsdl');
$soap_server->setClass('TestClass');

$soap_server->handle();

from the service.wsdl:

<message name="echo">
    <part name="parameters" element="tns:echo"/>
  </message>

[...]

<portType name="MyService">
[...]
<operation name="echo">
      <input message="tns:echo"/>
      <output message="tns:echoResponse"/>
    </operation>
[...]
</portType>
<binding name="MyServicePortBinding" type="tns:MyService">
[...]
<operation name="echo">
      <soap:operation soapAction="urn:ping"/>
      <input>
        <soap:body use="literal"/>
      </input>
      <output>
        <soap:body use="literal"/>
      </output>
    </operation>
[...]
</binding>

The SOAP-Client isn’t under my control. I must implement the given wsdl-file. But in my class always “echo” get called not “ping” and results in the error message PHP Fatal error: Function 'echo' doesn't exist in <file-path-and-name>.

My TestClass looks like this:

<?php

ini_set("soap.wsdl_cache_enabled", "0");

class TestClass {

  public function __construct()
  {

  }

  [...]

  public function ping($inputString)
  {
     return $inputString;
  }

}
?>
  • 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-28T13:13:24+00:00Added an answer on May 28, 2026 at 1:13 pm

    Finally I solved the problem using a Proxy Class:

    class MySoapProxy
    {
      public function __call($methodName, $args) {
        if($methodName == "echo") $methodName = "ping";
        $soapClass = new TestClass();
        $result = call_user_func_array(array($soapClass, $methodName),  $args[0]);
        return array($methodName . 'Result' => $result);
      }
    }
    

    My TestClass:

    class TestClass {
    
      [...]
    
      public function ping($inputString)
      {
         return $inputString;
      }
    
    }
    

    And the SoapServer looks like this:

    $soap_server = new SoapServer('myservice.wsdl');
    $soap_server->setClass('MySoapProxy');
    
    $soap_server->handle();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Example: I have a class called ParentClass. ParentClass has a constructor like this: function
An ASP.NET 3.5 app with SQL Server 2005 must provide single sign on on
Must Support IE6 and must Validate vs XHTML Strict 1.0! This is tricky to
I must implement a web service which expose a list of values (integers, custom
This must be a classic .NET question for anyone migrating from Java. .NET does
I must generate a random number using boost libraries, I use this code: boost::mt19937
I have the following JS which compares credit card number length: validate: function ()
Why must I provide explicitly generic parameter types While the compiler should infer the
I'm currently writing a header-only wrapper library which is supposed to provide C++ access
I've written a function that takes a data.frame which represent intervals of data which

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.