Beispiel #1
0
        private ArrayList ResolveWsdlMethodInfo(WsdlBinding binding)
        {
            Util.Log("WsdlParser.ResolveWsdlMethodInfo "+binding.name);                     
            ArrayList methodInfos = new ArrayList(10);
            Hashtable propertyMethod = new Hashtable(3);
            for (int i=0; i<binding.operations.Count; i++)
            {
                bool bGet = false;
                bool bSet = false;
                WsdlBindingOperation op = (WsdlBindingOperation)binding.operations[i];
                if (op.soapOperation != null)
                {
                    WsdlMethodInfo methodInfo = new WsdlMethodInfo();
                    methodInfo.methodName = op.name;
                    methodInfo.methodNameNs = op.nameNs;
                    methodInfo.methodAttributes = op.methodAttributes;
                    AddNewNamespace(op.nameNs);
                    WsdlBindingSoapOperation opSoap = (WsdlBindingSoapOperation)op.soapOperation;

                    if ((methodInfo.methodName.StartsWith("get_", StringComparison.Ordinal) && methodInfo.methodName.Length > 4))
                        bGet = true;
                    else if ((methodInfo.methodName.StartsWith("set_", StringComparison.Ordinal) && methodInfo.methodName.Length > 4))
                        bSet = true;
                    if (bGet || bSet)
                    {
                        bool bNew = false;
                        String propertyName = methodInfo.methodName.Substring(4);
                        WsdlMethodInfo propertyMethodInfo = (WsdlMethodInfo)propertyMethod[propertyName];
                        if (propertyMethodInfo == null)
                        {
                            propertyMethod[propertyName] = methodInfo;
                            methodInfos.Add(methodInfo);
                            propertyMethodInfo = methodInfo;
                            methodInfo.propertyName = propertyName;
                            methodInfo.bProperty = true;
                            bNew = true;
                        }

                        if (bGet)
                        {
                            propertyMethodInfo.bGet = true;
                            propertyMethodInfo.soapActionGet = opSoap.soapAction;
                        }
                        else
                        {
                            propertyMethodInfo.bSet = true;
                            propertyMethodInfo.soapActionSet = opSoap.soapAction;
                            //propertyMethodInfo.Dump();
                        }

                        if (!bNew)
                            continue; //already processed this property
                    }
                    else
                        methodInfos.Add(methodInfo);
                    methodInfo.soapAction = opSoap.soapAction;

                    WsdlPortType portType = (WsdlPortType)wsdlPortTypes[binding.type];

                    if ((portType == null) || (portType.operations.Count != binding.operations.Count))
                    {
                        throw new SUDSParserException(
                                                     String.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_WsdlInvalidPortType"),
                                                                   binding.type));
                    }

                    // PortType operations are obtained by the <binding><operation><input name = porttype operation>

                    WsdlPortTypeOperation portTypeOp = null;
                    foreach (WsdlBindingOperationSection opSec in op.sections)
                    {
                        if (MatchingStrings(opSec.elementName, s_inputString))
                        {

                            portTypeOp = (WsdlPortTypeOperation)portType.sections[opSec.name];

                            Util.Log("WsdlParser.ResolveWsdlMethodInfo find portTypeOp 1 "+opSec.name+" portTypeOp "+portTypeOp);

                            if (portTypeOp == null)
                            {
                                //this is for interop testing because other implementations are using the opSec.name wrong.
                                // a "Request" is not being added to the end of the name.
                                int index  = opSec.name.LastIndexOf("Request");
                                if (index > 0)
                                {
                                    String newOpName = opSec.name.Substring(0, index);
                                    portTypeOp = (WsdlPortTypeOperation)portType.sections[newOpName];
                                    Util.Log("WsdlParser.ResolveWsdlMethodInfo find portTypeOp 2 "+newOpName+" portTypeOp "+portTypeOp);
                                }
                            }

                            if (portTypeOp != null && portTypeOp.parameterOrder != null && portTypeOp.parameterOrder.Length > 0)
                            {
                                methodInfo.paramNamesOrder = portTypeOp.parameterOrder.Split(' ');
                            }

                            foreach (WsdlBindingSoapBody body in opSec.extensions)
                            {
                                if (body.namespaceUri != null || body.namespaceUri.Length > 0)
                                    methodInfo.inputMethodNameNs = body.namespaceUri;
                            }
                        }
                        else if (MatchingStrings(opSec.elementName, s_outputString))
                        {
                            foreach (WsdlBindingSoapBody body in opSec.extensions)
                            {
                                if (body.namespaceUri != null || body.namespaceUri.Length > 0)
                                    methodInfo.outputMethodNameNs = body.namespaceUri;
                            }
                        }
                    }

                    /*
                    if (portTypeOp == null)
                    {
                    throw new SUDSParserException(
                    String.Format(CoreChannel.GetResourceString("Remoting_Suds_WsdlInvalidPortType"),
                    binding.type));
                    }
                    */

                    if (portTypeOp != null)
                    {

                        foreach (WsdlPortTypeOperationContent content in portTypeOp.contents)
                        {
                            if (MatchingStrings(content.element, s_inputString))
                            {
                                methodInfo.inputMethodName = content.message;
                                if (methodInfo.inputMethodNameNs == null)
                                    methodInfo.inputMethodNameNs = content.messageNs;
                                WsdlMessage message = (WsdlMessage)wsdlMessages[content.message];
                                if (message == null)
                                {
                                    throw new SUDSParserException(
                                                                 String.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_WsdlMissingMessage"),
                                                                               content.message));
                                }
                                else
                                {
                                    if (message.parts != null)
                                    {
                                        methodInfo.inputNames = new String[message.parts.Count];
                                        methodInfo.inputNamesNs = new String[message.parts.Count];
                                        methodInfo.inputElements = new String[message.parts.Count];
                                        methodInfo.inputElementsNs = new String[message.parts.Count];
                                        methodInfo.inputTypes = new String[message.parts.Count];
                                        methodInfo.inputTypesNs = new String[message.parts.Count];
                                        for (int ip=0; ip<message.parts.Count; ip++)
                                        {
                                            methodInfo.inputNames[ip] = ((WsdlMessagePart)message.parts[ip]).name;
                                            methodInfo.inputNamesNs[ip] = ((WsdlMessagePart)message.parts[ip]).nameNs;
                                            AddNewNamespace(methodInfo.inputNamesNs[ip]);
                                            methodInfo.inputElements[ip] = ((WsdlMessagePart)message.parts[ip]).element;
                                            methodInfo.inputElementsNs[ip] = ((WsdlMessagePart)message.parts[ip]).elementNs;
                                            AddNewNamespace(methodInfo.inputElementsNs[ip]);
                                            methodInfo.inputTypes[ip] = ((WsdlMessagePart)message.parts[ip]).typeName;
                                            methodInfo.inputTypesNs[ip] = ((WsdlMessagePart)message.parts[ip]).typeNameNs;
                                            AddNewNamespace(methodInfo.inputTypesNs[ip]);
                                            if (methodInfo.bProperty && methodInfo.inputTypes[ip] != null && methodInfo.propertyType == null)
                                            {
                                                methodInfo.propertyType = methodInfo.inputTypes[ip];
                                                methodInfo.propertyNs = methodInfo.inputTypesNs[ip];
                                                AddNewNamespace(methodInfo.propertyNs);
                                            }

                                        }
                                    }
                                }
                            }
                            else if (MatchingStrings(content.element, s_outputString))
                            {
                                methodInfo.outputMethodName = content.message;
                                if (methodInfo.outputMethodNameNs == null)
                                    methodInfo.outputMethodNameNs = content.messageNs;
                                WsdlMessage message = (WsdlMessage)wsdlMessages[content.message];
                                if (message == null)
                                {
                                    throw new SUDSParserException(
                                                                 String.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_WsdlMissingMessage"),
                                                                               content.message));
                                }
                                else
                                {
                                    if (message.parts != null)
                                    {
                                        methodInfo.outputNames = new String[message.parts.Count];
                                        methodInfo.outputNamesNs = new String[message.parts.Count];
                                        methodInfo.outputElements = new String[message.parts.Count];
                                        methodInfo.outputElementsNs = new String[message.parts.Count];
                                        methodInfo.outputTypes = new String[message.parts.Count];
                                        methodInfo.outputTypesNs = new String[message.parts.Count];
                                        for (int ip=0; ip<message.parts.Count; ip++)
                                        {
                                            methodInfo.outputNames[ip] = ((WsdlMessagePart)message.parts[ip]).name;
                                            methodInfo.outputNamesNs[ip] = ((WsdlMessagePart)message.parts[ip]).nameNs;
                                            AddNewNamespace(methodInfo.outputNamesNs[ip]);
                                            methodInfo.outputElements[ip] = ((WsdlMessagePart)message.parts[ip]).element;
                                            methodInfo.outputElementsNs[ip] = ((WsdlMessagePart)message.parts[ip]).elementNs;
                                            AddNewNamespace(methodInfo.outputElementsNs[ip]);
                                            methodInfo.outputTypes[ip] = ((WsdlMessagePart)message.parts[ip]).typeName;
                                            methodInfo.outputTypesNs[ip] = ((WsdlMessagePart)message.parts[ip]).typeNameNs;
                                            AddNewNamespace(methodInfo.outputTypesNs[ip]);
                                            if (methodInfo.bProperty && methodInfo.outputTypes[ip] != null && methodInfo.propertyType == null)
                                            {
                                                methodInfo.propertyType = methodInfo.outputTypes[ip];
                                                methodInfo.propertyNs = methodInfo.outputTypesNs[ip];
                                                AddNewNamespace(methodInfo.outputTypesNs[ip]);
                                            }
                                        }
                                    }
                                }
                            }
                            else
                                throw new SUDSParserException(
                                                             String.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_WsdlInvalidPortType"),
                                                                           content.element));
                        }
                        //methodInfo.Dump();
                    } //no porttype
                }
            }
            return methodInfos;
        }
Beispiel #2
0
        private void ResolveWsdlNestedType(WsdlBinding binding, WsdlBindingSuds suds, WsdlBindingSudsNestedType nested)
        {
            Util.Log("WsdlParser.ResolveWsdlNestedType "+binding.name+" ns "+binding.parsingNamespace.Namespace+" suds "+suds.typeName+" nestedName "+nested.name+" nestedTypeName "+nested.typeName);
            String className = suds.typeName;
            String ns = nested.ns;
            String nestedName = nested.name;
            String nestedTypeName = nested.typeName;
            if (suds.ns != ns)
            {
                throw new SUDSParserException(
                                             String.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_CantResolveNestedTypeNS"),
                                                           suds.typeName, suds.ns));
            }

            URTNamespace sudsNamespace = AddNewNamespace(suds.ns);

            URTComplexType outerType = sudsNamespace.LookupComplexType(suds.typeName);
            if (outerType == null)
            {
                throw new SUDSParserException(
                                             String.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_CantResolveNestedType"),
                                                           suds.typeName, suds.ns));
            }

            BaseType innerType = sudsNamespace.LookupType(nested.typeName);
            if (innerType == null)
            {
                // Can be URTSimpleType for Enum
                Util.Log("WsdlParser.ResolveWsdlNestedType cann't find inner type "+nested.typeName+" className "+className+" ns "+ns);

                innerType = sudsNamespace.LookupComplexType(nested.typeName);
                if (innerType == null)
                {
                    innerType = new URTComplexType(nested.typeName, sudsNamespace.Name, sudsNamespace.Namespace, sudsNamespace.EncodedNS, _blockDefault ,false, false, this, sudsNamespace);
                    sudsNamespace.AddComplexType((URTComplexType)innerType);
                }
            }


            innerType.bNestedType = true;
            innerType.NestedTypeName = nested.name;
            innerType.FullNestedTypeName = nested.typeName;
            innerType.OuterTypeName = suds.typeName;

            outerType.AddNestedType(innerType);
        }
Beispiel #3
0
 private ArrayList ResolveWsdlAddress(WsdlBinding binding)
 {
     Util.Log("WsdlParser.ResolveWsdlAddress "+binding.name);            
     ArrayList serviceEndpoints = null;
     if (_bWrappedProxy)
     {
         foreach (WsdlService service in wsdlServices)
         {
             WsdlServicePort port = (WsdlServicePort)service.ports[binding.name];
             if (port != null)
             {
                 serviceEndpoints = port.locations;
                 break;
             }
             if (serviceEndpoints != null)
                 break;
         }
     }
     return serviceEndpoints;
 }
Beispiel #4
0
        private void ResolveWsdlClass(WsdlBinding binding, WsdlBindingSuds suds, bool bFirstSuds)
        {
            // bFirstSuds is true then the suds class is the class for the binding. 
            // The other suds are additional class without bindings in the same namespace.
            Util.Log("WsdlParser.ResolveWsdlClass suds "+suds);
            URTComplexType parsingComplexType;
            //URTNamespace parsingNamespace = binding.parsingNamespace;
            URTNamespace parsingNamespace;
            //URTNamespace parsingNamespace = binding.typeNs;

            if (suds != null)
            {
                Util.Log("WsdlParser.ResolveWsdlClass suds not null "+suds.elementName+" "+suds.typeName);
                // Suds
                parsingNamespace = AddNewNamespace(suds.ns);
                parsingComplexType = parsingNamespace.LookupComplexType(suds.typeName);
                if (parsingComplexType == null)
                {
                    parsingComplexType = new URTComplexType(suds.typeName, parsingNamespace.Name, parsingNamespace.Namespace, parsingNamespace.EncodedNS, _blockDefault ,false, false, this, parsingNamespace);
                    parsingNamespace.AddComplexType(parsingComplexType);
                }

                if (MatchingStrings(suds.elementName, s_structString))
                    parsingComplexType.IsValueType = true;

                parsingComplexType.SudsUse = suds.sudsUse;

                if (suds.sudsUse == SudsUse.MarshalByRef || 
                    suds.sudsUse == SudsUse.ServicedComponent
                   )
                {
                    Util.Log("WsdlParser.ResolveWsdlClass MarshalByRef IsSudsType true 1 "+suds.elementName+" "+suds.typeName);
                    parsingComplexType.IsSUDSType = true; 

                    if (_bWrappedProxy)
                        parsingComplexType.SUDSType = SUDSType.ClientProxy;
                    else
                        parsingComplexType.SUDSType = SUDSType.MarshalByRef;


                    if ((suds.extendsTypeName != null) && (suds.extendsTypeName.Length > 0))
                    {
                        URTNamespace extendsNamespace = AddNewNamespace(suds.extendsNs);                    
                        /*
                        if (extendsNamespace == null)
                            extendsNamespace = new URTNamespace(suds.extendsTypeName, this);
                            */

                        URTComplexType extendsComplexType = extendsNamespace.LookupComplexType(suds.extendsTypeName);                   
                        if (extendsComplexType == null)
                        {
                            extendsComplexType = new URTComplexType(suds.extendsTypeName, extendsNamespace.Name, extendsNamespace.Namespace, extendsNamespace.EncodedNS, _blockDefault ,true, false, this, extendsNamespace);
                            extendsNamespace.AddComplexType(extendsComplexType);
                        }
                        else
                        {
                            Util.Log("WsdlParser.ResolveWsdlClass IsSudsType true 2 "+suds.elementName+" "+suds.typeName);
                            extendsComplexType.IsSUDSType = true;
                        }

                        if (_bWrappedProxy)
                            extendsComplexType.SUDSType = SUDSType.ClientProxy;
                        else
                            extendsComplexType.SUDSType = SUDSType.MarshalByRef;

                        extendsComplexType.SudsUse = suds.sudsUse;

                        // Only top of inheritance hierarchy is marked
                        //parsingComplexType.SUDSType = SUDSType.None; 
                    }
                }

                foreach (WsdlBindingSudsNestedType nestedType in suds.nestedTypes)
                {
                    ResolveWsdlNestedType(binding, suds, nestedType);
                }
            }
            else
            {
                // No suds
                Util.Log("WsdlParser.ResolveWsdlClass no suds ");
                parsingNamespace = AddNewNamespace(binding.typeNs);
                String name = binding.name;
                int index = binding.name.IndexOf("Binding");
                if (index > 0)
                {
                    //name = Atomize(binding.name.Substring(0,index));
                    name = binding.name.Substring(0,index);
                }

                parsingComplexType = parsingNamespace.LookupComplexTypeEqual(name);
                if (parsingComplexType == null)
                {
                    parsingComplexType = new URTComplexType(name, parsingNamespace.Name, parsingNamespace.Namespace, parsingNamespace.EncodedNS, _blockDefault ,true, false, this, parsingNamespace);
                    parsingNamespace.AddComplexType(parsingComplexType);                    
                }
                else
                {
                    Util.Log("WsdlParser.ResolveWsdlClass IsSudsType true 3 "+name);
                    parsingComplexType.IsSUDSType = true;
                }
                if (_bWrappedProxy)
                    parsingComplexType.SUDSType = SUDSType.ClientProxy;
                else
                    parsingComplexType.SUDSType = SUDSType.MarshalByRef;

                parsingComplexType.SudsUse = SudsUse.MarshalByRef;
            }

            // Resolve address
            parsingComplexType.ConnectURLs = ResolveWsdlAddress(binding);

            // Resolve extends and implements
            if (suds != null)
            {
                if (!MatchingStrings(suds.extendsTypeName, s_emptyString))
                {
                    parsingComplexType.Extends(suds.extendsTypeName, suds.extendsNs);
                }

                foreach (WsdlBindingSudsImplements impl in suds.implements)
                parsingComplexType.Implements(impl.typeName, impl.ns, this);  
            }




            if (bFirstSuds && 
                (parsingComplexType.SudsUse == SudsUse.MarshalByRef || 
                 parsingComplexType.SudsUse == SudsUse.ServicedComponent || 
                 parsingComplexType.SudsUse == SudsUse.Delegate || 
                 parsingComplexType.SudsUse == SudsUse.Interface))
            {
                // Resolve methods

                ArrayList methodInfos = ResolveWsdlMethodInfo(binding);

                foreach (WsdlMethodInfo methodInfo in methodInfos)
                {
                    if ((methodInfo.inputMethodName != null) && (methodInfo.outputMethodName != null))
                    {
                        RRMethod parsingRRMethod = new RRMethod(methodInfo, parsingComplexType);
                        parsingRRMethod.AddRequest(methodInfo.methodName, methodInfo.methodNameNs);
                        parsingRRMethod.AddResponse(methodInfo.methodName, methodInfo.methodNameNs);
                        parsingComplexType.AddMethod(parsingRRMethod);
                    }
                    else if (methodInfo.inputMethodName != null)
                    {
                        OnewayMethod parsingOWMethod = new OnewayMethod(methodInfo, parsingComplexType);
                        parsingComplexType.AddMethod(parsingOWMethod);
                        parsingOWMethod.AddMessage(methodInfo.methodName, methodInfo.methodNameNs);
                    }
                    else
                    {
                        throw new SUDSParserException(
                                                     String.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_WsdlInvalidMessage"),
                                                                   methodInfo.methodName));
                    }
                }
            }
        }
Beispiel #5
0
        private void ResolveWsdlInterface(WsdlBinding binding, WsdlBindingSuds suds)
        {
            Util.Log("WsdlParser.ResolveWsdlInterface "+binding.name+" ns "+binding.parsingNamespace.Namespace+" suds "+suds.typeName);

            URTNamespace parsingNamespace = binding.parsingNamespace;

            URTNamespace sudsNamespace = AddNewNamespace(suds.ns);
            /*
            if (sudsNamespace == null)
            {
                sudsNamespace = new URTNamespace(suds.ns, this);
            }
            */

            URTInterface parsingInterface = sudsNamespace.LookupInterface(suds.typeName);           
            if (parsingInterface == null)
            {
                parsingInterface = new URTInterface(suds.typeName, sudsNamespace.Name, sudsNamespace.Namespace, sudsNamespace.EncodedNS, this);
                sudsNamespace.AddInterface(parsingInterface);
            }

            if (suds.extendsTypeName != null)
            {
                parsingInterface.Extends(suds.extendsTypeName, suds.extendsNs, this);
            }
            foreach (WsdlBindingSudsImplements impl in suds.implements)
            {
                parsingInterface.Extends(impl.typeName, impl.ns, this);             
            }

            ArrayList methodInfos = ResolveWsdlMethodInfo(binding);

            foreach (WsdlMethodInfo methodInfo in methodInfos)          
            {
                if ((methodInfo.inputMethodName != null) && (methodInfo.outputMethodName != null))
                {
                    RRMethod parsingRRMethod = new RRMethod(methodInfo, null);
                    parsingRRMethod.AddRequest(methodInfo.methodName, methodInfo.methodNameNs);
                    parsingRRMethod.AddResponse(methodInfo.methodName, methodInfo.methodNameNs);
                    parsingInterface.AddMethod(parsingRRMethod);
                }
                else if (methodInfo.inputMethodName != null)
                {
                    OnewayMethod parsingOWMethod = new OnewayMethod(methodInfo.methodName, methodInfo.soapAction, null);
                    parsingOWMethod.AddMessage(methodInfo.methodName, methodInfo.methodNameNs);                 
                    parsingInterface.AddMethod(parsingOWMethod);
                }
                else
                {
                    throw new SUDSParserException(
                                                 String.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_WsdlInvalidMessage"),
                                                               methodInfo.methodName));

                }
            }
        }
 private void ResolveWsdlNestedType(WsdlBinding binding, WsdlBindingSuds suds, WsdlBindingSudsNestedType nested)
 {
     string typeName = suds.typeName;
     string ns = nested.ns;
     string name = nested.name;
     string text3 = nested.typeName;
     if (suds.ns != ns)
     {
         throw new SUDSParserException(string.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_CantResolveNestedTypeNS"), new object[] { suds.typeName, suds.ns }));
     }
     URTNamespace xns = this.AddNewNamespace(suds.ns);
     URTComplexType complexType = xns.LookupComplexType(suds.typeName);
     if (complexType == null)
     {
         throw new SUDSParserException(string.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_CantResolveNestedType"), new object[] { suds.typeName, suds.ns }));
     }
     BaseType type = xns.LookupType(nested.typeName);
     if (type == null)
     {
         type = xns.LookupComplexType(nested.typeName);
         if (type == null)
         {
             type = new URTComplexType(nested.typeName, xns.Name, xns.Namespace, xns.EncodedNS, this._blockDefault, false, false, this, xns);
             xns.AddComplexType((URTComplexType) type);
         }
     }
     type.bNestedType = true;
     type.NestedTypeName = nested.name;
     type.FullNestedTypeName = nested.typeName;
     type.OuterTypeName = suds.typeName;
     complexType.AddNestedType(type);
 }
Beispiel #7
0
        private void ParseWsdlBinding(URTNamespace inparsingNamespace)
        {
            Util.Log("WsdlParser.ParseWsdlBinding");
            WsdlBinding binding = new WsdlBinding();
            binding.name = LookupAttribute(s_nameString, null, true);
            //binding.nameNs = ParseQName(ref binding.name);
            binding.type = LookupAttribute(s_typeString, null, true);
            binding.typeNs = ParseQName(ref binding.type);
            URTNamespace parsingNamespace = LookupNamespace(binding.typeNs);
            if (parsingNamespace == null)
            {
                parsingNamespace = new URTNamespace(binding.typeNs, this); 
            }
            binding.parsingNamespace = parsingNamespace;
            bool bSoapBinding = false;
            bool bRpcBinding = false;
            bool bSoapEncoded = false;
            bool bSoapSuds = false;
            int curDepth = _XMLReader.Depth; 
            ReadNextXmlElement();               
            while (_XMLReader.Depth > curDepth)
            {
                String elementName = _XMLReader.LocalName;
                if (MatchingNamespace(s_wsdlSoapNamespaceString) &&
                    MatchingStrings(elementName, s_bindingString))
                {
                    bSoapBinding = true;
                    WsdlBindingSoapBinding sb = new WsdlBindingSoapBinding();
                    sb.style = LookupAttribute(s_styleString, null, true);
                    if (sb.style == "rpc")
                        bRpcBinding = true;

                    /*
                    if (sb.style == "document")
                    {
                        throw new SUDSParserException(
                            String.Format(CoreChannel.GetResourceString("Remoting_Suds_SoapStyleNotSupported"),
                                          sb.style));
                    }
                    */

                    sb.transport = LookupAttribute(s_transportString, null, true);
                    binding.soapBinding = sb;
                    ReadNextXmlElement();
                    continue;                   
                }
                else if (MatchingNamespace(s_wsdlSudsNamespaceString))
                {
                    bSoapSuds = true;
                    if (MatchingStrings(elementName, s_classString) || MatchingStrings(elementName, s_structString))
                    {
                        WsdlBindingSuds suds = new WsdlBindingSuds();
                        suds.elementName = elementName;
                        suds.typeName = LookupAttribute(s_typeString, null, true);
                        suds.ns = ParseQName(ref suds.typeName);
                        suds.extendsTypeName = LookupAttribute(s_extendsString, null, false);
                        String use = LookupAttribute(s_rootTypeString, null, false);
                        suds.sudsUse = ProcessSudsUse(use, elementName);
                        if (!MatchingStrings(suds.extendsTypeName, s_emptyString))
                            suds.extendsNs = ParseQName(ref suds.extendsTypeName);
                        ParseWsdlBindingSuds(suds);
                        binding.suds.Add(suds);
                        continue;                       
                    }
                    else if (MatchingStrings(elementName, s_interfaceString))
                    {
                        WsdlBindingSuds suds = new WsdlBindingSuds();                       
                        suds.elementName = elementName; //Atomize("interface");
                        suds.typeName = LookupAttribute(s_typeString, null, true);
                        suds.ns = ParseQName(ref suds.typeName);        
                        String use = LookupAttribute(s_rootTypeString, null, false);
                        suds.sudsUse = ProcessSudsUse(use, elementName);
                        ParseWsdlBindingSuds(suds);
                        binding.suds.Add(suds);
                        continue;                       
                    }
                }
                else if (MatchingNamespace(s_wsdlNamespaceString) &&
                         MatchingStrings(elementName, s_operationString))
                {
                    WsdlBindingOperation op = new WsdlBindingOperation();
                    op.name = LookupAttribute(s_nameString, null, true); 
                    op.nameNs = _parsingInput.TargetNS;
                    ParseWsdlBindingOperation(op, ref bRpcBinding, ref bSoapEncoded);
                    binding.operations.Add(op);
                    continue;                   
                }

                // Ignore others elements such as annotations
                SkipXmlElement();
            }
            if (bSoapBinding && bRpcBinding && bSoapEncoded || bSoapSuds)
                wsdlBindings.Add(binding);
        }
 private ArrayList ResolveWsdlMethodInfo(WsdlBinding binding)
 {
     ArrayList list = new ArrayList(10);
     Hashtable hashtable = new Hashtable(3);
     for (int i = 0; i < binding.operations.Count; i++)
     {
         bool flag = false;
         bool flag2 = false;
         WsdlBindingOperation operation = (WsdlBindingOperation) binding.operations[i];
         if (operation.soapOperation == null)
         {
             continue;
         }
         WsdlMethodInfo info = new WsdlMethodInfo {
             methodName = operation.name,
             methodNameNs = operation.nameNs,
             methodAttributes = operation.methodAttributes
         };
         this.AddNewNamespace(operation.nameNs);
         WsdlBindingSoapOperation soapOperation = operation.soapOperation;
         if (info.methodName.StartsWith("get_", StringComparison.Ordinal) && (info.methodName.Length > 4))
         {
             flag = true;
         }
         else if (info.methodName.StartsWith("set_", StringComparison.Ordinal) && (info.methodName.Length > 4))
         {
             flag2 = true;
         }
         if (flag || flag2)
         {
             bool flag3 = false;
             string str = info.methodName.Substring(4);
             WsdlMethodInfo info2 = (WsdlMethodInfo) hashtable[str];
             if (info2 == null)
             {
                 hashtable[str] = info;
                 list.Add(info);
                 info2 = info;
                 info.propertyName = str;
                 info.bProperty = true;
                 flag3 = true;
             }
             if (flag)
             {
                 info2.bGet = true;
                 info2.soapActionGet = soapOperation.soapAction;
             }
             else
             {
                 info2.bSet = true;
                 info2.soapActionSet = soapOperation.soapAction;
             }
             if (flag3)
             {
                 goto Label_016C;
             }
             continue;
         }
         list.Add(info);
     Label_016C:
         info.soapAction = soapOperation.soapAction;
         WsdlPortType type = (WsdlPortType) this.wsdlPortTypes[binding.type];
         if ((type == null) || (type.operations.Count != binding.operations.Count))
         {
             throw new SUDSParserException(string.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_WsdlInvalidPortType"), new object[] { binding.type }));
         }
         WsdlPortTypeOperation operation3 = null;
         foreach (WsdlBindingOperationSection section in operation.sections)
         {
             if (MatchingStrings(section.elementName, s_inputString))
             {
                 operation3 = (WsdlPortTypeOperation) type.sections[section.name];
                 if (operation3 == null)
                 {
                     int length = section.name.LastIndexOf("Request");
                     if (length > 0)
                     {
                         string str2 = section.name.Substring(0, length);
                         operation3 = (WsdlPortTypeOperation) type.sections[str2];
                     }
                 }
                 if (((operation3 != null) && (operation3.parameterOrder != null)) && (operation3.parameterOrder.Length > 0))
                 {
                     info.paramNamesOrder = operation3.parameterOrder.Split(new char[] { ' ' });
                 }
                 foreach (WsdlBindingSoapBody body in section.extensions)
                 {
                     if ((body.namespaceUri != null) || (body.namespaceUri.Length > 0))
                     {
                         info.inputMethodNameNs = body.namespaceUri;
                     }
                 }
             }
             else if (MatchingStrings(section.elementName, s_outputString))
             {
                 foreach (WsdlBindingSoapBody body2 in section.extensions)
                 {
                     if ((body2.namespaceUri != null) || (body2.namespaceUri.Length > 0))
                     {
                         info.outputMethodNameNs = body2.namespaceUri;
                     }
                 }
             }
         }
         if (operation3 != null)
         {
             foreach (WsdlPortTypeOperationContent content in operation3.contents)
             {
                 if (MatchingStrings(content.element, s_inputString))
                 {
                     info.inputMethodName = content.message;
                     if (info.inputMethodNameNs == null)
                     {
                         info.inputMethodNameNs = content.messageNs;
                     }
                     WsdlMessage message = (WsdlMessage) this.wsdlMessages[content.message];
                     if (message == null)
                     {
                         throw new SUDSParserException(string.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_WsdlMissingMessage"), new object[] { content.message }));
                     }
                     if (message.parts != null)
                     {
                         info.inputNames = new string[message.parts.Count];
                         info.inputNamesNs = new string[message.parts.Count];
                         info.inputElements = new string[message.parts.Count];
                         info.inputElementsNs = new string[message.parts.Count];
                         info.inputTypes = new string[message.parts.Count];
                         info.inputTypesNs = new string[message.parts.Count];
                         for (int j = 0; j < message.parts.Count; j++)
                         {
                             info.inputNames[j] = ((WsdlMessagePart) message.parts[j]).name;
                             info.inputNamesNs[j] = ((WsdlMessagePart) message.parts[j]).nameNs;
                             this.AddNewNamespace(info.inputNamesNs[j]);
                             info.inputElements[j] = ((WsdlMessagePart) message.parts[j]).element;
                             info.inputElementsNs[j] = ((WsdlMessagePart) message.parts[j]).elementNs;
                             this.AddNewNamespace(info.inputElementsNs[j]);
                             info.inputTypes[j] = ((WsdlMessagePart) message.parts[j]).typeName;
                             info.inputTypesNs[j] = ((WsdlMessagePart) message.parts[j]).typeNameNs;
                             this.AddNewNamespace(info.inputTypesNs[j]);
                             if ((info.bProperty && (info.inputTypes[j] != null)) && (info.propertyType == null))
                             {
                                 info.propertyType = info.inputTypes[j];
                                 info.propertyNs = info.inputTypesNs[j];
                                 this.AddNewNamespace(info.propertyNs);
                             }
                         }
                     }
                 }
                 else
                 {
                     if (!MatchingStrings(content.element, s_outputString))
                     {
                         throw new SUDSParserException(string.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_WsdlInvalidPortType"), new object[] { content.element }));
                     }
                     info.outputMethodName = content.message;
                     if (info.outputMethodNameNs == null)
                     {
                         info.outputMethodNameNs = content.messageNs;
                     }
                     WsdlMessage message2 = (WsdlMessage) this.wsdlMessages[content.message];
                     if (message2 == null)
                     {
                         throw new SUDSParserException(string.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_WsdlMissingMessage"), new object[] { content.message }));
                     }
                     if (message2.parts != null)
                     {
                         info.outputNames = new string[message2.parts.Count];
                         info.outputNamesNs = new string[message2.parts.Count];
                         info.outputElements = new string[message2.parts.Count];
                         info.outputElementsNs = new string[message2.parts.Count];
                         info.outputTypes = new string[message2.parts.Count];
                         info.outputTypesNs = new string[message2.parts.Count];
                         for (int k = 0; k < message2.parts.Count; k++)
                         {
                             info.outputNames[k] = ((WsdlMessagePart) message2.parts[k]).name;
                             info.outputNamesNs[k] = ((WsdlMessagePart) message2.parts[k]).nameNs;
                             this.AddNewNamespace(info.outputNamesNs[k]);
                             info.outputElements[k] = ((WsdlMessagePart) message2.parts[k]).element;
                             info.outputElementsNs[k] = ((WsdlMessagePart) message2.parts[k]).elementNs;
                             this.AddNewNamespace(info.outputElementsNs[k]);
                             info.outputTypes[k] = ((WsdlMessagePart) message2.parts[k]).typeName;
                             info.outputTypesNs[k] = ((WsdlMessagePart) message2.parts[k]).typeNameNs;
                             this.AddNewNamespace(info.outputTypesNs[k]);
                             if ((info.bProperty && (info.outputTypes[k] != null)) && (info.propertyType == null))
                             {
                                 info.propertyType = info.outputTypes[k];
                                 info.propertyNs = info.outputTypesNs[k];
                                 this.AddNewNamespace(info.outputTypesNs[k]);
                             }
                         }
                     }
                 }
             }
         }
     }
     return list;
 }
 private void ResolveWsdlInterface(WsdlBinding binding, WsdlBindingSuds suds)
 {
     URTNamespace parsingNamespace = binding.parsingNamespace;
     URTNamespace namespace2 = this.AddNewNamespace(suds.ns);
     URTInterface iface = namespace2.LookupInterface(suds.typeName);
     if (iface == null)
     {
         iface = new URTInterface(suds.typeName, namespace2.Name, namespace2.Namespace, namespace2.EncodedNS, this);
         namespace2.AddInterface(iface);
     }
     if (suds.extendsTypeName != null)
     {
         iface.Extends(suds.extendsTypeName, suds.extendsNs, this);
     }
     foreach (WsdlBindingSudsImplements implements in suds.implements)
     {
         iface.Extends(implements.typeName, implements.ns, this);
     }
     foreach (WsdlMethodInfo info in this.ResolveWsdlMethodInfo(binding))
     {
         if ((info.inputMethodName == null) || (info.outputMethodName == null))
         {
             if (info.inputMethodName == null)
             {
                 throw new SUDSParserException(string.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_WsdlInvalidMessage"), new object[] { info.methodName }));
             }
             OnewayMethod method2 = new OnewayMethod(info.methodName, info.soapAction, null);
             method2.AddMessage(info.methodName, info.methodNameNs);
             iface.AddMethod(method2);
         }
         else
         {
             RRMethod method = new RRMethod(info, null);
             method.AddRequest(info.methodName, info.methodNameNs);
             method.AddResponse(info.methodName, info.methodNameNs);
             iface.AddMethod(method);
         }
     }
 }
 private void ResolveWsdlClass(WsdlBinding binding, WsdlBindingSuds suds, bool bFirstSuds)
 {
     URTComplexType complexType;
     URTNamespace namespace2;
     if (suds != null)
     {
         namespace2 = this.AddNewNamespace(suds.ns);
         complexType = namespace2.LookupComplexType(suds.typeName);
         if (complexType == null)
         {
             complexType = new URTComplexType(suds.typeName, namespace2.Name, namespace2.Namespace, namespace2.EncodedNS, this._blockDefault, false, false, this, namespace2);
             namespace2.AddComplexType(complexType);
         }
         if (MatchingStrings(suds.elementName, s_structString))
         {
             complexType.IsValueType = true;
         }
         complexType.SudsUse = suds.sudsUse;
         if ((suds.sudsUse == SudsUse.MarshalByRef) || (suds.sudsUse == SudsUse.ServicedComponent))
         {
             complexType.IsSUDSType = true;
             if (this._bWrappedProxy)
             {
                 complexType.SUDSType = SUDSType.ClientProxy;
             }
             else
             {
                 complexType.SUDSType = SUDSType.MarshalByRef;
             }
             if ((suds.extendsTypeName != null) && (suds.extendsTypeName.Length > 0))
             {
                 URTNamespace xns = this.AddNewNamespace(suds.extendsNs);
                 URTComplexType type = xns.LookupComplexType(suds.extendsTypeName);
                 if (type == null)
                 {
                     type = new URTComplexType(suds.extendsTypeName, xns.Name, xns.Namespace, xns.EncodedNS, this._blockDefault, true, false, this, xns);
                     xns.AddComplexType(type);
                 }
                 else
                 {
                     type.IsSUDSType = true;
                 }
                 if (this._bWrappedProxy)
                 {
                     type.SUDSType = SUDSType.ClientProxy;
                 }
                 else
                 {
                     type.SUDSType = SUDSType.MarshalByRef;
                 }
                 type.SudsUse = suds.sudsUse;
             }
         }
         foreach (WsdlBindingSudsNestedType type3 in suds.nestedTypes)
         {
             this.ResolveWsdlNestedType(binding, suds, type3);
         }
     }
     else
     {
         namespace2 = this.AddNewNamespace(binding.typeNs);
         string name = binding.name;
         int index = binding.name.IndexOf("Binding");
         if (index > 0)
         {
             name = binding.name.Substring(0, index);
         }
         complexType = namespace2.LookupComplexTypeEqual(name);
         if (complexType == null)
         {
             complexType = new URTComplexType(name, namespace2.Name, namespace2.Namespace, namespace2.EncodedNS, this._blockDefault, true, false, this, namespace2);
             namespace2.AddComplexType(complexType);
         }
         else
         {
             complexType.IsSUDSType = true;
         }
         if (this._bWrappedProxy)
         {
             complexType.SUDSType = SUDSType.ClientProxy;
         }
         else
         {
             complexType.SUDSType = SUDSType.MarshalByRef;
         }
         complexType.SudsUse = SudsUse.MarshalByRef;
     }
     complexType.ConnectURLs = this.ResolveWsdlAddress(binding);
     if (suds != null)
     {
         if (!MatchingStrings(suds.extendsTypeName, s_emptyString))
         {
             complexType.Extends(suds.extendsTypeName, suds.extendsNs);
         }
         foreach (WsdlBindingSudsImplements implements in suds.implements)
         {
             complexType.Implements(implements.typeName, implements.ns, this);
         }
     }
     if (bFirstSuds && (((complexType.SudsUse == SudsUse.MarshalByRef) || (complexType.SudsUse == SudsUse.ServicedComponent)) || ((complexType.SudsUse == SudsUse.Delegate) || (complexType.SudsUse == SudsUse.Interface))))
     {
         foreach (WsdlMethodInfo info in this.ResolveWsdlMethodInfo(binding))
         {
             if ((info.inputMethodName == null) || (info.outputMethodName == null))
             {
                 if (info.inputMethodName == null)
                 {
                     throw new SUDSParserException(string.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_WsdlInvalidMessage"), new object[] { info.methodName }));
                 }
                 OnewayMethod method2 = new OnewayMethod(info, complexType);
                 complexType.AddMethod(method2);
                 method2.AddMessage(info.methodName, info.methodNameNs);
             }
             else
             {
                 RRMethod method = new RRMethod(info, complexType);
                 method.AddRequest(info.methodName, info.methodNameNs);
                 method.AddResponse(info.methodName, info.methodNameNs);
                 complexType.AddMethod(method);
             }
         }
     }
 }
 private ArrayList ResolveWsdlAddress(WsdlBinding binding)
 {
     ArrayList list = null;
     if (this._bWrappedProxy)
     {
         foreach (WsdlService service in this.wsdlServices)
         {
             WsdlServicePort port = (WsdlServicePort) service.ports[binding.name];
             if (port != null)
             {
                 return port.locations;
             }
             if (list != null)
             {
                 return list;
             }
         }
     }
     return list;
 }
 private void ParseWsdlBinding(URTNamespace inparsingNamespace)
 {
     WsdlBinding binding;
     binding = new WsdlBinding {
         name = this.LookupAttribute(s_nameString, null, true),
         type = this.LookupAttribute(s_typeString, null, true),
         typeNs = this.ParseQName(ref binding.type)
     };
     URTNamespace namespace2 = this.LookupNamespace(binding.typeNs);
     if (namespace2 == null)
     {
         namespace2 = new URTNamespace(binding.typeNs, this);
     }
     binding.parsingNamespace = namespace2;
     bool flag = false;
     bool bRpcBinding = false;
     bool bSoapEncoded = false;
     bool flag4 = false;
     int depth = this._XMLReader.Depth;
     this.ReadNextXmlElement();
     while (this._XMLReader.Depth > depth)
     {
         string localName = this._XMLReader.LocalName;
         if (this.MatchingNamespace(s_wsdlSoapNamespaceString) && MatchingStrings(localName, s_bindingString))
         {
             flag = true;
             WsdlBindingSoapBinding binding2 = new WsdlBindingSoapBinding {
                 style = this.LookupAttribute(s_styleString, null, true)
             };
             if (binding2.style == "rpc")
             {
                 bRpcBinding = true;
             }
             binding2.transport = this.LookupAttribute(s_transportString, null, true);
             binding.soapBinding = binding2;
             this.ReadNextXmlElement();
             continue;
         }
         if (this.MatchingNamespace(s_wsdlSudsNamespaceString))
         {
             flag4 = true;
             if (MatchingStrings(localName, s_classString) || MatchingStrings(localName, s_structString))
             {
                 WsdlBindingSuds suds;
                 suds = new WsdlBindingSuds {
                     elementName = localName,
                     typeName = this.LookupAttribute(s_typeString, null, true),
                     ns = this.ParseQName(ref suds.typeName),
                     extendsTypeName = this.LookupAttribute(s_extendsString, null, false)
                 };
                 string use = this.LookupAttribute(s_rootTypeString, null, false);
                 suds.sudsUse = this.ProcessSudsUse(use, localName);
                 if (!MatchingStrings(suds.extendsTypeName, s_emptyString))
                 {
                     suds.extendsNs = this.ParseQName(ref suds.extendsTypeName);
                 }
                 this.ParseWsdlBindingSuds(suds);
                 binding.suds.Add(suds);
             }
             else
             {
                 WsdlBindingSuds suds2;
                 if (!MatchingStrings(localName, s_interfaceString))
                 {
                     goto Label_02CC;
                 }
                 suds2 = new WsdlBindingSuds {
                     elementName = localName,
                     typeName = this.LookupAttribute(s_typeString, null, true),
                     ns = this.ParseQName(ref suds2.typeName)
                 };
                 string str3 = this.LookupAttribute(s_rootTypeString, null, false);
                 suds2.sudsUse = this.ProcessSudsUse(str3, localName);
                 this.ParseWsdlBindingSuds(suds2);
                 binding.suds.Add(suds2);
             }
             continue;
         }
         if (this.MatchingNamespace(s_wsdlNamespaceString) && MatchingStrings(localName, s_operationString))
         {
             WsdlBindingOperation op = new WsdlBindingOperation {
                 name = this.LookupAttribute(s_nameString, null, true),
                 nameNs = this._parsingInput.TargetNS
             };
             this.ParseWsdlBindingOperation(op, ref bRpcBinding, ref bSoapEncoded);
             binding.operations.Add(op);
             continue;
         }
     Label_02CC:
         this.SkipXmlElement();
     }
     if (((flag && bRpcBinding) && bSoapEncoded) || flag4)
     {
         this.wsdlBindings.Add(binding);
     }
 }