Charles Cook 的 C# xml-rpc.net 库中的 .NET MVC 4.5
试图用 xml-rpc 攻击第 3 方供应商。我需要向他们发送一些格式如下的 xml:
<?xml version='1.0' encoding='iso-8859-1'?>
<QuoteRequest>
<User_ID>XXXXXXXX</User_ID>
<State>AL</State>
<Zip_Code>35201</Zip_Code>
<Applicant_Gender>Male</Applicant_Gender>
<Applicant_Age>30</Applicant_Age>
<Plan_ID>10</Plan_ID>
</QuoteRequest>
到目前为止我的努力:
var quoteRequest = new XmlRpcStruct();
var quoteRequestSpecs = new XmlRpcStruct();
quoteRequestSpecs.Add("Plan_ID", "10");
//add in other bits of xml here...user id, state, zip code, etc
quoteRequest.Add("QuoteRequest", quoteRequestSpecs);
var proxy = XmlRpcProxyGen.Create<IQuoteRequest>();
proxy.Url = "http://myfakeurl.com"
var response = proxy.QuoteRequest(quoteRequest);
IQuoteRequest 如下所示:
public interface IQuoteRequest : IXmlRpcProxy
{
[XmlRpcMethod("QuoteRequest")]
string QuoteRequest(XmlRpcStruct request);
}
我的服务很好,但我得到的只是以下内容:
"<?xml version="1.0" encoding="iso-8859-1"?><QuoteResult><Error><Message>Incorrect Plan ID.#</Message></Error></QuoteResult>"
重要部分:“不正确的计划 ID”。
是的,我知道我使用的是正确的计划 ID。
如果我根本没有附加任何信息并且只是通过一个空的 XmlRpcStruct 发送,我会收到相同的消息,所以我认为我的数据没有被发送。