How to change webservice proxy to get Raw XML

Here's the proxy method that was created for the web service I'm trying to access. How can I change it to get raw XML from a web service call?

        /// <remarks/>
    [System.Web.Services.Protocols.SoapHeaderAttribute("CallOptionsValue")]
    [System.Web.Services.Protocols.SoapHeaderAttribute("MruHeaderValue")]
    [System.Web.Services.Protocols.SoapHeaderAttribute("SessionHeaderValue")]
    [System.Web.Services.Protocols.SoapHeaderAttribute("QueryOptionsValue")]
    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "urn:partner.soap.sforce.com", ResponseNamespace = "urn:partner.soap.sforce.com", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
    [return: System.Xml.Serialization.XmlElementAttribute("result")]
    public QueryResult query(string queryString)
    {
        object[] results = this.Invoke("query", new object[] {
                    queryString});
        return ((QueryResult)(results[0]));
    }

Thank you for your help!

+3
source share
3 answers

Fortunately, there is a good way to do this, just change the generated proxy class so that it inherits from another database. An alternative implementation comes from Web Services Enhancements 3.0:

Microsoft.Web.Services3.WebServicesClientProtocol

RequestSoapContext.Envelope.InnerXml ResponseSoapContext.Envelope.InnerXml - , .

+3

, Fiddler Web.

/ XML, . System.Net.HttpWebRequest -, XML. / .ASPX -.

+2

, , , - ASMX, ....

, XML? ...

- ( ):

MemoryStream stm = new MemoryStream();
XmlSerializer xmlSer = new XmlSerializer(typeof(QueryResult));
xmlSer.Serialize(stm, queryResult);

?

0

Source: https://habr.com/ru/post/1702776/


All Articles