xmlpullparserexception预期:START_TAG [英] xmlpullparserexception expected: START_TAG

查看:304
本文介绍了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上。 但是,当我部署它,我得到:

It works fine when I use it on my local server on the PC using the eclipse. But when I deploy it I get:

expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG <html>@1:6 in java.io.InputStreamReader@4056fb48) 

有人能帮忙吗?我对着它一个多星期.........

Can anybody help? I am facing it for more than a week.........

推荐答案

嗯,我想NAMESPACE字符串应该是SoapObject构造函数的第一个参数。同为call()方法(这里应该有命名空间+ METHOD_NAME作为第一个参数)

Well, I think NAMESPACE string should be the first argument in SoapObject constructor. The same for the call() method (here should be NAMESPACE + METHOD_NAME as the first parameter)

和尝试这个办法:

_envelope.setOutputSoapObject(_client);

而不是此

_envelope.bodyOut = _client;

要得到响应:(?原始的或复杂的对象),这取决于你的Web服务将返回

To get the response: it depends on what your web service is returning (a primitive or complex object?)

这篇关于xmlpullparserexception预期:START_TAG的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆