How to use MessageParameterAttribute in wcf

I wanted to know what is the use of MessageParameterAttribute in wcf.

In my function:

[OperationContract]
public float GetAirfare(
[MessageParameter(Name="fromCity")] string originCity,
[MessageParameter(Name="toCity")] string destinationCity);

I do not use fromCity or toCity anywhere in the implementation or even when using the service. Then what's the point of giving him a name?

+3
source share
1 answer

. , XSD-, . , XML . XML, CLR. , XML.

, :

<s:Body>
    <GetAirFare xmlns="yournamespacehere">
        <fromCity>Chicago</fromCity>
        <toCity>Las Vegas</toCity>
    </GetAirFare>
</s:Body>
+5

Source: https://habr.com/ru/post/1745055/


All Articles