1

Sample Request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="https://ws.intermedia.net/Account/Management">

<soapenv:Header>
  <AuthentificationInfo>
     <login>[PLRAdminUserName]</login>
     <password>[PLRAdminPassword]</password>
     <accountID>[accountID]</accountID>
  </AuthentificationInfo>
</soapenv:Header>
<soapenv:Body>
  <GetAccount>
     <accountID>[accountID]</accountID>
  </GetAccount>
</soapenv:Body>
</soapenv:Envelope>

WSDL: https://controlpanel.msoutlookonline.net/WebServices/Account/AccountService.asmx?WSDL

PHP:

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

    $wsdl = "https://controlpanel.msoutlookonline.net/WebServices/Account/AccountService.asmx?WSDL";
    $ns = 'https://ws.intermedia.net/Account/Management';

    $client = new SoapClient($wsdl, array(
        "trace" => 1,
        "exceptions" => 0
    ));

    $login = 'xxxx';
    $password = 'xxxx';
    $partnerID = 1234;
    $accountID = 12345678;

    $headerBody = array('AuthentificationInfo'=>array(
        'login' => $login,
        'password' => $password,
        'accountID' => $partnerID
    ));
    $header = new SoapHeader($ns, 'AuthentificationInfo', $headerBody);
    $client->__setSoapHeaders($header);
    $client->__soapCall("echoVoid", array(null));

    $value = $client->GetAccount($accountID);

I'm getting the following error message:

soap:ServerServer was unable to process request. ---> Access denied; Code: 0x0008

Can anyone see anything wrong with the code?

3 Answers 3

5

Try with

     $headerBody = array(
      'login' => $login,
      'password' => $password,
      'accountID' => $partnerID);
Sign up to request clarification or add additional context in comments.

1 Comment

Then I would advise you to try to generate the abstraction layer package according to this WSDL on wsdltophp.com, you'll see that it's really easier to call your web service than ever. You'll be able to easily set the Soapheader without any doubt and questionning. Let me know if you need any help.
2

just for anyone else that may ever run across this:

I changed

$ns = 'https://ws.intermedia.net/Account/Management';

to:

$ns = 'http://schemas.msoutlookonline.net';

Comments

1

I had an incorrect namespace.

Also Mikaël DELSOL's answer helped as I didn't need the array('AuthentificationInfo'=> part. Also didn't need: $client->__soapCall("echoVoid", array(null));

Thank you!

1 Comment

Can you elaborate a bit on the incorrect name space?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.