2011-11-27 79 views
2

我有以下幾點:xmlpullparserexception預期:START_TAG

public String searchRecipes(String searchString, int pageNumber) throws Exception 
    { 
     SoapObject _client = new SoapObject("", "searchRecipes"); 
     _client.addProperty("searchString", searchString); 
     _client.addProperty("pageNumber", pageNumber); 

     SoapSerializationEnvelope _envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 
     _envelope.bodyOut = _client; 

     Marshal dateMarshal = new MarshalDate(); 
     dateMarshal.register(_envelope); 

     HttpTransportSE _ht = new HttpTransportSE(Configuration.getWsUrl()); 
     _ht.call("", _envelope); 

     return _envelope.getResponse().toString(); 
    } 

它,當我用它在我的本地服務器上使用Eclipse在PC上正常工作。 但是當我部署它,我得到:

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

有人能幫忙嗎?我面對它超過一個星期.........

回答

2

那麼,我認爲NAMESPACE字符串應該是SoapObject構造函數中的第一個參數。同爲()方法調用(這裏應該是NAMESPACE + METHOD_NAME作爲第一個參數)

而且試試這個:

_envelope.setOutputSoapObject(_client); 

,而不是這樣的:

_envelope.bodyOut = _client; 

獲得響應:這取決於您的Web服務返回的內容(原始還是複雜對象?)

相關問題