question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

0.9.9.3 change of datacontract namespace not working?

See original GitHub issue

Hi!

The way datacontract namespaces are generated in metadata have changed in 0.9.9.3 (or maybe 0.9.9.2). With 0.9.9.1, datamembers got the same namespace as the service. See this example request generated by SoapUI for my service:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://mynamespace.com/services/foo/v1/">
   <soapenv:Header/>
   <soapenv:Body>
      <v1:GetPerson>
         <v1:request>
            <v1:IdentificationNumber>123</v1:IdentificationNumber>
         </v1:request>
      </v1:GetPerson>
   </soapenv:Body>
</soapenv:Envelope>

But with 0.9.9.3 (and also latest in master), the datamembers get a separate namespace:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://mynamespace.com/services/foo/v1/" xmlns:mim="http://schemas.datacontract.org/2004/07/Foo.Soap.V1">
   <soapenv:Header/>
   <soapenv:Body>
      <v1:GetPerson>
         <v1:request>
            <mim:IdentificationNumber>123</mim:IdentificationNumber>
         </v1:request>
      </v1:GetPerson>
   </soapenv:Body>
</soapenv:Envelope>

This is all well and good for the WSDL itself, since this is the way that WCF in .Net Framework generates namespaces. However, SoapCores runtime code can’t seem to recognize the parameters (in the example above “IdentificationNumber”). I have tried changing the order of the parameters, and having an explicit namespace on the datacontract, but that is not used. No matter what I do, parameters are null when receiving a request in my service.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

0reactions
github-actions[bot]commented, Aug 11, 2021

This issue was closed because it has been inactive for 14 days since being marked as stale.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Namespace for [DataContract]
Runtime.Serialization namespace. You should add a reference to System.Runtime.Serialization.dll . That assembly isn't referenced by default ...
Read more >
DataContractAttribute.Namespace Property
Use this property to specify a particular namespace if your type must return data that complies with a specific data contract.
Read more >
C# - How to change the default namespace for ...
NET class using the DataContract attribute. The MSDN documentation states: By default, when you apply the DataContractAttribute to a class, it uses the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found