//
// (C) 2003 Ximian, Inc.
//
-// TODO:
-//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Reflection;
internal SoapBindingStyle SoapBindingStyle;
internal SoapBindingUse Use;
- internal XmlSerializer RequestSerializer;
- internal XmlSerializer ResponseSerializer;
-
internal HeaderInfo[] Headers;
-
+ internal HeaderInfo[] InHeaders;
+ internal HeaderInfo[] OutHeaders;
+ internal HeaderInfo[] FaultHeaders;
internal SoapExtensionRuntimeConfig[] SoapExtensions;
- private XmlMembersMapping[] _membersMapping;
+ internal XmlMembersMapping InputMembersMapping;
+ internal XmlMembersMapping OutputMembersMapping;
+ internal XmlMembersMapping InputHeaderMembersMapping;
+ internal XmlMembersMapping OutputHeaderMembersMapping;
+ internal XmlMembersMapping FaultHeaderMembersMapping;
- internal XmlMembersMapping InputMembersMapping
+ private int requestSerializerId;
+ private int responseSerializerId;
+ private int requestHeadersSerializerId = -1;
+ private int responseHeadersSerializerId = -1;
+ private int faultHeadersSerializerId = -1;
+
+ internal XmlSerializer RequestSerializer
{
- get { return _membersMapping[0]; }
+ get { return TypeStub.GetSerializer (requestSerializerId); }
}
-
- internal XmlMembersMapping OutputMembersMapping
+
+ internal XmlSerializer ResponseSerializer
+ {
+ get { return TypeStub.GetSerializer (responseSerializerId); }
+ }
+
+ internal XmlSerializer RequestHeadersSerializer
+ {
+ get { return requestHeadersSerializerId != -1 ? TypeStub.GetSerializer (requestHeadersSerializerId) : null; }
+ }
+
+ internal XmlSerializer ResponseHeadersSerializer
+ {
+ get { return responseHeadersSerializerId != -1 ? TypeStub.GetSerializer (responseHeadersSerializerId) : null; }
+ }
+
+ internal XmlSerializer FaultHeadersSerializer
{
- get { return _membersMapping[1]; }
+ get { return faultHeadersSerializerId != -1 ? TypeStub.GetSerializer (faultHeadersSerializerId) : null; }
}
+
//
// Constructor
if (kind == null) {
Use = parent.Use;
RequestName = "";
- RequestNamespace = parent.WebServiceNamespace;
+ RequestNamespace = "";
ResponseName = "";
- ResponseNamespace = parent.WebServiceNamespace;
+ ResponseNamespace = "";
ParameterStyle = parent.ParameterStyle;
SoapBindingStyle = parent.SoapBindingStyle;
OneWay = false;
SoapDocumentMethodAttribute dma = (SoapDocumentMethodAttribute) kind;
Use = dma.Use;
- if (Use == SoapBindingUse.Default)
- Use = parent.Use;
+ if (Use == SoapBindingUse.Default) {
+ if (parent.SoapBindingStyle == SoapBindingStyle.Document)
+ Use = parent.Use;
+ else
+ Use = SoapBindingUse.Literal;
+ }
Action = dma.Action;
Binding = dma.Binding;
Action = rma.Action;
Binding = rma.Binding;
- RequestName = rma.RequestElementName;
+
+ // When using RPC, MS.NET seems to ignore RequestElementName and
+ // MessageName, and it always uses the method name
+ RequestName = source.Name;
+ ResponseName = source.Name + "Response";
+// RequestName = rma.RequestElementName;
+// ResponseName = rma.ResponseElementName;
RequestNamespace = rma.RequestNamespace;
ResponseNamespace = rma.ResponseNamespace;
- ResponseName = rma.ResponseElementName;
ParameterStyle = SoapParameterStyle.Wrapped;
OneWay = rma.OneWay;
SoapBindingStyle = SoapBindingStyle.Rpc;
if (OneWay){
if (source.ReturnType != typeof (void))
- throw new Exception ("OneWay methods should not have a return value");
+ throw new Exception ("OneWay methods should not have a return value.");
if (source.OutParameters.Length != 0)
- throw new Exception ("OneWay methods should not have out/ref parameters");
+ throw new Exception ("OneWay methods should not have out/ref parameters.");
}
- if (RequestNamespace == "") RequestNamespace = parent.WebServiceNamespace;
- if (ResponseNamespace == "") ResponseNamespace = parent.WebServiceNamespace;
+ BindingInfo binfo = parent.GetBinding (Binding);
+ if (binfo == null) throw new InvalidOperationException ("Type '" + parent.Type + "' is missing WebServiceBinding attribute that defines a binding named '" + Binding + "'.");
+
+ string serviceNamespace = binfo.Namespace;
+
+ if (RequestNamespace == "") RequestNamespace = parent.LogicalType.GetWebServiceNamespace (serviceNamespace, Use);
+ if (ResponseNamespace == "") ResponseNamespace = parent.LogicalType.GetWebServiceNamespace (serviceNamespace, Use);
if (RequestName == "") RequestName = Name;
if (ResponseName == "") ResponseName = Name + "Response";
- if (Binding == null || Binding == "") Binding = parent.DefaultBinding;
- else if (parent.GetBinding (Binding) == null) throw new InvalidOperationException ("Type '" + parent.Type + "' is missing WebServiceBinding attribute that defines a binding named '" + Binding + "'");
-
if (Action == null || Action == "")
- Action = RequestNamespace.EndsWith("/") ? (RequestNamespace + Name) : (RequestNamespace + "/" + Name);
+ Action = serviceNamespace.EndsWith("/") ? (serviceNamespace + Name) : (serviceNamespace + "/" + Name);
bool hasWrappingElem = (ParameterStyle == SoapParameterStyle.Wrapped);
+ bool writeAccessors = (SoapBindingStyle == SoapBindingStyle.Rpc);
XmlReflectionMember [] in_members = BuildRequestReflectionMembers (optional_ns);
XmlReflectionMember [] out_members = BuildResponseReflectionMembers (optional_ns);
- _membersMapping = new XmlMembersMapping [2];
-
if (Use == SoapBindingUse.Literal) {
- _membersMapping [0] = xmlImporter.ImportMembersMapping (RequestName, RequestNamespace, in_members, hasWrappingElem);
- _membersMapping [1] = xmlImporter.ImportMembersMapping (ResponseName, ResponseNamespace, out_members, hasWrappingElem);
+ xmlImporter.IncludeTypes (source.CustomAttributeProvider);
+ InputMembersMapping = xmlImporter.ImportMembersMapping (RequestName, RequestNamespace, in_members, hasWrappingElem);
+ OutputMembersMapping = xmlImporter.ImportMembersMapping (ResponseName, ResponseNamespace, out_members, hasWrappingElem);
}
else {
- _membersMapping [0] = soapImporter.ImportMembersMapping (RequestName, RequestNamespace, in_members, hasWrappingElem, true);
- _membersMapping [1] = soapImporter.ImportMembersMapping (ResponseName, ResponseNamespace, out_members, hasWrappingElem, true);
+ soapImporter.IncludeTypes (source.CustomAttributeProvider);
+ InputMembersMapping = soapImporter.ImportMembersMapping (RequestName, RequestNamespace, in_members, hasWrappingElem, writeAccessors);
+ OutputMembersMapping = soapImporter.ImportMembersMapping (ResponseName, ResponseNamespace, out_members, hasWrappingElem, writeAccessors);
}
- XmlSerializer [] s = null;
- s = XmlSerializer.FromMappings (_membersMapping);
- RequestSerializer = s [0];
- ResponseSerializer = s [1];
+ requestSerializerId = parent.RegisterSerializer (InputMembersMapping);
+ responseSerializerId = parent.RegisterSerializer (OutputMembersMapping);
object[] o = source.GetCustomAttributes (typeof (SoapHeaderAttribute));
- Headers = new HeaderInfo[o.Length];
+ ArrayList allHeaderList = new ArrayList (o.Length);
+ ArrayList inHeaderList = new ArrayList (o.Length);
+ ArrayList outHeaderList = new ArrayList (o.Length);
+ ArrayList faultHeaderList = new ArrayList ();
+
+ SoapHeaderDirection unknownHeaderDirections = (SoapHeaderDirection)0;
+
for (int i = 0; i < o.Length; i++) {
SoapHeaderAttribute att = (SoapHeaderAttribute) o[i];
MemberInfo[] mems = source.DeclaringType.GetMember (att.MemberName);
- if (mems.Length == 0) throw new InvalidOperationException ("Member " + att.MemberName + " not found in class " + source.DeclaringType.FullName);
+ if (mems.Length == 0) throw new InvalidOperationException ("Member " + att.MemberName + " not found in class " + source.DeclaringType.FullName + ".");
- Type headerType = (mems[0] is FieldInfo) ? ((FieldInfo)mems[0]).FieldType : ((PropertyInfo)mems[0]).PropertyType;
- Headers [i] = new HeaderInfo (mems[0], att);
- parent.RegisterHeaderType (headerType);
+ HeaderInfo header = new HeaderInfo (mems[0], att);
+ allHeaderList.Add (header);
+ if (!header.IsUnknownHeader) {
+ if ((header.Direction & SoapHeaderDirection.In) != 0)
+ inHeaderList.Add (header);
+ if ((header.Direction & SoapHeaderDirection.Out) != 0)
+ outHeaderList.Add (header);
+ if ((header.Direction & SoapHeaderDirection.Fault) != 0)
+ faultHeaderList.Add (header);
+ } else
+ unknownHeaderDirections |= header.Direction;
}
+
+ Headers = (HeaderInfo[]) allHeaderList.ToArray (typeof(HeaderInfo));
+ if (inHeaderList.Count > 0 || (unknownHeaderDirections & SoapHeaderDirection.In) != 0) {
+ InHeaders = (HeaderInfo[]) inHeaderList.ToArray (typeof(HeaderInfo));
+ XmlReflectionMember[] members = BuildHeadersReflectionMembers (InHeaders);
+
+ if (Use == SoapBindingUse.Literal)
+ InputHeaderMembersMapping = xmlImporter.ImportMembersMapping ("", RequestNamespace, members, false);
+ else
+ InputHeaderMembersMapping = soapImporter.ImportMembersMapping ("", RequestNamespace, members, false, false);
+
+ requestHeadersSerializerId = parent.RegisterSerializer (InputHeaderMembersMapping);
+ }
+
+ if (outHeaderList.Count > 0 || (unknownHeaderDirections & SoapHeaderDirection.Out) != 0) {
+ OutHeaders = (HeaderInfo[]) outHeaderList.ToArray (typeof(HeaderInfo));
+ XmlReflectionMember[] members = BuildHeadersReflectionMembers (OutHeaders);
+
+ if (Use == SoapBindingUse.Literal)
+ OutputHeaderMembersMapping = xmlImporter.ImportMembersMapping ("", RequestNamespace, members, false);
+ else
+ OutputHeaderMembersMapping = soapImporter.ImportMembersMapping ("", RequestNamespace, members, false, false);
+
+ responseHeadersSerializerId = parent.RegisterSerializer (OutputHeaderMembersMapping);
+ }
+
+ if (faultHeaderList.Count > 0 || (unknownHeaderDirections & SoapHeaderDirection.Fault) != 0) {
+ FaultHeaders = (HeaderInfo[]) faultHeaderList.ToArray (typeof(HeaderInfo));
+ XmlReflectionMember[] members = BuildHeadersReflectionMembers (FaultHeaders);
+
+ if (Use == SoapBindingUse.Literal)
+ FaultHeaderMembersMapping = xmlImporter.ImportMembersMapping ("", RequestNamespace, members, false);
+ else
+ FaultHeaderMembersMapping = soapImporter.ImportMembersMapping ("", RequestNamespace, members, false, false);
+
+ faultHeadersSerializerId = parent.RegisterSerializer (FaultHeaderMembersMapping);
+ }
+
SoapExtensions = SoapExtension.GetMethodExtensions (source);
}
return out_members;
}
+ XmlReflectionMember [] BuildHeadersReflectionMembers (HeaderInfo[] headers)
+ {
+ XmlReflectionMember [] mems = new XmlReflectionMember [headers.Length];
+
+ for (int n=0; n<headers.Length; n++)
+ {
+ HeaderInfo header = headers [n];
+
+ XmlReflectionMember m = new XmlReflectionMember ();
+ m.IsReturnValue = false;
+ m.MemberName = header.HeaderType.Name;
+ m.MemberType = header.HeaderType;
+
+ // MS.NET reflects header classes in a weird way. The root element
+ // name is the CLR class name unless it is specified in an XmlRootAttribute.
+ // The usual is to use the xml type name by default, but not in this case.
+
+ XmlAttributes ats = new XmlAttributes (header.HeaderType);
+ if (ats.XmlRoot != null) {
+ XmlElementAttribute xe = new XmlElementAttribute ();
+ xe.ElementName = ats.XmlRoot.ElementName;
+ xe.Namespace = ats.XmlRoot.Namespace;
+ m.XmlAttributes = new XmlAttributes ();
+ m.XmlAttributes.XmlElements.Add (xe);
+ }
+
+ mems [n] = m;
+ }
+ return mems;
+ }
+
public HeaderInfo GetHeaderInfo (Type headerType)
{
foreach (HeaderInfo headerInfo in Headers)
if (headerInfo.HeaderType == headerType) return headerInfo;
return null;
}
+
+ public XmlSerializer GetBodySerializer (SoapHeaderDirection dir)
+ {
+ switch (dir) {
+ case SoapHeaderDirection.In: return RequestSerializer;
+ case SoapHeaderDirection.Out: return ResponseSerializer;
+ case SoapHeaderDirection.Fault: return Fault.Serializer;
+ default: return null;
+ }
+ }
+
+ public XmlSerializer GetHeaderSerializer (SoapHeaderDirection dir)
+ {
+ switch (dir) {
+ case SoapHeaderDirection.In: return RequestHeadersSerializer;
+ case SoapHeaderDirection.Out: return ResponseHeadersSerializer;
+ case SoapHeaderDirection.Fault: return FaultHeadersSerializer;
+ default: return null;
+ }
+ }
+
+ HeaderInfo[] GetHeaders (SoapHeaderDirection dir)
+ {
+ switch (dir) {
+ case SoapHeaderDirection.In: return InHeaders;
+ case SoapHeaderDirection.Out: return OutHeaders;
+ case SoapHeaderDirection.Fault: return FaultHeaders;
+ default: return null;
+ }
+ }
+
+ public object[] GetHeaderValueArray (SoapHeaderDirection dir, SoapHeaderCollection headers)
+ {
+ HeaderInfo[] headerInfos = GetHeaders (dir);
+ if (headerInfos == null) return null;
+
+ object[] hs = new object [headerInfos.Length];
+
+ for (int n=0; n<headers.Count; n++) {
+ SoapHeader h = headers[n];
+ Type t = h.GetType();
+ for (int i=0; i<headerInfos.Length; i++)
+ if (headerInfos [i].HeaderType == t)
+ hs [i] = h;
+ }
+ return hs;
+ }
}
internal class HeaderInfo
internal MemberInfo Member;
internal SoapHeaderAttribute AttributeInfo;
internal Type HeaderType;
+ internal bool IsUnknownHeader;
public HeaderInfo (MemberInfo member, SoapHeaderAttribute attributeInfo)
{
AttributeInfo = attributeInfo;
if (Member is PropertyInfo) HeaderType = ((PropertyInfo)Member).PropertyType;
else HeaderType = ((FieldInfo)Member).FieldType;
+
+ if (HeaderType == typeof(SoapHeader) || HeaderType == typeof(SoapUnknownHeader) ||
+ HeaderType == typeof(SoapHeader[]) || HeaderType == typeof(SoapUnknownHeader[]))
+ {
+ IsUnknownHeader = true;
+ }
+ else if (!typeof(SoapHeader).IsAssignableFrom (HeaderType))
+ throw new InvalidOperationException (string.Format ("Header members type must be a SoapHeader subclass"));
}
public object GetHeaderValue (object ob)
else return ((FieldInfo)Member).GetValue (ob);
}
- public void SetHeaderValue (object ob, object value)
+ public void SetHeaderValue (object ob, SoapHeader header)
{
+ object value = header;
+ if (IsUnknownHeader && HeaderType.IsArray)
+ {
+ SoapUnknownHeader uheader = header as SoapUnknownHeader;
+ SoapUnknownHeader[] array = (SoapUnknownHeader[]) GetHeaderValue (ob);
+ if (array == null || array.Length == 0) {
+ value = new SoapUnknownHeader[] { uheader };
+ }
+ else {
+ SoapUnknownHeader[] newArray = new SoapUnknownHeader [array.Length+1];
+ Array.Copy (array, newArray, array.Length);
+ newArray [array.Length] = uheader;
+ value = newArray;
+ }
+ }
+
if (Member is PropertyInfo) ((PropertyInfo)Member).SetValue (ob, value, null);
else ((FieldInfo)Member).SetValue (ob, value);
}
-
+
public SoapHeaderDirection Direction
{
get { return AttributeInfo.Direction; }
}
}
- internal class Fault
- {
- public Fault () {}
-
- public Fault (SoapException ex)
- {
- faultcode = ex.Code;
- faultstring = ex.Message;
- faultactor = ex.Actor;
- detail = ex.Detail;
- }
-
- public XmlQualifiedName faultcode;
- public string faultstring;
- public string faultactor;
- public XmlNode detail;
- }
-
- internal class BindingInfo
- {
- public BindingInfo (WebServiceBindingAttribute at, string ns)
- {
- Name = at.Name;
- Namespace = at.Namespace;
- if (Namespace == "") Namespace = ns;
- Location = at.Location;
- }
-
- public BindingInfo (string name, string ns)
- {
- Name = name;
- Namespace = ns;
- }
-
- public string Name;
- public string Namespace;
- public string Location;
- }
//
// Holds the metadata loaded from the type stub, as well as
//
internal class SoapTypeStubInfo : TypeStubInfo
{
- Hashtable header_serializers = new Hashtable ();
- Hashtable header_serializers_byname = new Hashtable ();
- ArrayList bindings = new ArrayList ();
+ Hashtable[] header_serializers = new Hashtable [3];
+ Hashtable[] header_serializers_byname = new Hashtable [3];
+ Hashtable methods_byaction = new Hashtable ();
// Precomputed
internal SoapParameterStyle ParameterStyle;
internal SoapServiceRoutingStyle RoutingStyle;
internal SoapBindingUse Use;
- internal string DefaultBinding;
- internal XmlSerializer FaultSerializer;
internal SoapExtensionRuntimeConfig[][] SoapExtensions;
internal SoapBindingStyle SoapBindingStyle;
- internal XmlReflectionImporter XmlImporter;
- internal SoapReflectionImporter SoapImporter;
+ internal XmlReflectionImporter xmlImporter;
+ internal SoapReflectionImporter soapImporter;
- public SoapTypeStubInfo (Type t)
- : base (t)
+ public SoapTypeStubInfo (LogicalTypeInfo logicalTypeInfo)
+ : base (logicalTypeInfo)
{
- XmlImporter = new XmlReflectionImporter ();
- SoapImporter = new SoapReflectionImporter ();
+ xmlImporter = new XmlReflectionImporter ();
+ soapImporter = new SoapReflectionImporter ();
object [] o;
- DefaultBinding = WebServiceName + "Soap";
- BindingInfo binfo = new BindingInfo (DefaultBinding, WebServiceNamespace);
- bindings.Add (binfo);
-
- o = t.GetCustomAttributes (typeof (WebServiceBindingAttribute), false);
+ o = Type.GetCustomAttributes (typeof (WebServiceBindingAttribute), false);
+
+ if (typeof (SoapHttpClientProtocol).IsAssignableFrom (Type))
+ {
+ if (o.Length == 0)
+ throw new InvalidOperationException ("WebServiceBindingAttribute is required on proxy class '" + Type + "'.");
+ if (o.Length > 1)
+ throw new InvalidOperationException ("Only one WebServiceBinding attribute may be specified on type '" + Type + "'.");
+
+ // Remove the default binding, it is not needed since there is always
+ // a binding attribute.
+ Bindings.Clear ();
+ }
+
foreach (WebServiceBindingAttribute at in o)
- bindings.Add (new BindingInfo (at, WebServiceNamespace));
+ AddBinding (new BindingInfo (at, LogicalType.WebServiceNamespace));
- o = t.GetCustomAttributes (typeof (SoapDocumentServiceAttribute), false);
+ o = Type.GetCustomAttributes (typeof (SoapDocumentServiceAttribute), false);
if (o.Length == 1){
SoapDocumentServiceAttribute a = (SoapDocumentServiceAttribute) o [0];
Use = a.Use;
SoapBindingStyle = SoapBindingStyle.Document;
} else {
- o = t.GetCustomAttributes (typeof (SoapRpcServiceAttribute), false);
+ o = Type.GetCustomAttributes (typeof (SoapRpcServiceAttribute), false);
if (o.Length == 1){
SoapRpcServiceAttribute srs = (SoapRpcServiceAttribute) o [0];
if (ParameterStyle == SoapParameterStyle.Default) ParameterStyle = SoapParameterStyle.Wrapped;
if (Use == SoapBindingUse.Default) Use = SoapBindingUse.Literal;
+
+ xmlImporter.IncludeTypes (Type);
+ soapImporter.IncludeTypes (Type);
- FaultSerializer = new XmlSerializer (typeof(Fault));
- SoapExtensions = SoapExtension.GetTypeExtensions (t);
+ SoapExtensions = SoapExtension.GetTypeExtensions (Type);
}
- protected override MethodStubInfo CreateMethodStubInfo (TypeStubInfo parent, LogicalMethodInfo lmi, bool isClientProxy)
+ public override XmlReflectionImporter XmlImporter
{
- object [] ats = lmi.GetCustomAttributes (typeof (SoapDocumentMethodAttribute));
- if (ats.Length == 0) ats = lmi.GetCustomAttributes (typeof (SoapRpcMethodAttribute));
-
- if (ats.Length == 0 && isClientProxy)
- return null;
- else if (ats.Length == 0)
- return new SoapMethodStubInfo (parent, lmi, null, XmlImporter, SoapImporter);
- else
- return new SoapMethodStubInfo (parent, lmi, ats[0], XmlImporter, SoapImporter);
- }
-
- internal void RegisterHeaderType (Type type)
- {
- XmlSerializer s = (XmlSerializer) header_serializers [type];
- if (s != null) return;
-
- XmlReflectionImporter ri = new XmlReflectionImporter ();
- XmlTypeMapping tm = ri.ImportTypeMapping (type, WebServiceAttribute.DefaultNamespace);
- s = new XmlSerializer (tm);
-
- header_serializers [type] = s;
- header_serializers_byname [new XmlQualifiedName (tm.ElementName, tm.Namespace)] = s;
+ get { return xmlImporter; }
}
- internal XmlSerializer GetHeaderSerializer (Type type)
+ public override SoapReflectionImporter SoapImporter
{
- return (XmlSerializer) header_serializers [type];
+ get { return soapImporter; }
}
-
- internal XmlSerializer GetHeaderSerializer (XmlQualifiedName qname)
+
+ public override string ProtocolName
{
- return (XmlSerializer) header_serializers_byname [qname];
+ get { return "Soap"; }
}
- internal ArrayList Bindings
+ protected override MethodStubInfo CreateMethodStubInfo (TypeStubInfo parent, LogicalMethodInfo lmi, bool isClientProxy)
{
- get { return bindings; }
+ SoapMethodStubInfo res = null;
+ object [] ats = lmi.GetCustomAttributes (typeof (SoapDocumentMethodAttribute));
+ if (ats.Length == 0) ats = lmi.GetCustomAttributes (typeof (SoapRpcMethodAttribute));
+
+ if (ats.Length == 0 && isClientProxy)
+ return null;
+ else if (ats.Length == 0)
+ res = new SoapMethodStubInfo (parent, lmi, null, xmlImporter, soapImporter);
+ else
+ res = new SoapMethodStubInfo (parent, lmi, ats[0], xmlImporter, soapImporter);
+
+ methods_byaction [res.Action] = res;
+ return res;
}
- internal BindingInfo GetBinding (string name)
+ public SoapMethodStubInfo GetMethodForSoapAction (string name)
{
- for (int n=0; n<bindings.Count; n++)
- if (((BindingInfo)bindings[n]).Name == name) return (BindingInfo)bindings[n];
- return null;
+ return (SoapMethodStubInfo) methods_byaction [name.Trim ('"',' ')];
}
}
}