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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:27:39+00:00 2026-06-10T08:27:39+00:00

I am trying to integrate an API into my site (the API is not

  • 0

I am trying to integrate an API into my site (the API is not important, the issue is with SOAP). I do not normally code in PHP, but focus on javascript, so SOAP and related things are pretty foreign to me. I have been searching and trying different things for about 2 and a half hours, and managed to narrow down my problem.

I called $client->__getFunctions(), which gives me a list of strings defining all of the functions I am able to use. Here is the string of the function I would like to use:

"GetActivationCodeResponse GetActivationCode(GetActivationCode $parameters)"

I have written and am writing in convention with the API creators, as this is my first time using SOAP, and first time using php in a while.

So I created a function in my class named GetActivationCode that looks like this:

public function GetActivationCode($params) {
    $this->client->GetActivationCode($params);
    var_dump($this->client);
}

This will always output the SOAP error:

Server was unable to process request. --->
System.NullReferenceException:  
Object reference not set to an instance of an object

So I am guessing that it expects the passed parameter to be passed to be an instance of a class called GetActivationCode? I do not know how to do this, and would not like to create a whole new class to serve one function (but I will if that is the solution).

Class I Have Written

<?php

require_once("../includes/mbApi.php");
error_reporting(E_ALL);
ini_set('display_errors', '1');

class MBActivateService extends MBAPIService 
{
    function __construct($debug = false)
    {
        $serviceUrl = "http://" . GetApiHostname() . "/0_5/SiteService.asmx?wsdl";

        $this->debug = $debug;
        $option = array();
        if ($debug)
        {
            $option = array('trace'=>1);
        }
        $this->client = new soapclient($serviceUrl, $option);
    }

    public function GetActivationCode($s, $k, $ids) {
        var_dump($this->client->__getFunctions());
        $arr = array();
        $arr["SourceName"] = $s;
        $arr["Password"] = $k;
        $arr["SiteIDs"] = $ids;
        var_dump($arr);
        $this->client->GetActivationCode($arr);
    }

}

$activate = new MBActivateService();

$result = $activate->GetActivationCode("She3", "private api key", array("28856"));

var_dump($result);

?>

Overall Goal

This is the overall goal, in case someone can offer a better solution. I need to send the following SOAP request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://clients.mindbodyonline.com/api/0_5">
   <soapenv:Header/>
   <soapenv:Body>
      <GetActivationCode>
         <Request>
            <SourceCredentials>
               <SourceName>XXXX</SourceName>
               <Password>XXXX</Password>
               <SiteIDs>
                  <int>XXXX</int>
               </SiteIDs>
            </SourceCredentials>
         </Request>
      </GetActivationCode>
   </soapenv:Body>
</soapenv:Envelope>

I need to send the options for SourceName, Password, and SiteIDs (array).

Thanks in advance for any input!

  • 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-10T08:27:40+00:00Added an answer on June 10, 2026 at 8:27 am

    This sounds familiar. The first thing I would try is to rewrite your function to this:

    public function GetActivationCode($params) {
        var_dump($this->client->GetActivationCode(array(
            'Request' => array(
                'SourceCredentials' => $params
            ),
        )));
    }
    

    Also, to debug you can add this to the options of the SoapClient constructor:

    array(
        'trace' => true,
    )
    

    This way you can do $this->client->__getLastRequest() to debug your code.

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

Sidebar

Related Questions

So I am trying to integrate the facebook iOS api into my iphone app.
I'm trying to integrate passport into my nodejs server using connect, but can't seem
I am trying to integrate a simple login for my site with php. i
I'm trying to integrate Amazon Product API into my website and came across several
I am trying to integrate twitter api using library twitter4j-core-2.1.1-SNAPSHOT.jar. But i am getting
So I'm trying to integrate the PHP facebook SDK/API with codeigniter, because I love
I am trying to integrate a CMS into an existing ASP.NET Web site built
Trying to choose a PHP open source CMS into which I will integrate an
I am trying to integrate a few non-wordpress PHP pages into an existing Wordpress
I'm trying to integrate the Google Data API into my application. I'm using the

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.