0
我有一個是這樣定義的WCF操作:如何防止以下嵌套soap請求?
[OperationContract(Name="GetColorsRQ")]
GetColorsRS GetColors(GetColorsRQ rq);
凡GetColorsRS
將持有響應和GetColorsRQ
持有的請求。當我運行它,它會創建下列SOAP請求(我只包括請求的開始)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns="http://www.abc.com">
<soapenv:Header/>
<soapenv:Body>
<ns:GetColorsRQ>
<ns:rq Target="Test" Version="0">
....
當我使用從ASMX服務相同的請求,也不會窩的請求時,它會做如下所示:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns="http://www.abc.com">
<soapenv:Header/>
<soapenv:Body>
<ns:GetColorsRQ Target="Test" Version="0">
....
通知,現在還沒有NS:RQ和屬性已被放置在NS:GetColorsRQ節點。