Model with MessageHeader
See original GitHub issueI’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:
- Created 4 years ago
- Comments:9 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ZlobnyiSerg https://www.nuget.org/packages/SoapCore/1.0.0-alpha.1
Unfortunately i didn’t do it with SoapCore, i used WCF service for my project.