简体   繁体   中英

SOAPUI vs C# Service Reference : Different envelope

When using the exact same wsdl (including the xsd files) in SOAP UI and compare this to adding it as service reference in Dotnet (c#) i'm getting a different envelope. Any idea why this happens?

Soapui `

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://test.com/common/message/header/2" xmlns:wsa=" http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wssu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
   <soapenv:Header>
      <ns:TestHeader>
          <Afield>value</ Afield>
      </ns:TestHeader>

`

Dotnet `

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header>
        <h:TestHeader xmlns:h="http://test.com/common/message/header/2" xmlns="http://jlrint.com/common/message/header/2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <Afield xmlns=""></ Afield>
</h:TestHeader

`

  • As you can see, many attributes are declared on different nodes.
  • The namespace in a node is different
  • As you can see, the field Afield as an extra attr (which is empty) in dotnet

Thank you in advance!

They look the same, programmatically, to me! SoapUI is java, WCF test client is dotnet so you might as well ask why two different languages emit xml with different indentation, or why minified JavaScript works identically to pretty printed javascript..

There's more than one correct way to skin every xml cat but you can be sure that each will parse correctly and a server written in either language, in receipt of either format you see here, will parse it correctly and act on it in the same way. The. Erotically part is that the element names are the same - the aliasing and arrangement of default vs specific hierarchical name spacing is variable and relatively inconsequential

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM