2013-05-14 53 views
0

我一直在试图消耗.NET webservic的Android例外org.xmlpull.v1.XmlPullParserException:期望值START_TAG

private static final String SOAP_ACTION = "http://tempuri.org/ICustomers/getAllProductsDT"; 
private static final String METHOD_NAME = "getAllProductsDT"; 
private static final String NAMESPACE = "http://tempuri.org/"; 
private static final String URL = "http://10.121.11.53/Customers/Customers.svc"; 




SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); 
SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
soapEnvelope.setOutputSoapObject(request); 
HttpTransportSE androidHttpTransportSE = new HttpTransportSE(URL); 
androidHttpTransportSE.debug=true; 
androidHttpTransportSE.call(SOAP_ACTION, soapEnvelope); 
String str= soapEnvelope.getResponse().toString(); 

我的第一个日志不会在logcat中和第二个我出现抓住以下几点:

org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG <html>@1:6 in [email protected]) 

05-14 16:08:28.573: W/System.err(3532): org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG <HTML>@1:6 in [email protected]) 
+0

可能重复:http://stackoverflow.com/questions/8288356/xmlpullparserexception-expected-start-tag – 2013-05-14 10:36:55

+0

在哪里日志? – Anukool 2013-05-14 10:37:44

+0

05-14 16:08:28.573:W/System.err的(3532):org.xmlpull.v1.XmlPullParserException:期望值START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope(位置: START_TAG @ 1:6中[email protected]) – 2013-05-14 10:39:21

回答

1

它不是Android或WebService的问题。

有可能在APPCODE的app_html.offline其犯规使其联机运行。

转到解决方案资源管理在C#。

右击,并从项目中排除。 :d

你应该有以下格式消耗的Android使用KSOAP .NET Web服务。

private static final String URL = "http://....asmx"; // Make sure that the url is end with .asmx 
    private static final String NAMESPACE = "http://domain.com"; // It may contain "/" at the of name space. Because it's your name space. 
    private static final String METHOD_NAME = "UserLogin"; // Method Name 
    private static final String SOAP_ACTION = "http://domain.com/UserLogin"; // Domain and method name. 

只要你需要按照上面的结构。

相关问题