Alaska Software Inc. - Xb2net, SOAP and arrays
Username: Password:
AuthorTopic: Xb2net, SOAP and arrays
Jack DuijfXb2net, SOAP and arrays
on Tue, 12 Apr 2011 16:47:18 +0200
Hello,

I try to send a Xbase++ array with objects via SOAP.
I only receive a empty string.
What is my mistake?

Regards,
Jack Duijf

P.s. Class MyData is known on client and server side.


oResult              := oAgent:Execute("http://127.0.0.1:81","GetData") 
aData := oResult:GetVar("MyData")
? aData ==> Emty string?


Procedure Soap_GetData(oIn,oOut)
LOCAL aDataToSend := {}
AADD(aDataToSend,MyData():New("A"))
AADD(aDataToSend,MyData():New("B"))
AADD(aDataToSend,MyData():New("C"))
oOut:SetVar("MyData",aDataToSend)
Return

CLASS MyData
VAR    Data
METHOD Init
ENDCLASS
METHOD MyData:Init(cData)
::Data := cData
Return SELF
Jan Groenestein Re: Xb2net, SOAP and arrays
on Tue, 12 Apr 2011 18:31:09 +0200
Hi Jack,

I think you are actually trying to send an Xbase++ array, not a string.
A SOAP message cannot transport arrays, just strings (and maybe other 
simple types, but I've only tried strings)

Regards,
Jan Groenestein

Op 12-4-2011 16:47, Jack Duijf schreef:
> Hello,
>
> I try to send a Xbase++ array with objects via SOAP.
> I only receive a empty string.
> What is my mistake?
>
> Regards,
> Jack Duijf
>
> P.s. Class MyData is known on client and server side.
>
>
> oResult := oAgent:Execute("http://127.0.0.1:81","GetData") aData :=
> oResult:GetVar("MyData")
> ? aData ==> Emty string?
>
>
> Procedure Soap_GetData(oIn,oOut)
> LOCAL aDataToSend := {}
> AADD(aDataToSend,MyData():New("A"))
> AADD(aDataToSend,MyData():New("B"))
> AADD(aDataToSend,MyData():New("C"))
> oOut:SetVar("MyData",aDataToSend)
> Return
>
> CLASS MyData
> VAR Data
> METHOD Init
> ENDCLASS
> METHOD MyData:Init(cData)
> ::Data := cData
> Return SELF
Boris BorzicRe: Xb2net, SOAP and arrays
on Tue, 12 Apr 2011 18:47:51 +0200
Jack Duijf wrote in news:40041600$4ecf2263$19f08@news.alaska-software.com:

> I try to send a Xbase++ array with objects via SOAP.
> I only receive a empty string.
> What is my mistake?
> 

It should work - what is the output of oResult:GetVar() ?

Also have a look at the "EchoAll" sample in SOAPEXEC.PRG (client-side)
The server-side is called SOAP_EchoAll in WEBSERVE.PRG


Best regards,
Boris Borzic

http://xb2.net
http://sqlexpress.net
industrial strength Xbase++ development tools
Chris AndriesRe: Xb2net, SOAP and arrays
on Wed, 13 Apr 2011 08:36:35 +0200
Hi Jack,

I always use var2hex(x) and hex2var(x). This way I send everything I want.
oOut:SetVar("MyData",var2hex(aDataToSend))

Best regards,
Chris Andries



<Jack Duijf> wrote in message
news:40041600$4ecf2263$19f08@news.alaska-software.com...
> Hello,
>
> I try to send a Xbase++ array with objects via SOAP.
> I only receive a empty string.
> What is my mistake?
>
> Regards,
> Jack Duijf
>
> P.s. Class MyData is known on client and server side.
>
>
> oResult              := oAgent:Execute("http://127.0.0.1:81","GetData")
> aData := oResult:GetVar("MyData")
> ? aData ==> Emty string?
>
>
> Procedure Soap_GetData(oIn,oOut)
> LOCAL aDataToSend := {}
> AADD(aDataToSend,MyData():New("A"))
> AADD(aDataToSend,MyData():New("B"))
> AADD(aDataToSend,MyData():New("C"))
> oOut:SetVar("MyData",aDataToSend)
> Return
>
> CLASS MyData
> VAR    Data
> METHOD Init
> ENDCLASS
> METHOD MyData:Init(cData)
> ::Data := cData
> Return SELF