开发者

How to inspect incoming XML from Web Reference?

We are calling the Paypal Soap API and running into

{"The specified type was not recognized: name='OptionDetailsType', namespace='urn:ebay:apis:eBLBaseComponents', at <OptionDetails xmlns='urn:ebay:api:PayPalAPI'>."}

Which is true, because OptionDetailsType is not in urn:ebay:apis:eBLBaseComponents but in urn:ebay:api:PayPalAPI. I suspect that this is specified in the incoming XML from Paypal, but I'm not sure how to inspect the incoming XML. The code dies at the Invoke in Reference.cs

[System.Web.Services.Protocols.SoapHeaderAttribute("RequesterCredentials", Direction=System.Web.Services.Protocols.SoapHeaderDirection.InOut)]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Servic开发者_C百科es.Protocols.SoapParameterStyle.Bare)]
[return: System.Xml.Serialization.XmlElementAttribute("BMGetButtonDetailsResponse", Namespace="urn:ebay:api:PayPalAPI")]
public BMGetButtonDetailsResponseType BMGetButtonDetails([System.Xml.Serialization.XmlElementAttribute(Namespace="urn:ebay:api:PayPalAPI")] BMGetButtonDetailsReq BMGetButtonDetailsReq) {
    object[] results = this.Invoke("BMGetButtonDetails", new object[] {
                BMGetButtonDetailsReq});
    return ((BMGetButtonDetailsResponseType)(results[0]));
}

In general, is there any way to inspect the incoming XML in a Web Reference? (VS2010)


Fiddler is a great HTTP proxy/inspection tool for inspecting HTTP and/or SOAP traffic.

Edit

Tips on tracing over SSL here


The reason I was beating on the "Service Reference vs. Web Reference" drum again was that using Service References gives you an out of the box solution for watching the XML. Just use the Configuration Editor Tool (SvcConfigEditor.exe) to turn on Message Logging.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜