2013-08-22 99 views
0

是否有可能從響應中刪除似乎是自動的notificationRequestResponse節點?從Web服務響應中移除響應包裝?

<?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> 
    <notificationRequestResponse xmlns="..."> 
     <notificationResponse xmlns="..."> 
     <success xmlns="">boolean</success> 
     <fault xmlns=""> 
      ... 
     </fault> 
     </notificationResponse> 
    </notificationRequestResponse> 
    </soap:Body> 
</soap:Envelope> 

我需要返回如下:

<?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> 
    <notificationResponse xmlns="..."> 
     <success xmlns="">boolean</success> 
     <fault xmlns=""> 
     ...   
     </fault> 
    </notificationResponse> 
    </soap:Body> 
</soap:Envelope> 

我想notificationResponse是響應的根!

的的WebMethod目前沒有任何邏輯,但:

return new notificationResponse() 

哪裏notificationRequestResponse來自哪裏?我可以使用WebMethod SoapDocumentMethod(ResponseElementName =「new name」)對其進行重命名,但我希望它消失。按照規定工作,別無選擇。

讚賞。

回答