`
XieGuoWei123485
  • 浏览: 66235 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

Web Service 02

 
阅读更多
/**
     * 删除多个url的对象的web Service报文 TODO 添加方法注释。 ListKey不能为空由调用者验证.
     * @param listKeys 选择Key集合
     * @return reqMsg
     */
    public static SOAPMessage builDelUrlsMessage(List<String> listKeys)
    {
        try
        {
            logger.debug("build Del Urls Message begin.");
            buildSOAPMessageHeader();
            if (body != null)
            {
                // 定义报文体
                SOAPBodyElement bodyElement = body
                        .addBodyElement(envelope
                                .createName("EndPointUrlRequestMsg", "esb",
                                        "http://ngbss.huawei.com/esb/endpointurl/webservice"));
                SOAPBodyElement requestHeader = (SOAPBodyElement) bodyElement
                        .addChildElement("RequestHeader", "esb");
                SOAPBodyElement requestBody = (SOAPBodyElement) bodyElement
                        .addChildElement("RequestBody", "esb");

                requestHeader.addChildElement("userId", "esb").addTextNode(
                        "500");
                requestHeader.addChildElement("password", "esb").addTextNode(
                        "500");

                SOAPBodyElement urls = (SOAPBodyElement) requestBody
                        .addChildElement("urls", "esb");
                urls.setAttribute("Action", "Del");

                for (int i = 0; i < listKeys.size(); i++)
                {
                    SOAPBodyElement url = (SOAPBodyElement) urls
                            .addChildElement("url", "esb");
                    url.addChildElement("key", "esb").addTextNode(
                            listKeys.get(i));
                }

            }
            logger.debug("build Del Urls Message sueecss.");

        }
        catch (Exception e)
        {
            logger.error("build Del Urls Message failed and The Message was:"
                    + e.getMessage());
            return reqMsg;
        }
        return reqMsg;
    }

    /**
     * 向ESB流程发送ESB WebService请求 TODO 添加方法注释。由说这里前台界面无法对ESBFlowUrl验证是否正确还
     * 这个URL是否可以调用的所以这里先用IE测试ESB Web Service是否正在行进中. ESBFlowURl验证
     * @param esbFlowUrl  请求url
     * @return respMsg
     */
    public static SOAPMessage sendWebServiceMessage(String esbFlowUrl)
    {
        logger.debug("Send Web Service Message To ESB Flows begin.");
        SOAPMessage respMsg = null;
        try
        {
            // 初始化连接工厂
            init();
            URL endPoint = new URL(esbFlowUrl);
            // 调用EBS Flow Web Service
            respMsg = conn.call(reqMsg, endPoint);

        }
        catch (Exception e)
        {
            logger
                    .error("Send Web Service Message To ESB Flows failed and The Messsage was:"
                            + e.getMessage());
            return respMsg;
        }
        logger.debug("Send Web Service Message To ESB Flows sueecss.");
        return respMsg;
    }

}
分享到:
评论

相关推荐

    C#Web Service C#Web Service C#Web Service

    C#Web Service C#Web Service C#Web Service

    XML Web Service 开发XML Web Service 开发

    XML Web Service 开发XML Web Service 开发XML Web Service 开发XML Web Service 开发XML Web Service 开发最好不要下

    service now web service

    service now web service guide

    Web Service Web Service

    Web ServiceWeb ServiceWeb Service

    web service 教程

    webservice 从表面上看Web service 就是一个应用程序它向外界暴露出一个能够通过Web进行调用的API。这就是说你能 够用编程的方法通过Web来调用这个应用程序。 对Web service 更精确的解释 Web ...

    D6 SOAP_WEB SERVICE程序设计.part1.rar

    第一章 SOAP和Web Service的概念 第二章 组件模型、Internet/Intranet和SOAP 第三章 开发Web Service 第四章 什么是SOAP 第五章 SOAP和数据封装 第六章 SOAP和远程调用 第七章 Web Service和UDDI 第八章 处理复杂...

    D6 SOAP_WEB SERVICE

    D6 SOAP_WEB SERVICE 使用delphi来开发 webservice 使用soap

    论文研究-Web Service和Grid Service研究 .pdf

    Web Service和Grid Service研究,郭璇,,本文分析并比较了两种主流的Web服务技术,Web Service技术和Grid Service技术。首先介绍Web Service 的系统架构和核心技术,并深入探讨Web Servic

    web service 天气预报 web service 天气预报

    web service 天气预报web service 天气预报web service 天气预报web service 天气预报web service 天气预报web service 天气预报

    Query as a Web Service 指南

    Query as a Web Service 指南

    Web Service Discovery–A Reality Check

    web service discovery

    web Service 实例教程

    Web Service 简单实例,JAVA中的Web服务规范等,完整的客户端于服务端的开发流程。

    web service课件

    西北某高等院校研究生的web service课件,英文版的,总共7个ppt,比较简练,适合想快速了解学习web service的学生下载学习,分别是Web Services(ch3.1)、Web Services(ch3.2)、Web Services(ch3.3)、Web Services(ch...

    Web Service

    1.Web service經典開發文檔! 2.它是一個軟件系統﹐為了支持跨網絡的機器間相相互交互而設計。Web Service服務通常被定義為一組模塊化的API﹐它們可以通過網絡進行調用﹐來執行遠程系統的請求服務。 3.XFire 是 ...

    Visual C++源代码 102 如何异步调用Web Service程序

    Visual C++源代码 102 如何异步调用Web Service程序Visual C++源代码 102 如何异步调用Web Service程序Visual C++源代码 102 如何异步调用Web Service程序Visual C++源代码 102 如何异步调用Web Service程序Visual ...

    Java Web Service 程序例子

    Java Web Service 学习例子,里面有大量用来开发web services的Java程序示例,非常值得学习。 使用到的技术及工具如下: Apache: www.apache.org and xml.apache.org -- Ant 1.4.1 -- SOAP 2.2 -- Tomcat 3.2...

    Web Service Architecture

    Web Service

    yahoo web service-2.11.zip

    yahoo web service-2.11.zip;

    Spring Web Service实例

    Spring Web Service是Spring社区基于Spring提供的一个关注于创建”文档驱动”的Web Service的模块, 它的主要目标是方便基于”契约优先”(Contract-First)的SOAP服务的开发. 好像没有多少人讨论, 大多数的话题都是...

    web service soap原理

    详细讲解web service soap原理。

Global site tag (gtag.js) - Google Analytics