I have a web service as the following :
For the Step class returned by this GetStepInfo() method, the definition is as the following :
To consume this web service via WCF client, for some design concerns, I need to create a channel to operate the service, not just reference the service and invoking the method generated by the system. So I created a IProcessor interface and start to create certain methods…etc.
These is what I created and how I invoke the service :
And how I invoke the service:
Everything looks good until I actually run the program, I got the following error:
Server did not recognize the value of HTTP Header SOAPAction:http://app.trend.com/services/flowService/xml/IProcessor/GetStepInfo
I have this error because WCF serializer does not recognize the namespace and could not serialize/deserialize the message to objects. So I add namespace to my interface and Setp/StepBase class as following
And explicitly specify the Name property on each class member
And this fixed the issue.