Пример #1
0
        public static Rpc2DocumentLiteralTranslator Translate(XmlDocument wsdl)
        {
            Rpc2DocumentLiteralTranslator translator = new Rpc2DocumentLiteralTranslator(wsdl);

            translator.TranslateStore();
            return(translator);
        }
Пример #2
0
 public void SetupRelations(ElementStore store, Rpc2DocumentLiteralTranslator trans)
 {
     foreach (XmlElement op in elem)
     {
         if (op.LocalName == "operation")
         {
             operations.Add((R2DOperation)store.Operations[trans.Normalize(op.Attributes["name"].Value)]);
         }
     }
 }
Пример #3
0
 public void SetupRelations(ElementStore store, Rpc2DocumentLiteralTranslator trans)
 {
     foreach (XmlElement op in elem)
     {
         if (op.LocalName == "part")
         {
             string typeNameAttributeName = "type";
             if (op.Attributes["element"] != null)
             {
                 typeNameAttributeName = "element";
             }
             parameters.Add(store.Types[op.ParentNode.Attributes["name"].Value + "/" + op.Attributes[typeNameAttributeName].Value]);
         }
     }
 }
Пример #4
0
 public void SetupRelations(ElementStore store, Rpc2DocumentLiteralTranslator trans)
 {
     foreach (XmlElement op in elem)
     {
         if (op.LocalName == "input")
         {
             XmlNodeList inBodies = elem.OwnerDocument.SelectNodes("wsdl:definitions/wsdl:binding/wsdl:operation[@name='" + name + "']/wsdl:input/soap:body", nsmgr);
             inputMsg = ((R2DMessage)store.InputMessages[trans.Normalize(op.Attributes["message"].Value)]);
             inNS     = GetNamespace(inBodies);
         }
         if (op.LocalName == "output")
         {
             XmlNodeList outBodies = elem.OwnerDocument.SelectNodes("wsdl:definitions/wsdl:binding/wsdl:operation[@name='" + name + "']/wsdl:output/soap:body", nsmgr);
             outputMsg = ((R2DMessage)store.OutputMessages[trans.Normalize(op.Attributes["message"].Value)]);
             outNS     = GetNamespace(outBodies);
         }
     }
 }
Пример #5
0
        private static void TryTranslateRpc2DocumentLiteral(MetadataResolverOptions options)
        {
            // TODO: This will not work properly for file names like this my.wsdl.wsdl.
            string translatedWsdlFilename = options.MetadataLocation.Replace(".wsdl", "_transformed.wsdl");

            try
            {
                if (Rpc2DocumentLiteralTranslator.ContainsRpcLiteralBindings(options.MetadataLocation))
                {
                    // Execute the translation.
                    Rpc2DocumentLiteralTranslator r2d = Rpc2DocumentLiteralTranslator.Translate(options.MetadataLocation, translatedWsdlFilename);
                    options.MetadataLocation = translatedWsdlFilename;
                }
            }
            catch (Rpc2DocumentLiteralTranslationException)
            {
                // TODO: Log the exception details.c
            }
        }
Пример #6
0
 public void SetupRelations(Rpc2DocumentLiteralTranslator trans)
 {
     foreach (R2DBinding s in bindings.Values)
     {
         s.SetupRelations(this, trans);
     }
     foreach (R2DPortType s in portTypes.Values)
     {
         s.SetupRelations(this, trans);
     }
     foreach (R2DOperation s in operations.Values)
     {
         s.SetupRelations(this, trans);
     }
     foreach (R2DMessage s in inputMessages.Values)
     {
         s.SetupRelations(this, trans);
     }
     foreach (R2DMessage s in outputMessages.Values)
     {
         s.SetupRelations(this, trans);
     }
 }
Пример #7
0
 public void SetupRelations(ElementStore store, Rpc2DocumentLiteralTranslator trans)
 {
     foreach (XmlElement op in elem)
     {
         if (op.LocalName == "operation")
         {
             operations.Add((R2DOperation) store.Operations[trans.Normalize(op.Attributes["name"].Value)]);
         }
     }
 }
Пример #8
0
 public void SetupRelations(ElementStore store, Rpc2DocumentLiteralTranslator trans)
 {
     foreach (XmlElement op in elem)
     {
         if (op.LocalName == "input")
         {
             XmlNodeList inBodies = elem.OwnerDocument.SelectNodes("wsdl:definitions/wsdl:binding/wsdl:operation[@name='" + name +"']/wsdl:input/soap:body", nsmgr);
             inputMsg = ((R2DMessage) store.InputMessages[trans.Normalize(op.Attributes["message"].Value)]);
             inNS = GetNamespace(inBodies);
         }
         if (op.LocalName == "output")
         {
             XmlNodeList outBodies = elem.OwnerDocument.SelectNodes("wsdl:definitions/wsdl:binding/wsdl:operation[@name='" + name +"']/wsdl:output/soap:body", nsmgr);
             outputMsg = ((R2DMessage) store.OutputMessages[trans.Normalize(op.Attributes["message"].Value)]);
             outNS = GetNamespace(outBodies);
         }
     }
 }
Пример #9
0
 public void SetupRelations(ElementStore store, Rpc2DocumentLiteralTranslator trans)
 {
     foreach (XmlElement op in elem)
     {
         if (op.LocalName == "part")
         {
             string typeNameAttributeName = "type";
             if (op.Attributes["element"] != null)
             {
                 typeNameAttributeName = "element";
             }
             parameters.Add(store.Types[op.ParentNode.Attributes["name"].Value + "/" + op.Attributes[typeNameAttributeName].Value]);
         }
     }
 }
Пример #10
0
 public void SetupRelations(ElementStore store, Rpc2DocumentLiteralTranslator trans)
 {
     portType = (R2DPortType) store.PortTypes[trans.Normalize(elem.Attributes["type"].Value)];
 }
Пример #11
0
 public static Rpc2DocumentLiteralTranslator Translate(XmlDocument wsdl)
 {
     Rpc2DocumentLiteralTranslator translator = new Rpc2DocumentLiteralTranslator(wsdl);
     translator.TranslateStore();
     return translator;
 }
Пример #12
0
 public static bool ContainsRpcLiteralBindings(XmlDocument wsdl)
 {
     Rpc2DocumentLiteralTranslator translator = new Rpc2DocumentLiteralTranslator(wsdl);
     return translator.ContainsRpcLiteralBindings();
 }
Пример #13
0
 public void SetupRelations(Rpc2DocumentLiteralTranslator trans)
 {
     foreach(R2DBinding s in bindings.Values)
     {
         s.SetupRelations(this, trans);
     }
     foreach(R2DPortType s in portTypes.Values)
     {
         s.SetupRelations(this, trans);
     }
     foreach(R2DOperation s in operations.Values)
     {
         s.SetupRelations(this, trans);
     }
     foreach(R2DMessage s in inputMessages.Values)
     {
         s.SetupRelations(this, trans);
     }
     foreach(R2DMessage s in outputMessages.Values)
     {
         s.SetupRelations(this, trans);
     }
 }
Пример #14
0
        public static bool ContainsRpcLiteralBindings(XmlDocument wsdl)
        {
            Rpc2DocumentLiteralTranslator translator = new Rpc2DocumentLiteralTranslator(wsdl);

            return(translator.ContainsRpcLiteralBindings());
        }
Пример #15
0
 public void SetupRelations(ElementStore store, Rpc2DocumentLiteralTranslator trans)
 {
     portType = (R2DPortType)store.PortTypes[trans.Normalize(elem.Attributes["type"].Value)];
 }