Unexpected results using SoapHeaders

Dec 10, 2008 at 2:47 PM
Hi there,

    I was looking for a way to use soap headers as they were supported when implementing asmx web services and came across the SoapHeaders in WCF Extras. I looked through the sample code, and it all seemed so simple, great! However I am not getting the same results when i try to incorporate this stuff in my WCF service.

Firstly I have to say that I am using the web service software factory to create my service. So once I have created all of my Data/Message/Operation contracts and generated the code, i opened up the interface code and modified it with the attributes as shown in the samples and on this site. After generating my service and then generating the proxy for my client, I don't have the soapheader property anywhere to set properties on. Instead I have the Soapheader as the first parameter to my operation contracts

So for example, If i created an operation contract called    void Foo()

Then in my proxy code I would have to call this operation passing in the soapheader explicitly as a parameter    client.Foo(header)   !!!!

Can anyone tell me why this has happened????
Jan 25, 2009 at 12:13 PM
You'll have to configure your client to use a wsdl import extension which will more "friendly" proxy code. See the instructions here for more information.