Questions tagged [messagecontract]

Windows Communication Foundation (WCF) MessageContract Attribute defines a strongly-typed class that corresponds to a SOAP message.

Windows Communication Foundation (WCF) MessageContract Attribute allows complete control over the structure of a SOAP message. This is especially important for interoperability or to specifically control security issues at the level of the message or message part. In these cases, you can create a message contract that enables you to specify the structure of the precise SOAP message required.

To define a message contract for a type (that is, to define the mapping between the type and a SOAP envelope), apply the MessageContractAttribute to the type. Then apply the MessageHeaderAttribute to those members of the type you want to make into SOAP headers, and apply the MessageBodyMemberAttribute to those members you want to make into parts of the SOAP body of the message.

In the SOAP representation of a message contract, each header and body part maps to an XML element that has a name and a namespace. By default, the namespace is the same as the namespace of the service contract that the message is participating in, and the name is determined by the member name to which the MessageHeaderAttribute or the MessageBodyMemberAttribute attributes are applied.

http://msdn.microsoft.com/en-us/library/ms730255(v=vs.110).aspx

84 questions
0
votes
1 answer

WCF - Using [MessageContract] without [MessageHeader]

The question is pretty straightforward. Is there any sense to use [MessageContract] attribute instead of [DataContract] if we're not using [MessageHeader] attrribute, but only [MessageBodyMember]. In that case it will be the same to use…
Piotr Czarnecki
  • 1,688
  • 3
  • 14
  • 22
0
votes
1 answer

WCF Request Formatting

I am converting a legacy web service to a WCF service. This service currently is being used by front end application. But as of now the front end is not going to consume the new WCF service so instead we plan on rerouting the request to our new…
Nitheesh Reddy
  • 36
  • 1
  • 1
  • 11
0
votes
1 answer

WCF DataContractSerializer Behavior

I'm seeing some unusual behavior when using the DataContractSerializer. I have defined a message contract like so: namespace MyNamespace.DataContracts { [MessageContract(WrapperName = "order", WrapperNamespace =…
user7607
0
votes
1 answer

Incorrect Soap's namespaces in inner complex types

Im using the MessageContract. Here the wrong SOAP message, which is generated: ...
SoaperPlus
  • 159
  • 2
  • 11
0
votes
1 answer

Upload file with messagecontract

I have been following the various tutorials that explain how to upload files via WCF and I am having some issues when I try to share the classes containing MessageContract between the client and the server. Basically my issue is as follows: I have…
Giardino
  • 1,367
  • 3
  • 10
  • 30
0
votes
1 answer

WCF service getting MessageContract error on server 2003 and not other locations

I have a WCF service I am connecting to. It works fine from my local machine when testing. Also works fine on one test location that is running windows server 2008. one of our production machines is running windows server 2003, and I get this…
user2300846
  • 155
  • 2
  • 10
0
votes
1 answer

Problem with MessageContract, Generic return types and clientside naming

I'm building a web service which uses MessageContracts, because I want to add custom fields to my SOAP header. In a previous topic, I learned that a composite response has to be wrapped. For this purpose, I devised a generic ResponseWrapper class.…
Soeteman
  • 63
  • 1
  • 6
0
votes
2 answers

A newly added MessageContract doesn't appear in the service reference metadata

I have a MessageContract called Document that looks like this: [MessageContract] public class Document : IDisposable { [MessageHeader(MustUnderstand = true)] public string FileName; [MessageHeader(MustUnderstand = true)] public bool…
ernest
  • 1,633
  • 2
  • 30
  • 48
0
votes
1 answer

WCF: "Cancel" operation Call Dependent on Request Message Contract

Here's my contract: [ServiceContract] public interface IMyServiceContract { [OperationContract] OperationResponse1 Operation1(OperationRequest1 req); [OperationContract] OperationResponse2 Operation2(OperationRequest2 req); …
Spikeh
  • 3,540
  • 4
  • 24
  • 49
1 2 3 4 5
6