3

I am interfacing with a web service I have no control over and it has messages (input/output) and actions that contain periods (.)

When svcutil generates the proxy, it includes:

[MessageContractAttribute(WrapperName="The.Request",...)]
public partial class TheRequest
{ ... }

[MessageContractAttribute(WrapperName="The.Response",...)]
public partial class TheResponse
{ ... }

which model the WSDL:

<wsdl:message name="The.Request">
    <wsdl:part name="Input" type="tns:InputType" />
</wsdl:message>
<wsdl:message name="The.Response">
    <wsdl:part name="Return" type="tns:Return" />
</wsdl:message>

When the code is run, I get an error message:

RPC Message TheRequest in operation DoIt has an invalid body name Input. It must be TheRequest

Stack Trace:

at System.ServiceModel.Description.XmlSerializerOperationBehavior.Reflector.OperationReflector.EnsureMessageInfos() at System.ServiceModel.Description.XmlSerializerOperationBehavior.Reflector.EnsureMessageInfos() at System.ServiceModel.Description.XmlSerializerOperationBehavior.Reflector.OperationReflector.get_Request() at System.ServiceModel.Description.XmlSerializerOperationBehavior.CreateFormatter() at System.ServiceModel.Description.XmlSerializerOperationBehavior.System.ServiceModel.Description.IOperationBehavior.ApplyClientBehavior(OperationDescription description, ClientOperation proxy) at System.ServiceModel.Description.DispatcherBuilder.BindOperations(ContractDescription contract, ClientRuntime proxy, DispatchRuntime dispatch) at System.ServiceModel.Description.DispatcherBuilder.ApplyClientBehavior(ServiceEndpoint serviceEndpoint, ClientRuntime clientRuntime) at System.ServiceModel.Description.DispatcherBuilder.BuildProxyBehavior(ServiceEndpoint serviceEndpoint, BindingParameterCollection& parameters) at System.ServiceModel.Channels.ServiceChannelFactory.BuildChannelFactory(ServiceEndpoint serviceEndpoint, Boolean useActiveAutoClose) at System.ServiceModel.ChannelFactory.CreateFactory()

....

I can't find a way to change the validation to accept the message name.

Can anyone clue me in on what to do or, at least, point me in the right direction?

Thanks.

Jeff Inflection
  • 101
  • 1
  • 3
  • I know this is an old post, but I'm running into the same problem and also can't find a solution. As I am consuming a SOAP service that I didn't create, I can't change anything on the service side. – SpokaneDJ Dec 23 '19 at 15:54

0 Answers0