Welcome! Log In Create A New Profile

Advanced

Webservice Response put Spaces between Chars

Posted by bkosinski 
Webservice Response put Spaces between Chars
April 22, 2021 11:23AM
Hello,

im looking a few days now for the solution to my problem but cant find it.
i have a SOAP webservice that reads a local hfsql file and returns some serialized class data in an array. when i log the data right before the result of the webservice it looks like this:
<?xml version="1.0"?><DOCUMENT xmlnsconfused smileyOAP_ENC="[schemas.xmlsoap.org];
when i receive the result on my local computer and log it immediately it looks like this:
< ? x m l   v e r s i o n = " 1 . 0 " ? > < D O C U M E N T   x m l n s : S O A P _ E N C = " h t t p : / / s c h e m a s . x m l s o a p . o r g / s o a p / e n c o d i n g / " >
or like this in Buffer Text:
<<0>?<0>x<0>m<0>l<0> <0>v<0>e<0>r<0>s<0>i<0>o<0>n<0>=<0>"<0>1<0>.<0>0<0>"<0>?<0>><0><<0>D<0>O<0>C<0>U<0>M<0>E<0>N<0>T<0> <0>x<0>m<0>l<0>n<0>s<0>:<0>S<0>O<0>A<0>P<0>_<0>E<0>N<0>C<0>=<0>"<0>h<0>t<0>t<0>p<0>:<0>/<0>/<0>s<0>c<0>h<0>e<0>m<0>a<0>s<0>.<0>x<0>m<0>l<0>s<0>o<0>a<0>p<0>.<0>o<0>r<0>g<0>/<0>s<0>o<0>a<0>p<0>/<0>e<0>n<0>c<0>o<0>d<0>i<0>n<0>g<0>/<0>"<0>><0><<0>T<0>e<0>m<0>p<0>A<0>r<0>r<0>a<0>y<0> <0>S<0>O<0>A<0>P<0>_<0>E<0>N<0>C<0>:<0>a<0>r<0>r<0>a<0>y<0>T<0>y<0>p<0>e<0>=<0>"<0>T<0>e<0>m<0>p<0>A<0>r<0>r<0>a<0>y<0>[<0>0<0>]<0>"<0>><0><<0>/<0>T<0>e<0>m<0>p<0>A<0>r<0>r<0>a<0>y<0>><0><<0>/<0>D<0>O<0>C<0>U<0>M<0>E<0>N<0>T<0>><0>

i dont know why there are spaces between each character and i even cant delete them with NoSpace(bu, sscAll)

here is my code:
this is the webservice send function:
b is Buffer= CData.Send(TempArray)
		CLog.Write(b)
		RESULT b


FUNCTION GLOBAL Send(data)
bu	is Buffer
def	is Definition
def = GetDefinition(data)
IF def..Name.Contains("string") THEN
	RESULT data + "  "
END
Serialize(data,bu,psdXML)

RESULT bu + "  "


and here is the local function:
Instance is array of CBaseObject dynamic
		Instance = CData.Retrieve(MobileWebService.Read(CData.Send(gclIdent),File), Instance)


FUNCTION GLOBAL Retrieve(bu is Buffer, ExpectedDataType is array of CBaseObject dynamic)

CLog.Write(bu)
Deserialize(ExpectedDataType,bu,psdXML)

RESULT ExpectedDataType

I hope u can help me with that.

Best Regards
Ben
Re: Webservice Response put Spaces between Chars
April 22, 2021 11:55AM
Hi Ben

The return of the web service is in Unicode or UTF8 (double byte characters) and it seems your project configuration is ANSI or maybe the return is in ANSI format and your project configuration is in Unicode (Do a ANSIToUnicode in that case).

My advice: Nowadays make all your project configurations Unicode. There's no reason to stick with ANSI in today's globally connected world unless of historical constraints on your existing platforms and/or software.

Mobile is 'only unicode' and the web for 99,99% of the cases.

Hope this puts you on track in fixing it.

Cheers

Peter H.



Edited 1 time(s). Last edit at 04/22/2021 11:57AM by PeHoBe.
Re: Webservice Response put Spaces between Chars
April 22, 2021 12:48PM
Hey Peter,

thank you so much for your answer. I solved the problem with Unicode strings.

Thank ya !

Cheers
Ben
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: