Hey Guys,
I'm stumped on a problem trying to consume a ColdFusion SOAP service in Android using kSOAP. Here is my java code for invoking one of them test methods I've written in ColdFusion (which only returns a string): --- private static final String NAMESPACE = > "http://www.sub.tv/MyService.cfc?WSDL"; > private static String URL = "http://www.sub.tv/MyService.cfc"; > private static final String METHOD_NAME = "TestMethod"; > private static final String SOAP_ACTION = > "http://www.sub.tv/MyService.cfc?method=TestMethod"; > public void GetData() { > SoapPrimitive resultstring = null; > SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); > PropertyInfo inputArgs = new PropertyInfo(); > inputArgs.setName("ID"); > inputArgs.setValue(1234); > inputArgs.setType(Integer.class); > request.addProperty(inputArgs); > > SoapSerializationEnvelope soapenvelope = new SoapSerializationEnvelope > (SoapEnvelope.VER11); > soapenvelope.dotNet = false; > soapenvelope.setOutputSoapObject(request); > AndroidHttpTransport httptransport = new AndroidHttpTransport(URL); > //httptransport.debug = true; > try { > httptransport.call(SOAP_ACTION, soapenvelope); > resultstring = (SoapPrimitive) soapenvelope.getResponse(); > > } catch (Exception e) { > Log.d(DEBUG, e.getMessage()); > } } --- And here is the ColdFusion test method I've written that only returns a string: -- <cfcomponent displayname="test_web_service" namespace="http://www.sub.tv"> > <cffunction name="TestMethod" returnType = "string" access="remote" > description="Test Method"> > <cfargument name="ID" type="numeric"> > > <cfreturn "hello" /> > > </cffunction> > </cfcomponent> -- The error I'm getting when I execute the above Java code is as follows: > org.xmlpull.v1.XmlPullParserException: expected: START_TAG { > http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG > <html>@2:44 in java.io.InputStreamReader@40ff5440) I suspect the cause of the problem is perhaps the URL I've specified in the SOAP_ACTION but, as far as I know, that's the correct way to invoke a ColdFusion SOAP web service method. Executing that URL in the browser returns the expected results. I've tried excluding the manual method call in the query string of that URL but I still get the same error. Any idea what I'm doing wrong? Thanks for your time. Tonez -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

