axnst2
asked on
DataContract(IsReference=true) causes 'Content Type application/soap+xml; charset=utf-8 was sent to a service expecting text/xml; charset=utf-8. The client and service bindings may be mismatched.'
Hi Experts,
I have a WCF (BasicHTTPBinding) web service (hosted in a Windows Service) that I need to use to deliver an array of self referencing (circular reference, kind of like a linked-list with parent and children) objects. When I try to transfer this via the web service, I get errors on the array. I traced this error back to the fact that the objects in the array have "circular reference" and that I need to put the [DataContract(IsReference= true)] in front of my class to overcome the issue. However, when I do that, I get the blow error:
'Content Type application/soap+xml; charset=utf-8 was sent to a service expecting text/xml; charset=utf-8. The client and service bindings may be mismatched.'
I do not get the error if I only have '[DataContract]' in fron of the class. BTW, the service has dozens of other functions that are/have been working just fine.
PLEASE HELP! THIS IS URGENT!!!!!
Thanks!
I have a WCF (BasicHTTPBinding) web service (hosted in a Windows Service) that I need to use to deliver an array of self referencing (circular reference, kind of like a linked-list with parent and children) objects. When I try to transfer this via the web service, I get errors on the array. I traced this error back to the fact that the objects in the array have "circular reference" and that I need to put the [DataContract(IsReference=
'Content Type application/soap+xml; charset=utf-8 was sent to a service expecting text/xml; charset=utf-8. The client and service bindings may be mismatched.'
I do not get the error if I only have '[DataContract]' in fron of the class. BTW, the service has dozens of other functions that are/have been working just fine.
PLEASE HELP! THIS IS URGENT!!!!!
Thanks!
ASKER
'I have a WCF (BasicHTTPBinding) web service (hosted in a Windows Service) ' - Is this what you're asking?
'Did you try to update the service reference after adding IsReference = true?' - Yes, and that's when I get the error. I use NetCFSvcUtil to generate the signitures
'Did you try to update the service reference after adding IsReference = true?' - Yes, and that's when I get the error. I use NetCFSvcUtil to generate the signitures
I saw something about using wsHttpBinding, instead of BasicHttpBinding. Was there a reason for using basic binding?
ASKER
Yes, I saw that too. I didn't create the original service, but I think it was set to BasicHttpBinding becasue the web Service service is accessed from a Windows Mobile device, and therofore, the Compact Framework (from the client side that is). Either way changing it to wsHttpBinding resulted in the same error.
Are you able to use an HTTP debugger, like Fiddler, to see what the response really is?
I am trying to find a reference to the configuration issue, so we can find a resolution.
I am trying to find a reference to the configuration issue, so we can find a resolution.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Did you try to update the service reference after adding IsReference = true?