我有一个WCF方法,它当前返回一个如下字符串:
string CreateDesign(string UID, string TemplateName)
重新设定的字符串由此方法创建:
string RequestProcessed(string status, string UID)
{
XDocument doc = new XDocument(
new XElement("RequestProcessed",
new XElement("Status", status),
new XElement("UID", UID)));
return doc.ToString();
}
我使用SOAPUI得到的响应是这样的:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<CreateDesignResponse xmlns="http://tempuri.org/">
<CreateDesignResult><![CDATA[<RequestProcessed>
<Status>OK</Status>
<UID>FolderName</UID>
</RequestProcessed>]]></CreateStandardResult>
</CreateStandardResponse>
</s:Body>
</s:Envelope>
客户希望这样:
<soap:Body>
<m:RequestProcessed xmlns:m=" ">
<m:Status></m:Status>
<m:UID></m:UID>
</m: RequestProcessed >
</soap:Body>
如何让WCF服务返回响应? 我现在很挣扎这段时间,感谢任何帮助。
问候。