473,564 Members | 2,758 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

HaLo2FrEeEk
404 Contributor
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 1576

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

Similar topics

0
2089
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 StringBuffer(15) Regards, Philippe
0
6450
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, 'b_id' => 9, 'c_id' => 3,
16
2475
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
3941
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 class. The service is returning with the error code: -2147467259. I have not succeeded to find any additional information about the error. The...
2
21518
by: kathy | last post by:
how to return array from function?
2
1691
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 interger, byval j as integer) as myclas dim obj(20) as myclas obj(0).additem( i,j obj(1).additem(i,j
0
1236
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 anybody know how to create a soap service to be run in a application (thread) ? (thus *without* IIS) thaqnks
1
1831
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 anybody know how to create a soap service to be run in a application (thread) ? (thus *without* IIS) thanks
2
1823
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 anybody know how to create a soap service to be run in a application (thread) ? (thus *without* IIS) thanks
10
5574
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
7665
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7583
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
6255
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.