473,322 Members | 1,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

How do I return an array from a PHP SOAP service?

HaLo2FrEeEk
404 256MB
When I started this, I knew nothing about SOAP or how it worked. I learned a lot in the first few hours and the result was an operational test of the SOAP service (which I'm writing in PHP). I was able to create the SOAP client in both PHP and Visual Studio (which is what I was aiming for) and return the information I wanted.

Since it was just a test and I wanted to return more (and better formatted) information, I started messing around with it. I added some types and wrote some schemas that I imported. When I finished adding everything I needed (this was all for one result) I saved it all and tested it. It ran without error, but didn't return anything.

I'm trying to return an array with 8 elements, with differing types. Here are the elements and types of that array:

Title - string
LinkId - int
Date - int
Author - string
Content - string
Id - int
Icon - int
Edited - boolean

It will return 25 of those arrays (per page, the input is an integer for which page of results to get).

I cannot figure out how to serialize the array so that SOAP will return it properly.

Here's the URL to my WSDL file:

http://api.infectionist.com/soap.wsdl

PLEASE help me out, I am completely stuck. I can't see anything wrong with the code, and it's running without errors in PHP and Visual Studio, it's just returning an empty result. I can't figue out how to serialize the array.

Edit: The returned array will also contain a boolean value, HasMorePages, which tells whether or not there are any more pages to be had. The 25 arrays will be nested into another array called News, here's an example:

Expand|Select|Wrap|Line Numbers
  1. Array
  2. (
  3. [HasMorePages] => 1
  4. [News] => Array
  5.     (
  6.     [0] => Array
  7.         (
  8.         [Title] => "some title"
  9.         [LinkId] => 100
  10.         [Date] => (timestamp)
  11.         [Author] => "HaLo2FrEeEk"
  12.         [Content] => "Some text"
  13.         [Id] => 170
  14.         [Icon] => 1
  15.         [Edited] => 0
  16.         )
  17.  
  18.     [1] => Array
  19.         (
  20.         [Title] => "some other title"
  21.         [LinkId] => 101
  22.         [Date] => (timestamp)
  23.         [Author] => "HaLo2FrEeEk"
  24.         [Content] => "Some other text"
  25.         [Id] => 177
  26.         [Icon] => 7
  27.         [Edited] => 1
  28.         )
  29.     )
  30. )
Feb 13 '11 #1
0 1555

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: pcouas | last post by:
Hi, Currtently My SOAP service use method with String parameter. But in fact my String size has always 15 caracters. Could i define a SOAP service with a limited string parameter like...
0
by: Marc van Boven | last post by:
I'm stuck with the following problem: My nusoap-client calls a server-function giveCombination(). The function giveCombination should return something like array( => array( 'a_id' => 6,...
16
by: priya | last post by:
Hi all, I am new to this group.I am working in c language.I have dount in pointer? how to retun array of pointer in function? example main()
1
by: Eirik Brattbakk | last post by:
Hi I have some problems accessing a soap service made in c# using an ATL/MFC client over SSL. I have tried both CSoapMSXMLInetClient and CSoapWininetClient as template arguments with my stub...
2
by: kathy | last post by:
how to return array from function?
2
by: Ali | last post by:
hi i need to send some data to the function and want to return array of object bac lik dim obj() as myclass=AddIt(i,j i dont know that is write syntax or no public function addit(byval i as...
0
by: Rob Frohwein | last post by:
Hi, In an C# appl I need a soap service to be called by other (unix systems) In Visual Studio .NET it seems only possible to create a soap service as an .asmx file to be used in IIS. Does...
1
by: Rob Frohwein | last post by:
Hi, In an C# appl I need a soap service to be called by other (unix systems) In Visual Studio .NET it seems only possible to create a soap service as an .asmx file to be used in IIS. Does...
2
by: Rob Frohwein | last post by:
Hi, In an C# appl I need a soap service to be called by other (unix) systems. In Visual Studio .NET it seems only possible to create a soap service as an .asmx file to be used in IIS. Does...
10
by: Raj | last post by:
I need a VB function to return array of collections like Private Type Employee empname as string address as string salary as integer deptno as integer End Type dim employees() as Employee
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.