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节点。