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.

Model with MessageHeader

See original GitHub issue

I’m trying to implement SOAP 1.2. The issue comes from poor interpretation of the MessageHeader attribute. Properties with MessageHeader should be in header, but they are not.

My demo model with the MessageHeader and MessageBodyMember attributes.

[MessageContract]
public class MessageModelRequest
{
[MessageHeader]
public string Id { get; set; }
[MessageBodyMember]
public string Name { get; set; }
[MessageBodyMember]
public string Email { get; set; }
}

I test API with SoapUI.

This is my API under ASP.NET core with SoapCore. OcppDemo

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:tem="http://tempuri.org/" xmlns:mod="http://schemas.datacontract.org/2004/07/Models">
   <soap:Header/>
   <soap:Body>
      <tem:TestMessageModel>
         <!--Optional:-->
         <tem:inputModel>
            <!--Optional:-->
            <mod:Email>?</mod:Email>
            <!--Optional:-->
            <mod:Id>1</mod:Id>
            <!--Optional:-->
            <mod:Name>?</mod:Name>
         </tem:inputModel>
      </tem:TestMessageModel>
   </soap:Body>
</soap:Envelope>

Correct API from WCF project for IIS. WCF

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
   <soapenv:Header>
      <tem:Id>34</tem:Id>
   </soapenv:Header>
   <soapenv:Body>
      <tem:MessageModelRequest>
         <!--Optional:-->
         <tem:Email>3</tem:Email>
         <!--Optional:-->
         <tem:Name>4</tem:Name>
      </tem:MessageModelRequest>
   </soapenv:Body>
</soapenv:Envelope>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
delianenchevcommented, Nov 4, 2019

Unfortunately i didn’t do it with SoapCore, i used WCF service for my project.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Messageheader-example - FHIR v6.0.0-cibuild
This example conforms to the profile MessageHeader. Update Person resource for Peter James CHALMERS (Jim), MRN: 12345 (Acme Healthcare). Usage note: every ...
Read more >
MessageHeader - FHIR v6.0.0-cibuild
The MessageHeader resource is defined in order to support Messaging using FHIR resources. The principal usage of the MessageHeader resource is when messages ......
Read more >
Class MessageHeader
The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the subject of the...
Read more >
MessageHeaders Class (System.ServiceModel.Channels)
Represents a collection of message headers for a message. ... The following code example demonstrates a basic client using the channel factory to...
Read more >
MessageHeader<T> Class (System.ServiceModel)
Initializes a new instance of the MessageHeader<T> class with the specified header content. MessageHeader<T>(T, Boolean, String, Boolean).
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