i am currently writing a web service client in delphi 7 (service itself is in c#). everything seems to be working just fine. when i run a fiddler to look how does the xml going from my client app looks like i noticed that is looks different when i write the "same" client app in c#. Below are two xml`s
one that goes from a Delphi 7 app
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:NS2="http://tempuri.org/">
<NS1:SomeTagName xmlns:NS1="http://tempuri.org/">
<SomeID xsi:type="xsd:int">12345</SomeID>
<SomeStatus xsi:type="NS2:SomeStatusType">SOME_OK_STATUS</SomeStatus>
</NS1:SomeTagName>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
one that goes from c# app
<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<SomeTagName xmlns="http://tempuri.org/">
<SomeID>12345</SomeID>
<SomeStatus>SOME_OK_STATUS</SomeStatus>
</SomeTagName>
</s:Body>
</s:Envelope>
i am not fluent in xml so i did some research and to this moment i am able to tell that
- UTF-8 is the default for documents without encoding information - ref. here - that means no difference here
- XML Namespaces provide a method to avoid element name conflicts - ref. here - namespaces are different (s: and SOAP-ENV:) but there are specified, and as far as i am concerned should not make the difference either
but what about the schema - not sure about that. There are some extra attributes in the Envelope or datatypes in SomeID and SomeStatus tags. But that came from service wsdl (i quess?!).
Final questions:
- Why the app written in c# (vs2012) does not add all the extra schema information to the xml. Does it really matter if the xml has them or not?
- can anyone tell if these can be considered as the same?
No comments:
Post a Comment