0

I hope some of you guys can help me I'm new to SOAP API and having rough time.

I'm using my client's database (database using soap api), my admin side or backend is laravel. I'm having some trouble with storing data using soap api to my client's database. I've already connected my laravel to their database. I was able to store data using the wsdl URL from my client using SOAPUI software.

Basically, I created a TestController in Laravel

<?php

namespace App\Http\Controllers;

use SoapWrapper;
use Illuminate\Http\Request;
use App\Helpers\SoapHelper;

class TestController extends Controller
{

private $client;

    public function index()
    {
        $result = $this->client->CreateMember(
            [
                'CreateMemberRequest' =>
                array(
                    'siteId' => '1',
                    'membership' =>
                    array(
                        'membershipId' => '',
                        'termId' => '',
                        'memberNumber' => '',
                    ),
                    'personal' =>
                    array(
                        'title' => '',
                        'firstName' => '',
                        'middleName' => '',
                        'lastName' => '',
                        'preferredName' => '',
                    ),
                ),
            ]
        );
    }
}

The siteId is "1" but when I input it the error shows "SOAP-ERROR: Encoding: object has no 'siteId' property"

NEEDS SOME HELP

  • Where is `$this->client` coming from? – Salim Djerbouh Sep 05 '19 at 14:46
  • Their's "private $client;" I forgot to include here on my question. With regards to your question, it's in the Helper. Here's the part of my Helper ``` $header = new \SoapHeader($namespace, "loginDetails", $credentials); $client = new \SoapClient( $wsdl, array( 'trace' => true, 'stream_context' => stream_context_create($opts) ) ); $client->__setSoapHeaders($header); return $client; ``` – Robin Grace Cruz Sep 05 '19 at 22:21

0 Answers0