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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:56:14+00:00 2026-06-02T07:56:14+00:00

I want to execute remote function by using php soap.The web service is created

  • 0

I want to execute remote function by using php soap.The web service is created by using c# .net.There must be authentication in order to call remote function.I always get unauthorized error whenever i tried to call remote function.However,when i get content of web service by using wget like this

wget -c --user=my_username --password=my_password http://path/to/wsdl

and i got this output:

    --2011-02-09 09:55:10--  http://path/to/wsdl
Connecting to my_ip:80... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Reusing existing connection to my_ip:80.
HTTP request sent, awaiting response... 401 Unauthorized
Reusing existing connection to my_ip:80.
HTTP request sent, awaiting response... 200 OK
Length: 3300 (3.2K) [text/html]
Saving to: `my_webservice.asmx'

100%[====================================================================================================================================================================================================>] 3,300       --.-K/s   in 0.001s  

2011-02-09 09:55:11 (3.81 MB/s) - `my_webservice.asmx' saved [3300/3300]

When i use soap inorder to call remote function like this:

$connSoap = new SoapClient($WebServiceUrl, array('login' => $username, 
                                                 'password' => $password));
$requestOutput = $connSoap->GetVal (1, 1, 1);

I got this error:

SoapClient::SoapClient(http://path/to/wsdl): failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized

Any comments?

Thanks in advance

  • 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-02T07:56:16+00:00Added an answer on June 2, 2026 at 7:56 am

    I have found alternative way to do solve this problem

    I prepared and envelope xml and send request by using curl that has envelope as parameter.You can refer following code;

    $username = "";
    $password = "";
    $webServiceUrl = "";
    
    $xml = '<?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <RemoteMethod xmlns="http://your.service.url/">
          <parameter_1>your_paramter_1</parameter_1>
          <parameter_2>your_paramter_2</parameter_2>
          ........
          <parameter_n>your_parameter_n</parameter_n>
        </RemoteMethod>
      </soap:Body>
    </soap:Envelope>';
    
    
    $ch = fopen("envelope.xml", "w");
    fwrite($ch, $xml);
    
    $cmd = 'curl -d @envelope.xml -H "Content-Type: text/xml;charset=UTF-8 " --user ' . $username . ':'.$password.' --ntlm ' . $webServiceUrl . ' > requestResult.xml';
    shell_exec($cmd);
    fclose($ch);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing an ASP.NET web service using C# that has a DoLookup() function. For
I have asp.net generated html code. I want execute jQuery click function when user
I want to execute a php-script from php that will use different constants and
I want to execute a function on all the objects within a List of
I want to execute a batch file from a java program. I am using
I am using Expect in perl to connect to remote machine and execute certain
I want to build a chat system in nodeJs + MYSQL using php. It
I am trying to execute remote commands from within a php script over ssh,
The following example is taken from: http://php.net/manual/en/function.curl-multi-close.php#example-3540 This example will create two cURL handles,
I want to execute something in a linux shell under a few different conditions,

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.