首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >XmlPullParser异常

XmlPullParser异常
EN

Stack Overflow用户
提问于 2011-03-29 11:02:20
回答 2查看 1.5K关注 0票数 1

我无法解决这个错误:

org.xmlpull.v1.XmlPullParserException:预期: START_TAG {http://www.w3.org/2001/12/soap-envelope}信封(java.io.InputStreamReader@43e524c8中position:START_TAG @1:6 )

我有一个安卓应用程序,可以访问一个.NET web服务。它传递一个int并接收一个int作为响应。我在用ksoap2。我还将权限添加到清单文件中,而且还包括所有jar文件。但是,我被卡住了,无法查看我发送的SOAP请求。

我的代码是:

代码语言:javascript
运行
复制
public class FirstAppUI extends Activity{

    private static final String NAMESPACE = "http://tempuri.org/";

    private static final String URL = 
        "http://nautilussoft.biz.whbus12.onlyfordemo.com/staging/litigation/demowebservice.asmx";

private static final String SOAP_ACTION ="http://tempuri.org/GetNumber";

private static final String METHOD_NAME = "GetNumber";

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        TextView tv= (TextView)findViewById(R.id.TextView01);
        SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
        request.addProperty("maxbelow", "123");
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); 

        envelope.dotNet= true;
        envelope.setOutputSoapObject(request);
        HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
        try {
            //Toast.makeText(getBaseContext(), "received object", Toast.LENGTH_SHORT).show();
            androidHttpTransport.call(SOAP_ACTION, envelope);

             Object resultsRequestSOAP = (SoapObject)envelope.getResponse();
            //SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn;
            //Toast.makeText(getBaseContext(), "received object", Toast.LENGTH_SHORT).show();
            tv.setText("Received :" + resultsRequestSOAP.toString());
        } catch (MalformedURLException e) {
            e.printStackTrace();
            Log.e("APP", "MalformedURLException while sending\n" + e.getMessage());
            tv.setText("Malformedexception"+e);
        }
        catch(Exception e1)
        {
            e1.printStackTrace();
            tv.setText("exception"+e1);

        }

        }

}

提前谢谢。

EN

回答 2

Stack Overflow用户

发布于 2011-11-18 09:06:32

对IIS中或通过IIS管理器中的webserivce文件夹授予权限。

票数 1
EN

Stack Overflow用户

发布于 2011-06-27 05:28:03

请检查一下你正在使用的湿疹。它的大小写敏感。即使它在网络浏览器中运行良好,您也应该在代码中使用确切的名称.

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5471469

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档