如何在WCF

时间:2018-12-07 16:40:41

标签: c# wcf

我的客户希望通过Web服务进行集成。他们向我发送了文档,并且我使用方法创建了WCF服务。 但是存在名称空间和前缀问题。我没有找到任何解决方案,也没有找到任何建议。例如,有一个不同的标记(

客户将发送如下请求:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ws="http://ws.common.haciosman.com">
<soapenv:Header />
   <soap:Body>
      <ws:getSystemStatus/>
   </soap:Body>
</soap:Envelope>

客户希望这样回应:

<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:getSystemStatusResponse xmlns:ns="http://ws.common.haciosman.com">
         <ns:return xsi:type="ax21:OutputMessage" xmlns:ax21="http://ws.common.haciosman.com/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <ax21:code>200</ax21:code>
            <ax21:description>Success</ax21:description>
         </ns:return>
      </ns:getSystemStatusResponse>
   </soapenv:Body>
</soapenv:Envelope>

好的,我创建了一个服务,但是名称空间和前缀不匹配。我的服务回应如下:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body>
      <getSystemStatusResponse>
         <getSystemStatusResult xmlns:a="http://schemas.datacontract.org/2004/07/WCFLocal.cls" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
            <a:code>200</a:code>
            <a:description>Success</a:description>
         </getSystemStatusResult>
      </getSystemStatusResponse>
   </s:Body>
</s:Envelope>

如您所见,标签是不同的。有什么问题,如何在WCF服务中更改前缀?

感谢您的答复。

0 个答案:

没有答案
相关问题