0
votes

I have an existing soap client who communicates with a soap service without using the soap action attribute. Now, we have recently substituted this soap service with a C# WCF Service which requires a soap action by default. When I import the WSDL again, there is no problem. But, I don't want to regenerate the soap client because of backward compatible reasons. This afternoon I found an article with solves my problem: http://spikesoftware.azurewebsites.net/?p=151#comment-396784

The problem now is that my C# client can't invoke most of the soap actions. I can't find out the reason why this is not working anymore. The error I received is the following:

Message:

System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail] : Error in deserializing body of request message for operation 'GetWorkshops'. OperationFormatter encountered an invalid Message body. Expected to find node type 'Element' with the name 'GetWorkshops' and namespace 'http://tempuri.org/'. Found node type 'Element' with name 'GetWorkshops_V2' and namespace 'http://tempuri.org/'

The operation contract for these two methods like this:

[OperationContract(Action = "GetWorkshops", Name = "GetWorkshops")]
    WorkshopResponse GetWorkshops(<some parameters>)

[OperationContract (Action = "GetWorkshops_V2", Name = "GetWorkshops_V2")]
    WorkshopResponse_V2 GetWorkshopsV2(<some parameters>)

Can someone help me?

1
What is the binding added in web.config? - Vijayanath Viswanathan
My binding is basicHttpBinding - Marcel Beeker

1 Answers

1
votes

You can try out a couple of things,

  1. Please use wsHttpBinding instead of basicHttpBinding
  2. Generate a client proxy using svcutil