久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<i id='vthZL'><tr id='vthZL'><dt id='vthZL'><q id='vthZL'><span id='vthZL'><b id='vthZL'><form id='vthZL'><ins id='vthZL'></ins><ul id='vthZL'></ul><sub id='vthZL'></sub></form><legend id='vthZL'></legend><bdo id='vthZL'><pre id='vthZL'><center id='vthZL'></center></pre></bdo></b><th id='vthZL'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='vthZL'><tfoot id='vthZL'></tfoot><dl id='vthZL'><fieldset id='vthZL'></fieldset></dl></div>

    <bdo id='vthZL'></bdo><ul id='vthZL'></ul>

  1. <tfoot id='vthZL'></tfoot>

    1. <legend id='vthZL'><style id='vthZL'><dir id='vthZL'><q id='vthZL'></q></dir></style></legend>
    2. <small id='vthZL'></small><noframes id='vthZL'>

    3. 解析復雜的 WSDL 參數信息

      Parse Complex WSDL Parameter Information(解析復雜的 WSDL 參數信息)
      <legend id='M3Hxw'><style id='M3Hxw'><dir id='M3Hxw'><q id='M3Hxw'></q></dir></style></legend>
    4. <i id='M3Hxw'><tr id='M3Hxw'><dt id='M3Hxw'><q id='M3Hxw'><span id='M3Hxw'><b id='M3Hxw'><form id='M3Hxw'><ins id='M3Hxw'></ins><ul id='M3Hxw'></ul><sub id='M3Hxw'></sub></form><legend id='M3Hxw'></legend><bdo id='M3Hxw'><pre id='M3Hxw'><center id='M3Hxw'></center></pre></bdo></b><th id='M3Hxw'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='M3Hxw'><tfoot id='M3Hxw'></tfoot><dl id='M3Hxw'><fieldset id='M3Hxw'></fieldset></dl></div>

        • <small id='M3Hxw'></small><noframes id='M3Hxw'>

            <tbody id='M3Hxw'></tbody>
              <bdo id='M3Hxw'></bdo><ul id='M3Hxw'></ul>

              • <tfoot id='M3Hxw'></tfoot>
                本文介紹了解析復雜的 WSDL 參數信息的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                我正在嘗試解析 WSDL,按照給出的示例 這里.

                I am attempting to parse WSDL, along the lines of the example given here.

                作者在評論中指出,該示例無法深入研究復雜的數據類型.

                The author notes, in the comments, that the example is not capable of drilling down into complex data types.

                事實上,當我運行該示例時,它似乎甚至無法處理簡單的數據類型.

                And in fact, when I run the example, it does not appear to even handle simple data types.

                我在示例中使用的 System.Web.Services.Description.ServiceDescription 類中四處尋找,但在運行時找不到任何實際參數或返回類型信息.我知道我可能需要手動解析 xsd 文件?

                I have poked around in System.Web.Services.Description.ServiceDescription class, which is used in the example, but cannot find any actual parameter or return type information at run-time. I gather that I may need to do some manual parsing of an xsd file?

                google 和 stackoverflow 似乎都缺乏如何以編程方式深入研究復雜類型的完整示例,所以......我應該怎么做?

                Both google and stackoverflow appear to lack a complete example of how to drill down into complex types programmatically, so... how should I do this?

                推薦答案

                這并不漂亮 - 但它完成了工作(希望;).我將此代碼部分基于您提供的鏈接,然后添加了一些遞歸來解析架構中包含的不同類型,以及內部元素及其數據類型.這絕對沒有考慮到 XML 模式中的所有可能性,但我認為它足以說明您可以在必要時增加復雜性.

                This is not pretty - but it gets the job done (hopefully ;). I based this code partly on the link you provided, and then added some recursion to parse out the different types included in the schema, as well as the inner elements and their data types. This definitely does not take into account all possiblities in an XML schema, but I think it exemplifies enough that you could add complexity to this if neccessary.

                希望對你有幫助!!!!

                I hope this helps!!!!

                internal class Program
                {
                    private static void Main(string[] args)
                    {
                        //Build the URL request string
                        UriBuilder uriBuilder = new UriBuilder(@"http://digicomdev:8888/digitalOrderBroker/digitalOrderBroker.asmx");
                        uriBuilder.Query = "WSDL";
                
                        HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(uriBuilder.Uri);
                        webRequest.ContentType = "text/xml;charset="utf-8"";
                        webRequest.Method = "GET";
                        webRequest.Accept = "text/xml";
                
                        //Submit a web request to get the web service's WSDL
                        ServiceDescription serviceDescription;
                        using (WebResponse response = webRequest.GetResponse())
                        {
                            using (Stream stream = response.GetResponseStream())
                            {
                                serviceDescription = ServiceDescription.Read(stream);
                            }
                        }
                
                        //Loop through the port types in the service description and list all of the 
                        //web service's operations and each operations input/output
                        foreach (PortType portType in serviceDescription.PortTypes)
                        {
                            foreach (Operation operation in portType.Operations)
                            {
                                Console.Out.WriteLine(operation.Name);
                
                                foreach (var message in operation.Messages)
                                {
                                    if (message is OperationInput)
                                        Console.Out.WriteLine("Input Message: {0}", ((OperationInput) message).Message.Name);
                                    if (message is OperationOutput)
                                        Console.Out.WriteLine("Output Message: {0}", ((OperationOutput) message).Message.Name);
                
                                    foreach (Message messagePart in serviceDescription.Messages)
                                    {
                                        if (messagePart.Name != ((OperationMessage) message).Message.Name) continue;
                
                                        foreach (MessagePart part in messagePart.Parts)
                                        {
                                            Console.Out.WriteLine(part.Name);
                                        }
                                    }
                                }
                                Console.Out.WriteLine();
                            }
                        } //End listing of types
                
                        //Drill down into the WSDL's complex types to list out the individual schema elements 
                        //and their data types
                        Types types = serviceDescription.Types;
                        XmlSchema xmlSchema = types.Schemas[0];
                
                        foreach (object item in xmlSchema.Items)
                        {
                            XmlSchemaElement schemaElement = item as XmlSchemaElement;
                            XmlSchemaComplexType complexType = item as XmlSchemaComplexType;
                
                            if (schemaElement != null)
                            {
                                Console.Out.WriteLine("Schema Element: {0}", schemaElement.Name);
                
                                XmlSchemaType schemaType = schemaElement.SchemaType;
                                XmlSchemaComplexType schemaComplexType = schemaType as XmlSchemaComplexType;
                
                                if (schemaComplexType != null)
                                {
                                    XmlSchemaParticle particle = schemaComplexType.Particle;
                                    XmlSchemaSequence sequence =
                                        particle as XmlSchemaSequence;
                                    if (sequence != null)
                                    {
                                        foreach (XmlSchemaElement childElement in sequence.Items)
                                        {
                                            Console.Out.WriteLine("    Element/Type: {0}:{1}", childElement.Name,
                                                                  childElement.SchemaTypeName.Name);
                                        }
                                    }
                                }
                            }
                            else if (complexType != null)
                            {
                                Console.Out.WriteLine("Complex Type: {0}", complexType.Name);
                                OutputElements(complexType.Particle);
                            }
                            Console.Out.WriteLine();
                        }
                
                        Console.Out.WriteLine();
                        Console.In.ReadLine();
                    }
                
                    private static void OutputElements(XmlSchemaParticle particle)
                    {
                        XmlSchemaSequence sequence = particle as XmlSchemaSequence;
                        XmlSchemaChoice choice = particle as XmlSchemaChoice;
                        XmlSchemaAll all = particle as XmlSchemaAll;
                
                        if (sequence != null)
                        {
                            Console.Out.WriteLine("  Sequence");
                
                            for (int i = 0; i < sequence.Items.Count; i++)
                            {
                                XmlSchemaElement childElement = sequence.Items[i] as XmlSchemaElement;
                                XmlSchemaSequence innerSequence = sequence.Items[i] as XmlSchemaSequence;
                                XmlSchemaChoice innerChoice = sequence.Items[i] as XmlSchemaChoice;
                                XmlSchemaAll innerAll = sequence.Items[i] as XmlSchemaAll;
                
                                if (childElement != null)
                                {
                                    Console.Out.WriteLine("    Element/Type: {0}:{1}", childElement.Name,
                                                          childElement.SchemaTypeName.Name);                        
                                }
                                else OutputElements(sequence.Items[i] as XmlSchemaParticle);
                            }
                        }
                        else if (choice != null)
                        {
                            Console.Out.WriteLine("  Choice");
                            for (int i = 0; i < choice.Items.Count; i++)
                            {
                                XmlSchemaElement childElement = choice.Items[i] as XmlSchemaElement;
                                XmlSchemaSequence innerSequence = choice.Items[i] as XmlSchemaSequence;
                                XmlSchemaChoice innerChoice = choice.Items[i] as XmlSchemaChoice;
                                XmlSchemaAll innerAll = choice.Items[i] as XmlSchemaAll;
                
                                if (childElement != null)
                                {
                                    Console.Out.WriteLine("    Element/Type: {0}:{1}", childElement.Name,
                                                          childElement.SchemaTypeName.Name);
                                }
                                else OutputElements(choice.Items[i] as XmlSchemaParticle);
                            }
                
                            Console.Out.WriteLine();
                        }
                        else if (all != null)
                        {
                            Console.Out.WriteLine("  All");
                            for (int i = 0; i < all.Items.Count; i++)
                            {
                                XmlSchemaElement childElement = all.Items[i] as XmlSchemaElement;
                                XmlSchemaSequence innerSequence = all.Items[i] as XmlSchemaSequence;
                                XmlSchemaChoice innerChoice = all.Items[i] as XmlSchemaChoice;
                                XmlSchemaAll innerAll = all.Items[i] as XmlSchemaAll;
                
                                if (childElement != null)
                                {
                                    Console.Out.WriteLine("    Element/Type: {0}:{1}", childElement.Name,
                                                          childElement.SchemaTypeName.Name);
                                }
                                else OutputElements(all.Items[i] as XmlSchemaParticle);
                            }
                            Console.Out.WriteLine();
                        }
                    }
                }
                

                這篇關于解析復雜的 WSDL 參數信息的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                What are good algorithms for vehicle license plate detection?(車牌檢測有哪些好的算法?)
                onClick event for Image in Unity(Unity中圖像的onClick事件)
                Running Total C#(運行總 C#)
                Deleting a directory when clicked on a hyperlink with JAvascript.ASP.NET C#(單擊帶有 JAvascript.ASP.NET C# 的超鏈接時刪除目錄)
                asp.net listview highlight row on click(asp.net listview 在單擊時突出顯示行)
                Calling A Button OnClick from a function(從函數調用按鈕 OnClick)

                <legend id='fcCt8'><style id='fcCt8'><dir id='fcCt8'><q id='fcCt8'></q></dir></style></legend>
                  <tbody id='fcCt8'></tbody>

                    • <bdo id='fcCt8'></bdo><ul id='fcCt8'></ul>

                      • <i id='fcCt8'><tr id='fcCt8'><dt id='fcCt8'><q id='fcCt8'><span id='fcCt8'><b id='fcCt8'><form id='fcCt8'><ins id='fcCt8'></ins><ul id='fcCt8'></ul><sub id='fcCt8'></sub></form><legend id='fcCt8'></legend><bdo id='fcCt8'><pre id='fcCt8'><center id='fcCt8'></center></pre></bdo></b><th id='fcCt8'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='fcCt8'><tfoot id='fcCt8'></tfoot><dl id='fcCt8'><fieldset id='fcCt8'></fieldset></dl></div>
                      • <tfoot id='fcCt8'></tfoot>

                          <small id='fcCt8'></small><noframes id='fcCt8'>

                        1. 主站蜘蛛池模板: 成人午夜免费网站 | 欧美不卡视频一区发布 | 九九综合 | 成人国产在线视频 | 日日日色 | 国产福利资源在线 | 国产免费av在线 | 在线免费观看黄色av | 秋霞电影一区二区三区 | 欧美日韩一区精品 | 一区二区视频在线 | 亚洲国产免费 | 中文字幕av在线播放 | 久久久久国 | 鸡毛片| 一区二区日韩 | 国产999精品久久久 日本视频一区二区三区 | 蜜桃精品视频在线 | 91社区在线观看播放 | 久久久久久久久国产精品 | 四虎影视一区二区 | 美国十次成人欧美色导视频 | 国产乱码久久久 | 国产精品欧美一区二区 | 久久精品视频免费观看 | 午夜影院在线观看视频 | 欧美日韩精品 | 欧洲一区二区三区 | 毛片一区 | 91超碰在线观看 | 一级欧美一级日韩片免费观看 | 成人影院一区二区三区 | 亚洲精品日韩综合观看成人91 | 日韩精品视频一区二区三区 | 精品二区 | 日本字幕在线观看 | 久草热视频| 一区日韩 | 亚洲视频二区 | 欧美2区| 日本超碰在线 |