2014-11-03 88 views
1

我在Delphi XE中编写了一个简单的Web服务 它在IIS上运行,就像ISAPI DLL一样。使用Android连接到Delphi WebService

我无法连接此WebService与Android:

private final String NAMESPACE = "http://217.114.221.83/grigliamo/"; 
private final String URL = "http://217.114.221.83/grigliamo/DifferenziaWS.dll/wsdl/IWSDifferenzia"; 
private final String SOAP_ACTION = "http://217.114.221.83/grigliamo/WS_Login"; 
private final String METHOD_NAME = "WS_Login"; 

public void getWebService(String x) { 
    //Create request 
    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); 
    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
      SoapEnvelope.VER11); 
    envelope.setOutputSoapObject(request); 
    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 

    try { 
     //Involve web service 
     androidHttpTransport.call(SOAP_ACTION, envelope); 
     SoapPrimitive response = (SoapPrimitive) envelope.getResponse(); 
     Assign it to fahren static variable 
     Res = response.toString(); 

    } catch (Exception e) { 
     Res = e.toString(); 
     e.printStackTrace(); 
    } 
} 

我总是得到一个org.xmlpull.v1.XmlPullParserException:expectd START_TAG 任何人能告诉我什么是错上我的web服务吗? 谢谢 Andrea

+1

'我的web服务有什么问题'。你确定你的web服务是错误的?你的Android代码可以吗? – greenapps 2014-11-03 11:33:43

+0

http://stackoverflow.com/questions/12430136/ksoap2-org-xmlpull-v1-xmlpullparserexception-expected-start-tag-error可能的重复 – mjn 2014-11-03 12:11:00

回答