private LookupNamespace ( String name ) : URTNamespace | ||
name | String | |
Результат | URTNamespace |
internal void ResolveTypes(WsdlParser parser) { Util.Log("URTComplexType.ResolveTypes "+Name+" _baseTypeName "+_baseTypeName+" IsSUDSType "+IsSUDSType); String baseTypeNS = null; String baseTypeAssemName = null; if (IsArray()) { ResolveArray(); return; } if (IsSUDSType) { // BaseType == null; if (_sudsType == SUDSType.None) { if (_parser._bWrappedProxy) _sudsType = SUDSType.ClientProxy; else _sudsType = SUDSType.MarshalByRef; } } if (_baseTypeName != null) { Util.Log("URTComplexType.ResolveTypes 1 "); UrtType urtType = parser.IsURTExportedType(_baseTypeXmlNS, out baseTypeNS, out baseTypeAssemName); if (urtType == UrtType.UrtSystem || baseTypeNS.StartsWith("System", StringComparison.Ordinal)) { _baseType = new SystemType(_baseTypeName, _baseTypeXmlNS, baseTypeNS, baseTypeAssemName); } else { URTNamespace ns = parser.LookupNamespace(_baseTypeXmlNS); if (ns == null) { throw new SUDSParserException( String.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_CantResolveSchemaNS"), _baseTypeXmlNS, _baseTypeName)); } _baseType = ns.LookupComplexType(_baseTypeName); if (_baseType == null) { _baseType = new SystemType(_baseTypeName, _baseTypeXmlNS, baseTypeNS, baseTypeAssemName); /* throw new SUDSParserException( String.Format(CoreChannel.GetResourceString("Remoting_Suds_CantResolveTypeInNS"), _baseTypeName, _baseTypeXmlNS)); */ } } } // Top of inheritance hiearchy for a Wrapped proxy is RemotingClientProxy if (IsSUDSType) { if (_parser._bWrappedProxy) { if (_baseTypeName == null || _baseType is SystemType) { _baseTypeName = "RemotingClientProxy"; _baseTypeXmlNS = SoapServices.CodeXmlNamespaceForClrTypeNamespace("System.Runtime.Remoting","System.Runtime.Remoting"); baseTypeNS = "System.Runtime.Remoting.Services"; baseTypeAssemName = "System.Runtime.Remoting"; _baseType = new SystemType(_baseTypeName, _baseTypeXmlNS, baseTypeNS, baseTypeAssemName); } } else if (_baseTypeName == null) { _baseTypeName = "MarshalByRefObject"; _baseTypeXmlNS = SoapServices.CodeXmlNamespaceForClrTypeNamespace("System", null); baseTypeNS = "System"; baseTypeAssemName = null; _baseType = new SystemType(_baseTypeName, _baseTypeXmlNS, baseTypeNS, baseTypeAssemName); } } else if (_baseType == null) { Util.Log("URTComplexType.ResolveTypes 5 "); _baseType = new SystemType("Object", SoapServices.CodeXmlNamespaceForClrTypeNamespace("System", null), "System", null); } for (int i=0;i<_implIFaceNames.Count;i=i+2) { String implIFaceName = (String) _implIFaceNames[i]; String implIFaceXmlNS = (String) _implIFaceNames[i+1]; String implIFaceNS, implIFaceAssemName; BaseInterface iFace; UrtType iType = parser.IsURTExportedType(implIFaceXmlNS, out implIFaceNS, out implIFaceAssemName); if (iType == UrtType.UrtSystem)// && implIFaceNS.StartsWith("System", StringComparison.Ordinal)) { iFace = new SystemInterface(implIFaceName, implIFaceXmlNS, implIFaceNS, parser, implIFaceAssemName); } else { URTNamespace ns = parser.LookupNamespace(implIFaceXmlNS); if (ns == null) { throw new SUDSParserException( String.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_CantResolveSchemaNS"), implIFaceXmlNS, implIFaceName)); } iFace = ns.LookupInterface(implIFaceName); if (iFace == null) { throw new SUDSParserException( String.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_CantResolveTypeInNS"), implIFaceName, implIFaceXmlNS)); } } _implIFaces.Add(iFace); } for (int i=0;i<_methods.Count;i++) ((URTMethod) _methods[i]).ResolveTypes(parser); }
internal bool Resolve(WsdlParser parser){ Util.Log("ElementDecl.Resolve "+TypeName+" "+TypeNS); // Return immediately for element declaration of primitive types if (_bPrimitive) return true; // Lookup the type from the element declaration URTNamespace typeNS = parser.LookupNamespace(TypeNS); if (typeNS == null) { throw new SUDSParserException( String.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_CantResolveSchemaNS"), TypeNS, TypeName)); } BaseType type = typeNS.LookupType(TypeName); if (type == null) { // Because there might be multiple bindings and some not soap, there can be failures in the non soap bindings. return false; /* throw new SUDSParserException( String.Format(CoreChannel.GetResourceString("Remoting_Suds_CantResolveTypeInNS"), TypeName, TypeNS)); */ } type.ElementName = Name; type.ElementNS = Namespace; return true; }
// Helper method used by Resolve protected void ResolveWsdlParams(WsdlParser parser, String targetNS, String targetName, bool bRequest, WsdlMethodInfo wsdlMethodInfo) { Util.Log("URTMethod.ResolveWsdlParams targetName "+targetName+" targetNS "+targetNS+" bRequest "+bRequest+" wsdlMethodInfo "+wsdlMethodInfo); _wsdlMethodInfo = wsdlMethodInfo; _paramNamesOrder = _wsdlMethodInfo.paramNamesOrder; int length; if (_wsdlMethodInfo.bProperty) length = 1; else if (bRequest) length = wsdlMethodInfo.inputNames.Length; else length = wsdlMethodInfo.outputNames.Length; for (int i=0; i<length; i++) { String element = null; String elementNs = null; String name = null; String nameNs = null; String typeName = null;; String typeNameNs = null;; URTParamType pType; if (_wsdlMethodInfo.bProperty) { typeName = wsdlMethodInfo.propertyType; typeNameNs = wsdlMethodInfo.propertyNs; pType = URTParamType.OUT; } else if (bRequest && !_wsdlMethodInfo.bProperty) { element = wsdlMethodInfo.inputElements[i]; elementNs = wsdlMethodInfo.inputElementsNs[i]; name = wsdlMethodInfo.inputNames[i]; nameNs = wsdlMethodInfo.inputNamesNs[i]; typeName = wsdlMethodInfo.inputTypes[i]; typeNameNs = wsdlMethodInfo.inputTypesNs[i]; pType = URTParamType.IN; } else { element = wsdlMethodInfo.outputElements[i]; elementNs = wsdlMethodInfo.outputElementsNs[i]; name = wsdlMethodInfo.outputNames[i]; nameNs = wsdlMethodInfo.outputNamesNs[i]; typeName = wsdlMethodInfo.outputTypes[i]; typeNameNs = wsdlMethodInfo.outputTypesNs[i]; pType = URTParamType.OUT; } String actualType; String actualTypeNs; if ((element == null) || element.Length == 0) { actualType = typeName; actualTypeNs = typeNameNs; } else { actualType = element; actualTypeNs = elementNs; } Util.Log("URTMethod.ResolveWsdlParams actualType "+actualType+" actualTypeNs "+actualTypeNs); URTNamespace ns = parser.LookupNamespace(actualTypeNs); if (ns == null) { throw new SUDSParserException( String.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_CantResolveSchemaNS"), actualTypeNs, actualType)); } URTComplexType ct = ns.LookupComplexType(actualType); if (ct != null && ct.IsArray()) { if (ct.GetArray() == null) ct.ResolveArray(); String arrayName = ct.GetArray(); URTNamespace arrayNS = ct.GetArrayNS(); AddParam(new URTParam(name, arrayName, arrayNS.Name, arrayNS.EncodedNS, pType, true, parser, arrayNS)); } else { Util.Log("URTMethod.ResolveWsdlParams actualType 2 UrtType "+((Enum)ns.UrtType).ToString()); if (ns.UrtType == UrtType.Xsd) { String clrtypeName = parser.MapSchemaTypesToCSharpTypes(actualType); AddParam(new URTParam(name, clrtypeName, ns.Namespace, ns.EncodedNS, pType, true, parser, ns)); } else { String foundTypeName = null; if (ct != null) { foundTypeName = ct.Name; } else { URTSimpleType stype = ns.LookupSimpleType(actualType); if (stype != null) { foundTypeName = stype.Name; } else { foundTypeName = actualType; /* throw new SUDSParserException( String.Format(CoreChannel.GetResourceString("Remoting_Suds_CantResolveTypeInNS"), actualType, ns.Name)); */ } } //typeNS.RemoveComplexType(type); AddParam(new URTParam(name, foundTypeName, ns.Namespace, ns.EncodedNS, pType, true, parser, ns)); } } } }
internal void ResolveTypes(WsdlParser parser) { Util.Log("URTInterface.ResolveTypes "+Name); for (int i=0;i<_baseIFaceNames.Count;i=i+2) { String baseIFaceName = (String) _baseIFaceNames[i]; String baseIFaceXmlNS = (String) _baseIFaceNames[i+1]; String baseIFaceNS, baseIFaceAssemName; BaseInterface iFace; UrtType iType = parser.IsURTExportedType(baseIFaceXmlNS, out baseIFaceNS, out baseIFaceAssemName); Util.Log("URTInterface.ResolveTypes Is System "+Name+" iType "+((Enum)iType).ToString()+" baseIFaceNS "+baseIFaceNS); if ((iType != UrtType.Interop) && baseIFaceNS.StartsWith("System", StringComparison.Ordinal)) { iFace = new SystemInterface(baseIFaceName, baseIFaceXmlNS, baseIFaceNS, _parser, baseIFaceAssemName); } else { URTNamespace ns = parser.LookupNamespace(baseIFaceXmlNS); if (ns == null) { throw new SUDSParserException( String.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_CantResolveSchemaNS"), baseIFaceXmlNS, baseIFaceName)); } iFace = ns.LookupInterface(baseIFaceName); if (iFace == null) { throw new SUDSParserException( String.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_CantResolveTypeInNS"), baseIFaceName, baseIFaceXmlNS)); } } _baseIFaces.Add(iFace); } for (int i=0;i<_methods.Count;i++) ((URTMethod) _methods[i]).ResolveTypes(parser); }
protected void ResolveWsdlParams(WsdlParser parser, string targetNS, string targetName, bool bRequest, WsdlParser.WsdlMethodInfo wsdlMethodInfo) { int length; this._wsdlMethodInfo = wsdlMethodInfo; this._paramNamesOrder = this._wsdlMethodInfo.paramNamesOrder; if (this._wsdlMethodInfo.bProperty) { length = 1; } else if (bRequest) { length = wsdlMethodInfo.inputNames.Length; } else { length = wsdlMethodInfo.outputNames.Length; } for (int i = 0; i < length; i++) { WsdlParser.URTParamType oUT; string str6; string str7; string str = null; string str2 = null; string name = null; string propertyType = null; string propertyNs = null; if (this._wsdlMethodInfo.bProperty) { propertyType = wsdlMethodInfo.propertyType; propertyNs = wsdlMethodInfo.propertyNs; oUT = WsdlParser.URTParamType.OUT; } else if (bRequest && !this._wsdlMethodInfo.bProperty) { str = wsdlMethodInfo.inputElements[i]; str2 = wsdlMethodInfo.inputElementsNs[i]; name = wsdlMethodInfo.inputNames[i]; string text1 = wsdlMethodInfo.inputNamesNs[i]; propertyType = wsdlMethodInfo.inputTypes[i]; propertyNs = wsdlMethodInfo.inputTypesNs[i]; oUT = WsdlParser.URTParamType.IN; } else { str = wsdlMethodInfo.outputElements[i]; str2 = wsdlMethodInfo.outputElementsNs[i]; name = wsdlMethodInfo.outputNames[i]; string text2 = wsdlMethodInfo.outputNamesNs[i]; propertyType = wsdlMethodInfo.outputTypes[i]; propertyNs = wsdlMethodInfo.outputTypesNs[i]; oUT = WsdlParser.URTParamType.OUT; } if ((str == null) || (str.Length == 0)) { str6 = propertyType; str7 = propertyNs; } else { str6 = str; str7 = str2; } WsdlParser.URTNamespace urtNamespace = parser.LookupNamespace(str7); if (urtNamespace == null) { throw new SUDSParserException(string.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_CantResolveSchemaNS"), new object[] { str7, str6 })); } WsdlParser.URTComplexType complexType = urtNamespace.LookupComplexType(str6); if ((complexType != null) && complexType.IsArray()) { if (complexType.GetArray() == null) { complexType.ResolveArray(); } string array = complexType.GetArray(); WsdlParser.URTNamespace arrayNS = complexType.GetArrayNS(); this.AddParam(new WsdlParser.URTParam(name, array, arrayNS.Name, arrayNS.EncodedNS, oUT, true, parser, arrayNS)); } else if (urtNamespace.UrtType == UrtType.Xsd) { string typeName = parser.MapSchemaTypesToCSharpTypes(str6); this.AddParam(new WsdlParser.URTParam(name, typeName, urtNamespace.Namespace, urtNamespace.EncodedNS, oUT, true, parser, urtNamespace)); } else { string str10 = null; if (complexType != null) { str10 = complexType.Name; } else { WsdlParser.URTSimpleType simpleType = urtNamespace.LookupSimpleType(str6); if (simpleType != null) { str10 = simpleType.Name; } else { str10 = str6; } } this.AddParam(new WsdlParser.URTParam(name, str10, urtNamespace.Namespace, urtNamespace.EncodedNS, oUT, true, parser, urtNamespace)); } } }
internal void ResolveTypes(WsdlParser parser) { for (int i = 0; i < this._baseIFaceNames.Count; i += 2) { string str3; string str4; WsdlParser.BaseInterface interface2; string name = (string) this._baseIFaceNames[i]; string str2 = (string) this._baseIFaceNames[i + 1]; if ((parser.IsURTExportedType(str2, out str3, out str4) != UrtType.Interop) && str3.StartsWith("System", StringComparison.Ordinal)) { interface2 = new WsdlParser.SystemInterface(name, str2, str3, this._parser, str4); } else { WsdlParser.URTNamespace namespace2 = parser.LookupNamespace(str2); if (namespace2 == null) { throw new SUDSParserException(string.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_CantResolveSchemaNS"), new object[] { str2, name })); } interface2 = namespace2.LookupInterface(name); if (interface2 == null) { throw new SUDSParserException(string.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_CantResolveTypeInNS"), new object[] { name, str2 })); } } this._baseIFaces.Add(interface2); } for (int j = 0; j < this._methods.Count; j++) { ((WsdlParser.URTMethod) this._methods[j]).ResolveTypes(parser); } }
internal void ResolveTypes(WsdlParser parser) { string ns = null; string assemName = null; if (this.IsArray()) { this.ResolveArray(); } else { if (this.IsSUDSType && (this._sudsType == System.Runtime.Remoting.MetadataServices.SUDSType.None)) { if (this._parser._bWrappedProxy) { this._sudsType = System.Runtime.Remoting.MetadataServices.SUDSType.ClientProxy; } else { this._sudsType = System.Runtime.Remoting.MetadataServices.SUDSType.MarshalByRef; } } if (this._baseTypeName != null) { if ((parser.IsURTExportedType(this._baseTypeXmlNS, out ns, out assemName) == UrtType.UrtSystem) || ns.StartsWith("System", StringComparison.Ordinal)) { this._baseType = new WsdlParser.SystemType(this._baseTypeName, this._baseTypeXmlNS, ns, assemName); } else { WsdlParser.URTNamespace namespace2 = parser.LookupNamespace(this._baseTypeXmlNS); if (namespace2 == null) { throw new SUDSParserException(string.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_CantResolveSchemaNS"), new object[] { this._baseTypeXmlNS, this._baseTypeName })); } this._baseType = namespace2.LookupComplexType(this._baseTypeName); if (this._baseType == null) { this._baseType = new WsdlParser.SystemType(this._baseTypeName, this._baseTypeXmlNS, ns, assemName); } } } if (this.IsSUDSType) { if (this._parser._bWrappedProxy) { if ((this._baseTypeName == null) || (this._baseType is WsdlParser.SystemType)) { this._baseTypeName = "RemotingClientProxy"; this._baseTypeXmlNS = SoapServices.CodeXmlNamespaceForClrTypeNamespace("System.Runtime.Remoting", "System.Runtime.Remoting"); ns = "System.Runtime.Remoting.Services"; assemName = "System.Runtime.Remoting"; this._baseType = new WsdlParser.SystemType(this._baseTypeName, this._baseTypeXmlNS, ns, assemName); } } else if (this._baseTypeName == null) { this._baseTypeName = "MarshalByRefObject"; this._baseTypeXmlNS = SoapServices.CodeXmlNamespaceForClrTypeNamespace("System", null); ns = "System"; assemName = null; this._baseType = new WsdlParser.SystemType(this._baseTypeName, this._baseTypeXmlNS, ns, assemName); } } else if (this._baseType == null) { this._baseType = new WsdlParser.SystemType("Object", SoapServices.CodeXmlNamespaceForClrTypeNamespace("System", null), "System", null); } for (int i = 0; i < this._implIFaceNames.Count; i += 2) { string str5; string str6; WsdlParser.BaseInterface interface2; string name = (string) this._implIFaceNames[i]; string str4 = (string) this._implIFaceNames[i + 1]; if (parser.IsURTExportedType(str4, out str5, out str6) == UrtType.UrtSystem) { interface2 = new WsdlParser.SystemInterface(name, str4, str5, parser, str6); } else { WsdlParser.URTNamespace namespace3 = parser.LookupNamespace(str4); if (namespace3 == null) { throw new SUDSParserException(string.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_CantResolveSchemaNS"), new object[] { str4, name })); } interface2 = namespace3.LookupInterface(name); if (interface2 == null) { throw new SUDSParserException(string.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_CantResolveTypeInNS"), new object[] { name, str4 })); } } this._implIFaces.Add(interface2); } for (int j = 0; j < this._methods.Count; j++) { ((WsdlParser.URTMethod) this._methods[j]).ResolveTypes(parser); } } }
internal bool Resolve(WsdlParser parser) { if (!this._bPrimitive) { WsdlParser.URTNamespace namespace2 = parser.LookupNamespace(this.TypeNS); if (namespace2 == null) { throw new SUDSParserException(string.Format(CultureInfo.CurrentCulture, CoreChannel.GetResourceString("Remoting_Suds_CantResolveSchemaNS"), new object[] { this.TypeNS, this.TypeName })); } WsdlParser.BaseType type = namespace2.LookupType(this.TypeName); if (type == null) { return false; } type.ElementName = this.Name; type.ElementNS = this.Namespace; } return true; }
internal void ResolveTypes(WsdlParser parser) { Util.Log("URTSimpleType.ResolveTypes "+Name); if (_baseTypeName != null) { if (_parser.IsPrimitiveType(_baseTypeXmlNS, _baseTypeName)) { if (IsEnum == false) _baseName = _parser.MapSchemaTypesToCSharpTypes(_baseTypeName); } else { URTNamespace ns = parser.LookupNamespace(_baseTypeXmlNS); if (ns == null) { throw new SUDSParserException( String.Format(CoreChannel.GetResourceString("Remoting_Suds_CantResolveSchemaNS"), _baseTypeXmlNS, _baseTypeName)); } _baseType = ns.LookupComplexType(_baseTypeName); if (_baseType == null) { throw new SUDSParserException( String.Format(CoreChannel.GetResourceString("Remoting_Suds_CantResolveTypeInNS"), _baseTypeName, _baseTypeXmlNS)); } } } for (int i=0;i<_facets.Count;i++) ((SchemaFacet) _facets[i]).ResolveTypes(parser); return; }