如何修改Web服务代理,以获得原始XML [英] How to modify webservice proxy to get Raw XML

查看:158
本文介绍了如何修改Web服务代理,以获得原始XML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是为Web服务,我试图访问已创建的代理方法。我怎么会去修改它来从Web服务调用的原始XML?

Here's the proxy method that was created for the web service I'm trying to access. How would I go about modifying it to get the raw XML from the 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]));
    }

感谢您的帮助!

Thanks for your help!

推荐答案

幸运的是有一个很好的办法做到这一点,只需要修改生成的代理类,以便从不同的基本继承。另一种方法执行来自Web服务增强3.0包:

Fortunately there is a nice way to do it, just modify the generated proxy class so it inherits from different base. The alternative implementation comes from Web Services Enhancements 3.0 pack:

<一个href="http://www.microsoft.com/downloads/details.aspx?familyid=018a09fd-3a74-43c5-8ec1-8d789091255d&displaylang=en"相对=nofollow> Microsoft.Web.Services3.WebServicesClientProtocol

在类,你将有RequestSoapContext.Envelope.InnerXml和ResponseSoapContext.Envelope.InnerXml的范围内 - 这正是你需要的。

in the class you'll have RequestSoapContext.Envelope.InnerXml and ResponseSoapContext.Envelope.InnerXml in the scope - that's exactly what you need.

这篇关于如何修改Web服务代理,以获得原始XML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆