How to send arrays as soap objects in android web services?

Well... there are many places where something may be wrong. I'll try to explain how to detect these places and debug your code.

Up vote 0 down vote favorite 1 share g+ share fb share tw.

First of all, I have to thank StackOverflow and all its members for the past few months android help. My learning curve has been steep and I don't thiink I would have gotten this far without your help. I need to send an array as a soap object to a web service but keep getting an "empty submitted ID list" response from the server.

I am hoping someone can tell me why. My code is as follows: public void FeedbackRead(String feedbackID) { String soapMethod = "feedbackRead"; SoapObject request = new SoapObject(NAMESPACE, soapMethod); request. AddProperty(getProperty("patientLogin", PATIENT_LOGIN)); request.

AddProperty(getProperty("passwd", PATIENT_PASS)); request. AddProperty(getProperty("IDsRead", new String{feedbackID})); String res = doPost(request, soapMethod); Log. I(soapMethod + "SOAP_RESPONSE ", res); } And the PropertyInfo method is private PropertyInfo getProperty(String name, String val) { PropertyInfo info = new PropertyInfo(); info.

Name = name; info. Namespace = NAMESPACE; info. Type = PropertyInfo.

VECTOR_CLASS; Vector vct = new Vector(); for (int I = 0; I SetValue(vct); return info; } How exactly should I add a string array to a request SoapObject so that I can send it to the server? OK, I know that the soap objects properties are as should be because I have printed them to logcat and they are as should be. I am pasting below the soap object as per logcat: feedbackRead{patientLogin=patient1; passwd=pat1; IDsRead=27d49cea-7968-457a-b377-7bd70bbca1a1, 27d49cea-7968-457a-b377-7bd70bbca1a2; } The next thing I do is String res = doPost(request, soapMethod); What could possibly be going wrong?

Res always contains the message: empty submitted ID list! Is there any way to convert it so I can paste it into my browser window to see does it work? Or is that a completely moronic question?

Thanks so much, Elaine. Android arrays object soap response link|improve this question edited Nov 3 '11 at 17:11 asked Nov 3 '11 at 12:17Elaine McGovern477 62% accept rate.

Attach your getProperty method. To send an array the type of PropertyInfo should be vector and value should be a vector. – Flavio Nov 3 '11 at 14:16 Yes, I think it is I am editing my above post so you can see my PropertyInfo.

Thanks, Elaine. – Elaine McGovern Nov 3 '11 at 14:56.

Well... there are many places where something may be wrong. I'll try to explain how to detect these places and debug your code: Log your request and response this way: HttpTransportSE androidHttpTransport = new HttpTransportSE(serverUrl); androidHttpTransport. Debug = true; androidHttpTransport.

Call(SOAP_ACTION, envelope); Log. D("test", "request: " + androidHttpTransport. RequestDump); Log.

D("test", "response: " + androidHttpTransport. ResponseDump); Compare your request with the correct request. To obtain the correct request you may need some tool that generate soap request using wsdl (I use soapUI, google it.

Also there is a plugin for eclipse). Using such tool you can send correct request to the server and check whether server's methods work or not. And...I'm not sure but try not to use vector and add array properties sequentially: request.

AddProperty(getProperty("IDsRead", feedbackID1)); request. AddProperty(getProperty("IDsRead", feedbackID2)); request. AddProperty(getProperty("IDsRead", feedbackID3)); Hope this helps.

Good luck!

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions