问题
I have a WCF 4 web service that checks for a soap header. This works fine with a WCF client but I have a customer that needs to use the old web reference from their app. How do you consume a WCF service using Add Web Reference and the add a SOAP header in the client? Lets keep it simple and say I want to pass a country in a header, so the header name will be country.
Thanks, Paul
回答1:
You need to expose your endpoint across the basicHttpBinding in order to interoperate with pre .net 3.0 clients.
UPDATE
Does this help? http://msmvps.com/blogs/paulomorgado/archive/2007/04/27/wcf-building-an-http-user-agent-message-inspector.aspx
来源:https://stackoverflow.com/questions/8581831/consume-wcf-service-using-add-web-reference-and-add-a-soap-header