I am moving my WSE3 web services to the WCF. But the client is WSE3 client.
All the Operation Contracts return an instance of the MessageContract
classes. This works for 2 operations but somehow fails for one operation of the same service contract. The error is:
The signature or decryption was invalid.
When I look into WCF trace file, I found the following:
The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation 'MyOperationName'. End element 'Body' from namespace 'http://schemas.xmlsoap.org/soap/envelope/' expected. Found element 'MyOperationName' from namespace 'urn:MyProject:MyModule:2006:04:MyAuthorizationModule'.
My observation is, when I use XmlRoot
attribute to decorate response class (instead of using MessageContract
attribute), I do not get this exception. However, response object cannot be deserialized. i.e. I can see the XML response in input trace but since the expected XML structure does not match, service call returns null
at client side.
The MessageContract
class has only one public property (MessageBodyMember
) which returns an instance of another class which is decorated with the XmlRoot
attribute. This class (which is decorated with xmlRoot
) has a property which gives the Collection
of objects of some entity class which has XmlElement
properties in it.
Which all things I need to check/verify? I can provide class code snippets if required.