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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T10:51:07+00:00 2026-06-09T10:51:07+00:00

I am making a php/c# console app/c# soap service and I have created many

  • 0

I am making a php/c# console app/c# soap service and I have created many functions within the web service, but I am unable to call one of them.

The function I am calling is a function which gets a string value from the database. The call works fine on Windows (using localhost) but when putting it onto a Linux server running under mono I get an exception stating the following:

Function (“getLastResetTime”) is not a valid method for this service

The strange this is though, from the Linux server I can access the test form by going to asmx file and run the getLastResetTime function and it returns what is expected, it just seems to be the PHP that can’t make the call.

Below is the code that I am using in PHP to call the script

function getLastResetTime()
{
    include ("../../config.php");
    include ("../../includes/get-settings.php");
    include ("../../includes/general.php");
    try
    {
    $client = new SoapClient("http://192.168.1.74/EmailServer/EmailSoapService/EmailSoapService.asmx?WSDL", array("trace" => 1, "exception" => 0));
    $result = $client->__soapCall("getLastResetTime", array());

    echo "Last Reset: " . $result->getLastResetTimeResult;
    }
    catch (Exception $e)
    {
        echo $e->getMessage();
    }
}

The screenshot below proves that the web method is working under Mono and what it returns

enter image description here

Below is the code of the web service function

[WebMethod(Description = "Gets the time the Email Server last reset")]
public string getLastResetTime()
{
    SoapHandler soapHandler = new SoapHandler();
    return soapHandler.getLastResetTime();
}

and below is the code that the web service calls

public string getLastResetTime()
{
    try
    {
        using (ConnectDb db = new ConnectDb(appSettings))
        {
            string query = "SELECT * FROM settings";
            using (MySqlCommand cmd = new MySqlCommand(query, db.conn))
            {
                using (MySqlDataReader reader = cmd.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        if (reader.GetString("setting") == "app_lastRestart")
                        {
                            return reader.GetString("value");
                        }
                    }
                }
            }
        }
        return "N/A";
    }
    catch (MySqlException ex)
    {
        return ex.Message;
    }
}

I don’t understand why this isn’t working, I’m guessing I’ve probably missing something really simple but can’t find it.

Thanks for any help you can provide.

  • 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-09T10:51:08+00:00Added an answer on June 9, 2026 at 10:51 am

    I’ve just found out the reason, but I don’t understand why this doesn’t affect the methods.

    Basically, I was setting the WSDL to be the IP Address of the server (even though it was local to the server) so I was putting http://192.168.1.74/MySoapService.asmx but if I change it to http://localhost/MySoapService.asmx it works fine.

    Why would I need to make it localhost instead of IP address for these services to work.

    Is it because I am running several soap requests one after the other so the browser is stopping it, I did notice while I was trying to work out the problem, that Chrome was stating that it was throttling, if this is the issue then I would have thought the connection would time out, not say that the service is invalid.

    UPDATE
    I’ve now found out why changing the url from the IP to localhost fixed the issue, I realised as another function started having the same problem and later realised that php by default caches the wsdl, if this option is disabled in the php.ini file and restart the apache server, it then works fine. Probably quite useful in a production environment but a bit of a pain when development.

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

Sidebar

Related Questions

I am making an ajax call in jquery $.get(validate_isbn.php, {isbn: obj[16]}, function(answer) { console.log(answer);
I'm making a php file that will run an event after five minutes have
i am trying to making php ajax based chat system....and i have developed it
There are many scenarios where I've questioned PHP's performance with some of its functions,
I'm making a PHP script where I use a class boolean variable, but for
I am making a PHP web Application in which i am using MySQL as
As in title, I am making a PHP-Based intranet application Call center, I've finished
I'm making Torrent PHP Crawler and I have problem, here's my code: // ...
I'm making a php web application which stores user specific information that is not
I'm having hard time consuming a secure WCF Web Service from a PHP site.

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.