Quantcast
Channel: WinDev Forum
Viewing all articles
Browse latest Browse all 1914

Webservice Strange Error Message (no replies)

$
0
0
Greetings,

History: I made a simple web service for use with a client's data and android mobile phones. All was working in simulation but when I tried to run it on the phone, it would crash and send and error message. Of course, PC Solt was no help in deciphering the error message but the error occurred when assigning the result structure from the webservice. So I decided to try Serialize and Deserialize and transfer a buffer. After much more grief than expected, I got a format that should work but I get the following error:
"The element is not compatible. We expected {}stResults while we received {}stResults."

The stResults is a structure containing a string and an array of a structure.

The code is:
//aSearchResults is SearchContactsResponse
arrResults is array of Answers_WS.stContactNameAddress
stCurResults is Answers_WS.stResults
bufRes is Buffer
bufRes = Answers_WS.SearchContacts(EDT_Max_results, EDT_ID,EDT_Answers_Name,EDT_Last_Name,EDT_First_Name) 
Deserialize(stCurResults,bufRes,psdXML)
iCount is int 
//stCurResults = Answers_WS.SearchContacts(EDT_Max_results, EDT_ID,EDT_Answers_Name,EDT_Last_Name,EDT_First_Name) 
arrResults = stCurResults.aContactNameAddress
////Deserialize(arrResults,stCurResults.aContactNameAddress,psdXML)
STC_ResultsMsg..Caption = stCurResults.sMsg

The data is:
<?xml version="1.0"?><DOCUMENT xmlns:SOAP_ENC="[schemas.xmlsoap.org] id="id0"><sMsg>2 of 2 contacts found</sMsg><aContactNameAddress SOAP_ENC:arrayType="aContactNameAddress[2]"><item href="#id1"/><item href="#id2"/></aContactNameAddress></stResults><stContactNameAddress id="id1"><sID>CAC</sID><sName>Cascade Consulting</sName><sStatus>ACTIVE</sStatus><sLastName>Graham</sLastName><sFirstName>Connie</sFirstName><sAddress>PO Box 758</sAddress><sCity>Port Hadlock</sCity><sStateCode>WA</sStateCode><sZipCode>98339</sZipCode><sEMail></sEMail><sPhone>Cell Phone 350-7600</sPhone><sComments></sComments></stContactNameAddress><stContactNameAddress id="id2"><sID>CAC</sID><sName>Cascade Consulting</sName><sStatus>ACTIVE</sStatus><sLastName>Graham</sLastName><sFirstName>Jeff</sFirstName><sAddress>PO Box 758</sAddress><sCity>Port Hadlock</sCity><sStateCode>WA</sStateCode><sZipCode>98339</sZipCode><sEMail>jeff@accmeals.com</sEMail><sPhone>350-6542</sPhone><sComments></sComments></stContactNameAddress></DOCUMENT>

Any suggestions would be appreciated.

BTW The original error message from the android device (not using Serialize):
===== Error =====
Date and time=31/07/2018 09:38:20
Message=An error occurred while running the SOAP query.
System Message=unexpected type (position:END_DOCUMENT null@1:1 in java.io.InputStreamReader@397525c)
Process=Left-clicking WIN_Search.BTN_Search
WLanguage stack=Left-clicking WIN_Search.BTN_Search
Java stack=fr.pcsoft.wdjava.core.erreur.WDErreurManager.a(Unknown Source)
fr.pcsoft.wdjava.ws.a.d.a(Unknown Source)
fr.pcsoft.wdjava.ws.WDWSClient.invoquerMethode(Unknown Source)
com.mycompany.answers_mobile.wdgen.GWDFWIN_Search$GWDBTN_Search.clicSurBoutonGauche(GWDFWIN_Search.java:657)
fr.pcsoft.wdjava.ui.q.executerPCode(Unknown Source)
fr.pcsoft.wdjava.ui.champs.qb.executerPCode(Unknown Source)
fr.pcsoft.wdjava.ui.q.appelPCode(Unknown Source)
fr.pcsoft.wdjava.ui.champs.pb.appelPCode(Unknown Source)
fr.pcsoft.wdjava.ui.q.appelPCode_TLM(Unknown Source)
fr.pcsoft.wdjava.ui.champs.bouton.a.onClick(Unknown Source)
android.view.View.performClick(View.java:5207)
android.view.View$PerformClick.run(View.java:21168)
android.os.Handler.handleCallback(Handler.java:746)
android.os.Handler.dispatchMessage(Handler.java:95)
android.os.Looper.loop(Looper.java:148)
android.app.ActivityThread.main(ActivityThread.java:5491)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Thread=id=1
name=main
priority=5
groupName=main

===== Screen shot =====
Path=file:///storage/emulated/0/Android/data/com.mycompany.answers_mobile/cache/err1533055100700.png

===== Application =====
Application name=Answers_Mobile
Application version=0.0.8.0
Name of the package=com.mycompany.answers_mobile
Date and time of startup=31/07/2018 09:38:00
Version of Android framework=23.0.253.0 (en)

===== Device =====
Model=XT1254
Constructor=motorola
Make=motorola

===== System =====
Version number of Android=6.0.1 (M)
Android Level Api=23
Total internal storage memory=24.13 GB
Internal storage memory available=18.92 GB
Screen density=640
Screen resolution=1440x2560

Viewing all articles
Browse latest Browse all 1914

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>