Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
4
Erster Beitrag:
vor 4 Jahren, 9 Monaten
Letzter Beitrag:
vor 4 Jahren, 9 Monaten
Beteiligte Autoren:
Paul Turner, Fabrice Harari

Passing a structure to Android via Webservices

Startbeitrag von Paul Turner am 20.10.2013 10:26

Has anyone successfully passed a serialized structure to WM Android via webservices?

I can pass one from Android to Webservices, but no luck passing one back. While it works on the simulator, on an actual device I always get a 'Wrong Serialization format' error. Even with a simple example like

strReturn is Structure
sName is string
END

stStructureIn is strReturn

Deserialize(stStructureIn,bufIn,psdXML)

Any and all help gratefully received!

Antworten:

Hi Paul

most of the time, these kind of problems comes from unicode vs ansi. Android is unicode by default, while your webservice is probably ansi by default... Before using serialize/deserialize, make sure that the strings used to work are on both side specifically declared the same way (either ansi or more probably unicode)

Best regards

von Fabrice Harari - am 20.10.2013 14:37
Hi Fabrice
Thanks for taking the time to help. I tried a structure will only integers. The following code causes the deserialization error.

Calling code.....

strProduct is Structure
nOne is int
nTwo is int
END
strReturn is strProduct
bufIn is buffer

bufin = WebServiceCall()
deserialize(strReturn,bufin,psdXML)

------------------------------------------------
WebService code...

strProduct is Structure
nOne is int
nTwo is int
END

strReturn is strProduct
bufOut is Buffer

strReturn.nOne = 42
strReturn.nTwo = 78

Serialize(strReturn,bufOut,psdXML)

RESULT bufOut

von Paul Turner - am 20.10.2013 23:12
Found the problem isn't actually with WM, and so started a new thread stating the problem

von Paul Turner - am 20.10.2013 23:57
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.