Reputation: 196
I was hired to rewrite some web-service written in Java to .NET. Supposedly, the response needs to contain the same elements, (which it does, with my new response I'm getting back the right elements), but my question is about the tags. Do the tags need to be exactly the same as well? This web-service will be consumed by a third party company, so for now it is hard to test since the only version we have is in production. Here are both responses:
Original Response:
<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>
New Response:
<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>
Upvotes: 0
Views: 336
Reputation: 166
Namespace prefix doesn't need to be exactly the same but namespace should be. I can see the namespace of AgencyID and AgentID is not the same in both responses you have shared. If the elements and namespaces are same but namespace prefix is different it will still be a valid response. For further confirmation, you can always validate your new response with the WSDL you have shared with the third party to make sure it works perfectly at their end.
Upvotes: 1