i am follwing this tutorial http://translate.google.com.ua/translate?hl=uk&sl=ru&tl=en&u=http://mobile-developer.ru/uncategorized/rabota-s-soap-web-servisami-v-android-prilozheniyax/
On Tuesday, 7 August 2012 15:38:25 UTC+5:30, Rajan wrote: > > Hello RichardC, > > First of all thank you for the reply > > i didn't find out my solution so here i am putting my code as well as web > service live url also. > > so can you please check it out and guide me where i'm wrong. > > -------------------------------------------------------------------------------------------------------------------------------------------------- > > import org.ksoap2.SoapEnvelope; > import org.ksoap2.serialization.PropertyInfo; > import org.ksoap2.serialization.SoapObject; > import org.ksoap2.serialization.SoapSerializationEnvelope; > import org.ksoap2.transport.HttpTransportSE; > > import android.app.Activity; > import android.os.Bundle; > import android.util.Log; > import android.widget.TextView; > > public class WebServiceDemo extends Activity > { > private TextView response; > > private static String SOAP_ACTION = " > http://tempuri.org/GetAllAdspacesByBusiness"; > private static String NAMESPACE = "http://tempuri.org/"; > private static String METHOD_NAME = "GetAllAdspacesByBusiness"; > private static String URL = " > http://pro.bookadspace.com/WebServices/BAAccountService.asmx?op=GetAllAdspacesByBusiness > "; > > int masterID=98; > @Override > protected void onCreate(Bundle savedInstanceState) > { > super.onCreate(savedInstanceState); > setContentView(R.layout.main); > response=(TextView)findViewById(R.id.response); > try > { > String resp=callService(masterID); > response.setText(resp); > Log.d("Web Service","Response : "+ resp); > } > catch (Exception e) > { > response.setText("Exception : "+e.toString()); > e.printStackTrace(); > } > } > public String callService(int masterID) throws Exception > { > SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); > > PropertyInfo info = new PropertyInfo(); > info.setName("businessID"); > info.setValue(new Integer(masterID).toString()); > request.addProperty(info); > > SoapSerializationEnvelope envelope = new > SoapSerializationEnvelope(SoapEnvelope.VER11); > envelope.dotNet = true; > envelope.setOutputSoapObject(request); > > HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); > androidHttpTransport.setXmlVersionTag("<?xml version=\"1.0\" > encoding=\"utf-8\"?>"); > androidHttpTransport.call(SOAP_ACTION, envelope); > > SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn; > return resultsRequestSOAP.getProperty(0).toString(); > } > } > > > -------------------------------------------------------------------------------------------------------------------------------------------------- > OUTPUT > > -------------------------------------------------------------------------------------------------------------------------------------------------- > > I am getting this kind of output, > > > *********************************************************************************** > anyType{schema=anyType > {element=anyType{complexType=anyType > {choice=anyType{element=anyType > {complexType=anyType{sequence=anyType > {element=anyType{}; element=anyType{}; element=anyType{}; } > ; }; }; }; }; }; }; > diffgram=anyType{}; } > > *********************************************************************************** > > > But this is not a proper output, so what can i do ?? > > -------------------------------------------------------------------------------------------------------------------------------------------------- > > > > On Wednesday, 1 August 2012 19:12:53 UTC+5:30, RichardC wrote: >> >> Print the stream instead of trying to parse it, and look at it, I guess >> "@1:18" is line 1 position 18. >> >> >> On Wednesday, August 1, 2012 2:39:43 PM UTC+1, Rajan wrote: >>> >>> i am trying to get the response from the SOAP asmx web service but it >>> didn't give proper response >>> >>> >>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- >>> >>> here i putting my logcat entry >>> ------------------------------------- >>> >>> 08-01 19:08:06.891: W/System.err(1994): >>> org.xmlpull.v1.XmlPullParserException: unterminated entity ref >>> (position:TEXT ? ? ' >>> ?...@1:18 in java.io.InputStreamReader@44e9c180) >>> >>> 08-01 19:08:06.891: W/System.err(1994): at >>> org.kxml2.io.KXmlParser.exception(KXmlParser.java:273) >>> 08-01 19:08:06.901: W/System.err(1994): at >>> org.kxml2.io.KXmlParser.error(KXmlParser.java:269) >>> 08-01 19:08:06.901: W/System.err(1994): at >>> org.kxml2.io.KXmlParser.pushEntity(KXmlParser.java:787) >>> 08-01 19:08:06.901: W/System.err(1994): at >>> org.kxml2.io.KXmlParser.pushText(KXmlParser.java:855) >>> 08-01 19:08:06.901: W/System.err(1994): at >>> org.kxml2.io.KXmlParser.nextImpl(KXmlParser.java:354) >>> 08-01 19:08:06.901: W/System.err(1994): at >>> org.kxml2.io.KXmlParser.next(KXmlParser.java:1385) >>> 08-01 19:08:06.901: W/System.err(1994): at >>> org.kxml2.io.KXmlParser.nextTag(KXmlParser.java:1415) >>> 08-01 19:08:06.901: W/System.err(1994): at >>> org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:127) >>> 08-01 19:08:06.901: W/System.err(1994): at >>> org.ksoap2.transport.Transport.parseResponse(Transport.java:100) >>> 08-01 19:08:06.901: W/System.err(1994): at >>> org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:214) >>> 08-01 19:08:06.901: W/System.err(1994): at >>> org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:96) >>> 08-01 19:08:06.911: W/System.err(1994): at >>> com.simform.soapparsing.MainActivity.onCreate(MainActivity.java:61) >>> 08-01 19:08:06.911: W/System.err(1994): at >>> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) >>> >>> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- >>> >>> i also use google for finding this problem but it gives me a rply like : >>> >>> In your xml file there are some closing tag is missing. >>> e.g <item> <form> 123 </item> >>> >>> BUT.... >>> >>> my xml is ok and i also validate on W3C >>> >>> So, what can i do, i didn't understand >>> >>> help me >>> >>> Thank you. >>> >>> >>> -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en