Receiving an array of data from a SOAP service using PHP

Hi there, I'm a beginner in PHP and I'm slowly learning the basics. I recently encountered an issue where I am unable to receive an Array from a SOAP server. Here's a snippet of my code:

class cUSER {
        public $LOGIN;
        public $PASS;
}

$pcUser = new cUSER;
$pcUser->LOGIN = "user"; 
$pcUser->PASS  = "pass";

try {
    $client = new SoapClient("http://servername.es:8200/SOAPSERV.asmx?wsdl", array(‘features’ => SOAP_SINGLE_ELEMENT_ARRAYS));

    //var_dump($client->__getFunctions());
    $cACCESORIO =  $client->GET_ACCESORIOS($pcUser);

} catch (Exception $e) {
    echo '', $e->getMessage(), "\n";
    die();

}

After reaching out to the server developer, I received the specifications for the request:

GET_ACCESORIOS requires a User object as a parameter and should return an array of objects with the following properties:

REFERENCIA (model id) MODELO (model name) PVP (price) HasError (Indicates if an error occurred) ERROR (description of the error)

SERVER RESPONSE:

The server encountered an error and was unable to process the request. The error message reads: Object reference not set to an instance of an object.

I've tried troubleshooting but haven't been successful. Any assistance would be greatly appreciated!

Answer №1

Disregard my previous thoughts, as it turns out the server documentation was inaccurate. As a beginner, I initially assumed the mistake was mine. It appears that the server developer may not be very knowledgeable.

Regardless, thank you for your assistance.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Issue with a PCRE regular expression

I'm currently working on a regular expression that needs to match the following pattern: argument ::= define_scope [';' define_scope]* define_scope ::= (['local'] | 'global') define_var define_var ::= variable_name expre ...

How to enhance a jQuery tab control by implementing custom JavaScript forward and back arrows?

Although there are other questions related to this topic, mine is unique. I have a scrolling jQuery feature that utilizes tabs for selection and is automated. Modifying the layout is challenging because it is dynamic and depends on the number of items in t ...

Submitting form data in Angular is a straightforward process

I'm currently using the ng-flow library to upload images to my server. After a user drags and drops an image, I can successfully retrieve the HTML 5 file image in my controller. However, when trying to download it to the server along with other parame ...

Searching for image labels and substituting the path string

Upon each page load, I am faced with the task of implementing a script that scans through the entire page to identify all image src file paths (<img src="/RayRay/thisisianimage.png">) and then add a specific string onto the file paths so they appear ...

Tips on organizing Stripe charges based on identifier

I have a vision to develop a Donation Website that organizes donation amounts by team. My goal is to utilize Stripe for processing all charges and then categorize them according to the teams involved. How can I calculate the total amount donated for each ...

Using PHP and jQuery to fetch data from two different tables simultaneously

This code is set up to extract data from a single table exclusively. How do I modify it so it can retrieve data from two different tables and then store that information in another table? My goal is to achieve something similar to this: https://i.stack.i ...

Can SQL SELECT and SQL UPDATE queries be combined into a single query?

Is there a way to improve the code without using mysqli_real_escape_string's in a single MySQL query? //RETRIEVE VALUES $sql = "SELECT * FROM `fddq_product_lang` WHERE id_product='19627' AND id_lang='3'"; $result = mysqli ...

Creating a new model in Laravel and storing it in the database

I'm currently diving into the world of the Laravel framework, and I find myself a bit puzzled by the ORM system. Within my database setup, there are 3 tables: projects (projectID, projectName, etc...) tags (tagID, tag) project_tags (ID, projectID, ...

Running a PHP script that executes a shared library file

After creating the shared library client.so, I found that when it is executed, the main() function gets triggered. The main() function reads a string from the user and then calls the function ch=foo(buffer);. Below is the code for Main.cpp: #include& ...

Google Extension PHP Plugin

Is it feasible to integrate a PHP file into a Google Extension for Chrome? I've been exploring the idea of creating an extension and most resources only mention HTML, CSS, and JavaScript. Any guidance on using PHP in the extension would be highly valu ...

Getting the most out of Ajax responses: Tips for optimizing the number of requests in a gaming

Currently, I am developing a poker game using html/php/ajax without Flash. While I have some programming experience, I am fairly new to game development and have a question. When playing poker, how does the browser detect when a player discards a card? Sh ...

Is there a way to create SEO-optimized URLs using PHP?

My current tech stack includes Apache HTTP, PHP, and MongoDB. I'm aiming to create SEO-friendly URLs similar to "stackoverflow". Would it be advisable to extract the title from each article and pass it on to Apache? If so, what would be the best way ...

Guide for dividing XML children into multiple children by using PHP and a specified delimiter

I am facing a challenge with an XML child that contains multiple URLs separated by '|' For example: <ImageURL>https://example.com/example.jpg|https://example.com/example2.jpg</ImageURL> I aim to develop a PHP function that can separ ...

Transform the string into a time format using PHP

When working with PHP, I often come across times in the following format: $time = '2015-06-29T16:00:00Z'; My goal is to convert this time into a more readable format like this: Tuesday, December 16, 2015 3:00 PM I attempted to achieve this usi ...

There appears to be a disconnection issue with the PHP Zend Framework 2 and

Hey there, I have a PHP daemon set up to manage requests from RabbitMQ. However, after running for a day, it stops functioning due to encountering the error "MySQL has gone away." PHP Warning: PDOStatement::execute(): MySQL server has gone away in /var/ ...

What value is automatically assigned to a session variable if no value is specified?

<?php session_start(); if(isset($_SESSION['count'])) $_SESSION['count'] = $_SESSION['count'] + 1; else $_SESSION['count'] = 1; echo "Number of visits: ". $_SESSION['count']; ?> Is $_SESSI ...

What is the best way to display all checked checkboxes even when the page is reloaded?

I am facing an issue with my website - it is using JavaScript to search for checked checkboxes. $(function () { var $allELements = $('.input-box'); var $selectedElementsListing = $('#selectedElements'); var $selec ...

Using PHP to send a JSON request via cURL

I am attempting to make a cURL request in PHP. The request I am trying to send is as follows: $ curl -H 'Content-Type: application/json' -d '{"username":"a", "password":"b","msisdn":"447000000001","webhook":"http://example.com/"}' http ...

Server-side magic: Requesting POSTed value from $_GET

My webpage contains the following JavaScript code in the header, utilizing POST method: function submitData() { var xhr = new XMLHttpRequest(); xhr.open('POST', 'http://.../process.php?data=123', true); xhr.onreadystatechan ...

Having trouble locating the correct JSON array syntax for Highcharts

Hey there! I'm currently facing a bit of a challenge while trying to set up a JSON array using PHP and integrate it into Highcharts. Currently, I am creating the array in this manner: $stack[] = array($commname => $countit); $stack = json_encode( ...