当前位置: 首页>>代码示例>>C#>>正文


C# Util.SetSoapEnvelopePHP方法代码示例

本文整理汇总了C#中Util.SetSoapEnvelopePHP方法的典型用法代码示例。如果您正苦于以下问题:C# Util.SetSoapEnvelopePHP方法的具体用法?C# Util.SetSoapEnvelopePHP怎么用?C# Util.SetSoapEnvelopePHP使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Util的用法示例。


在下文中一共展示了Util.SetSoapEnvelopePHP方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestWebServiceButton_Click

    protected void TestWebServiceButton_Click(object sender, EventArgs e)
    {
        Util util = new Util();
        Hashtable State = (Hashtable)HttpRuntime.Cache[Session.SessionID];
        if (util.CheckSessionTimeout(State, Response, "Default.aspx")) return;

        string[] param_values = (string[]) State["WebServiceMethodInputValues"];
        string web_service_url =  State["WebServiceURL"].ToString();
        string method =  State["WebServiceMethod"].ToString();
        XmlDocument TestDoc = null;
        try
        {
            StringBuilder inputs = new StringBuilder();
            for (int i = 1; i <= ParamRepeater.Items.Count; i++)
            {
                string index = i.ToString();
                if (i < 10)
                    index = "0" + index;
                string text = Request.Form.Get("ParamRepeater$ctl" + index + "$paramInput");

                inputs.Append("&" + param_values[i - 1] + "=" + text);
            }

            if (ParamRepeater.Items.Count > 0 && inputs[0] == '?')
                inputs.Remove(0, 1);

            XmlDocument SoapEnv = new XmlDocument();
            if (web_service_url.ToLower().Contains(".php/") || web_service_url.ToLower().EndsWith(".php"))
            {
                SoapEnv.Load(MapPath(".") + @"\templates\SoapEnvelopeTemplatePHP.xml");
                util.SetSoapEnvelopePHP(SoapEnv, web_service_url, method, inputs.ToString());
                TestDoc = util.HttpSOAPRequest(State, web_service_url, SoapEnv, null);
            }
            else if (web_service_url.ToLower().Contains(".asmx/") || web_service_url.ToLower().EndsWith(".asmx"))
            {
                SoapEnv.Load(MapPath(".") + @"\templates\SoapEnvelopeTemplateASMX.xml");
                util.SetSoapEnvelopeASMX(SoapEnv, web_service_url, method, inputs.ToString());
                TestDoc = util.HttpSOAPRequest(State, web_service_url, SoapEnv, null);
            }
            else
                throw new Exception("Cannot recognize web service type");
        }
        catch (Exception ex)
        {
            util.LogError(State, ex);
            TestWebServiceMessage.Text = "Calling the web service return an error: " + ex.Message;
            return;
        }

         State["WebServiceTestDoc"] = TestDoc;

        BuildWebServiceDataTrees(WebServiceEvents.SelectedItem.Text);

        ResponseMessage.Text = "Expand the nodes for " +  State["WebServiceResponseTreeViewNodeText"].ToString();

        DataMultiPage.SelectedIndex = 1;
    }
开发者ID:dcolonvizi,项目名称:ViziAppsPortal,代码行数:57,代码来源:ManageData.aspx.cs


注:本文中的Util.SetSoapEnvelopePHP方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。