public T GetResponseType <T>() where T : SoapResponseType { if (this.XmlDocument != null) { XName fullQualifiedElementName = SoapResponseType.GetFullyQualifiedElementName <T>(); XElement complexTypeElement = this.XmlDocument.Descendants(fullQualifiedElementName).FirstOrDefault(); T result = SoapUtilities.Deserialize <T>(complexTypeElement.ToString()); return(result); } return(default(T)); }
protected virtual XDocument SoapRequest <T>(T requestParameters) where T : SoapRequestType { XDocument soapRequest = new XDocument( new XDeclaration("1.0", "UTF-8", "no"), new XElement(_xns + "Envelope", new XAttribute(XNamespace.Xmlns + "xsi", _xsi), new XAttribute(XNamespace.Xmlns + "xsd", _xsd), new XAttribute(XNamespace.Xmlns + "soap", _xns), new XElement(_xns + "Body", SoapUtilities.Serialize(requestParameters) ) )); return(soapRequest); }