在同一个活动叫肥皂+ xml解析 [英] calling soap + xml parsing in same activity

查看:280
本文介绍了在同一个活动叫肥皂+ xml解析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我必须在一个应用程序开发。
第一个图像是Android使用XML解析显示列表视图。
第二个图像显示特定的顺序,当我点击特定item.Here我要补充微调更新方法为特定订单的详细描述。(即)如果我必须点击特定的项目意味着是去详细说明活动..here 2 expandablelistview是there.they是订单信息,客户信息...这里的微调是增加订单信息group..how是做...如何添加我的code对customizedlistview和singlemenuitem activity..please帮帮我,给我一些想法...


请在这里参考我的code:
CustomizedListView
SingleMenuItemActivity

Hi i have to develop on one app. The first image is displayed listview using xml parsing in android . The second image is displayed detailed description of particular order when i click the particular item.Here i wish to add the spinner update method for that particular order.(i.e)if i have to click the particular item means it is go to detailed description activity..here the 2 expandablelistview is there.they are orderinfo,customer info...here the spinner is add orderinfo group..how is to do...how is add my code on customizedlistview and singlemenuitem activity..please help me...give me some ideas... please refer my code here: CustomizedListView SingleMenuItemActivity

推荐答案

我不清楚地了解你的问题。如果我错了说..
你想在箱子第二种观点是微调更新方法,这对于解析SOAP请求的XML,然后发送SOAP请求和分裂的反应?

I don't clearly understand your question. If i'm wrong say it.. You want to crate an "spinner update method" in the second view, which parse the xml for a soap request, then send the soap request and split the response?

如果有,我会建议你做一个SAPARATE类中,你将解析xml和发出请求。事情是这样的:

If yes, I would recommend you to make an saparate class in which you will parse the xml and make the request. Something like this:

public class SomeRequest {
    private static String xml = null;
    private static String response= null;

    public static void SomeRequest (String url, String sT, int protocoll, String[] Vars) {
        HttpClient httpClient = new DefaultHttpClient();
        HttpPost httpPost = new HttpPost(url);

        xml = "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:mob='YOUR/URL' xmlns:arr='http://schemas.microsoft.com/2003/10/Serialization/Arrays'>" +
                "<soapenv:Header/>" +
                "<soapenv:Body>" +
                "<mob:Request>" +
                    "<!--Optional:-->" +
                    "<mob:Vars>" +
                        "<!--Zero or more repetitions:-->" +
                        "<arr:string>"+ Vars +"</arr:string>" +
                    "</mob:Vars>" +
                    "<!--Optional:-->" +
                    "<mob:protocoll>"+ protocoll +"</mob:protocoll>" +
                    "<!--Optional:-->" +
                    "<mob:session>"+ sT +"</mob:session>" +
                "</mob:Request>" +
            "</soapenv:Body>" +
        "</soapenv:Envelope>";

        try {
            StringEntity se = new StringEntity(xml, HTTP.UTF_8);
            se.setContentType("text/xml");
            httpPost.addHeader("SOAPAction", "YOUR/REQUEST/URL");
            httpPost.setEntity(se);

            HttpResponse httpResponse = httpClient.execute(httpPost);
            HttpEntity resEntity = httpResponse.getEntity();
            response= EntityUtils.toString(resEntity);

        } catch (Exception e) {
            System.out.println(e.toString());
            Log.e("httpRequestException", e.toString());
        }
    }
}

这篇关于在同一个活动叫肥皂+ xml解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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