Unable to create channel when operation is using typed messages with RPC/Encoded
See original GitHub issueI’m trying to consume a service that requires an operation to be attributed with RPC / Encoded.
This is an example:
[XmlSerializerFormatAttribute(Style=OperationFormatStyle.Rpc, SupportFaults=true, Use=OperationFormatUse.Encoded)] PingResponse Ping(PingRequest request);
When trying to create a channel of a service that implements the above operation I get the SFxTypedMessageCannotBeRpcLiteral error.
This may be due to the XmlSerializerOperationFormatter constructor passing isEncoded as false to the base class constructor (OperationFormatter), instead of using info from xmlSerializerFormatAttribute.
public XmlSerializerOperationFormatter(OperationDescription description, XmlSerializerFormatAttribute xmlSerializerFormatAttribute, MessageInfo requestMessageInfo, MessageInfo replyMessageInfo) : base(description, xmlSerializerFormatAttribute.Style == OperationFormatStyle.Rpc, false/*isEncoded*/) { _requestMessageInfo = requestMessageInfo; _replyMessageInfo = replyMessageInfo; }
Is RPC/Encoded not supported?
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (4 by maintainers)

Top Related StackOverflow Question
Resolved the issue by update of System.ServiceModel.* to 4.5.3
I got this error on new netcoreapp2.2 project, and resolved it with update of nuget packages(System.ServiceModel.*) from 4.4.0 to 4.5.3