【发布时间】:2016-06-20 21:03:29
【问题描述】:
我在 .Net 3.5 版本中用 SOAP 编写了一个 WEBSERVICE。当你在 IE 上显示 ASMX 文件时,它会显示如下信息。
我告诉我的客户,我可以接受他们发送给我的 JSON 对象。我正在接受一个令牌(字符串)和 param1(JSON 对象)。但是,token 和 param1 仍然在 XML 中发送。客户告诉我他只想给我发送 json。我怎样才能按照他想要的方式改变它?谁能告诉我该怎么做?
POST /Service1.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/PaymentRequest"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<PaymentRequest xmlns="http://tempuri.org/">
<guid>string</guid>
<param1>
<organisationId>string</organisationId>
<kdv>decimal</kdv>
<bsmv>decimal</bsmv>
<payment>
<paymentId>string</paymentId>
<signedDate>dateTime</signedDate>
<amount>decimal</amount>
<installment>int</installment>
<appliedRate>decimal</appliedRate>
<cardId>string</cardId>
</payment>
</param1>
</PaymentRequest>
</soap:Body>
</soap:Envelope>
【问题讨论】:
标签: c# json xml web-services soap