public static Rpc2DocumentLiteralTranslator Translate(XmlDocument wsdl)
        {
            Rpc2DocumentLiteralTranslator translator = new Rpc2DocumentLiteralTranslator(wsdl);

            translator.TranslateStore();
            return(translator);
        }
 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)]);
         }
     }
 }
 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]);
         }
     }
 }
 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);
         }
     }
 }
Exemple #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
            }
        }
 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);
     }
 }
 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)]);
         }
     }
 }
 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);
         }
     }
 }
 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]);
         }
     }
 }
 public void SetupRelations(ElementStore store, Rpc2DocumentLiteralTranslator trans)
 {
     portType = (R2DPortType) store.PortTypes[trans.Normalize(elem.Attributes["type"].Value)];
 }
 public static Rpc2DocumentLiteralTranslator Translate(XmlDocument wsdl)
 {
     Rpc2DocumentLiteralTranslator translator = new Rpc2DocumentLiteralTranslator(wsdl);
     translator.TranslateStore();
     return translator;
 }
 public static bool ContainsRpcLiteralBindings(XmlDocument wsdl)
 {
     Rpc2DocumentLiteralTranslator translator = new Rpc2DocumentLiteralTranslator(wsdl);
     return translator.ContainsRpcLiteralBindings();
 }
 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);
     }
 }
        public static bool ContainsRpcLiteralBindings(XmlDocument wsdl)
        {
            Rpc2DocumentLiteralTranslator translator = new Rpc2DocumentLiteralTranslator(wsdl);

            return(translator.ContainsRpcLiteralBindings());
        }
 public void SetupRelations(ElementStore store, Rpc2DocumentLiteralTranslator trans)
 {
     portType = (R2DPortType)store.PortTypes[trans.Normalize(elem.Attributes["type"].Value)];
 }