【发布时间】:2016-08-15 16:19:12
【问题描述】:
我受雇将一些用 Java 编写的 Web 服务重写为 .NET。据说,响应需要包含相同的元素,(它确实如此,我的新响应我得到了正确的元素),但我的问题是关于标签的。标签是否也需要完全相同?该网络服务将由第三方公司使用,因此目前很难测试,因为我们拥有的唯一版本正在生产中。以下是两个回复:
原始回复:
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Header/>
<env:Body>
<m:redCodeResponse xmlns:m="http://com/agentcorp/webservice/vax">
<m:RedCodeResult>
<java:AgencyID xmlns:java="java:com.agentcorp.ejb.webservices.vax">56693</java:AgencyID>
<java:AgentID xmlns:java="java:com.agentcorp.ejb.webservices.vax">757803</java:AgentID>
</m:RedCodeResult>
</m:redCodeResponse>
新回应:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header />
<s:Body>
<redCodeResponse xmlns="http://com/agentcorp/webservice/vax">
<RedCodeResult xmlns:a="http://schemas.datacontract.org/2004/07/MyFirstWCFService" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:AgencyID>56693</a:AgencyID>
<a:AgentID>757803</a:AgentID>
</RedCodeResult>
</redCodeResponse>
【问题讨论】:
-
我会问第三方公司
-
是的,我知道这是一个很好的建议,但是,因为我只是用其他语言重写代码,所以一切都应该是一样的,没有什么新鲜的。再加上联系那家公司并得到他们的回复需要更长的时间,并且希望避免这种情况直到结束
标签: xml soap tags format response