Programmatically configure WCF client binding to access SSL + Soap 1.1 + Basic Auth -


i'm trying write c# wcf client (generated svcutil wsdl) access cxf (java) service implementing same wsdl.

the service working fine i'm having trouble connecting on c# client because cxf configured ssl + soap 1.1 + basic auth.

so far i've tried following: why basic auth not work wcf client java soap web service?

new basichttpbinding()             {                 security =                     {                         mode = basichttpsecuritymode.transport,                         transport =                             {                                 clientcredentialtype = httpclientcredentialtype.basic,                                 proxycredentialtype = httpproxycredentialtype.none                             },                         message =                             {                                 clientcredentialtype = basichttpmessagecredentialtype.username,                                 algorithmsuite = securityalgorithmsuite.default                             }                     }             }  var client = new webserviceclient(binding, endpoint); client.clientcredentials.username.username = username; client.clientcredentials.username.password = password; 

but doesn't seem send auth header correctly.

i've tried adding header manually outlined http://social.msdn.microsoft.com/forums/en-us/wcf/thread/4f8ab001-dafa-4347-bc41-95255ecc9230. not satisfied being best solution.

can wcf expert outline way of creating binding programmatically supports ssl + soap 1.1 + basic auth?

following header sent wcf

system.net information: 0 : [13620] connectstream#64929093 - sending headers { content-type: text/xml; charset=utf-8 soapaction: "http://api.test.com/services/getthings" host: api.test.com content-length: 552 expect: 100-continue accept-encoding: gzip, deflate } 

while proper header sent soapui

mon may 13 15:33:08 edt 2013:debug:>> "accept-encoding: gzip,deflate[\r][\n]" mon may 13 15:33:08 edt 2013:debug:>> "content-type: text/xml;charset=utf-8[\r][\n]" mon may 13 15:33:08 edt 2013:debug:>> "soapaction: "http://api.test.com/services/getthings"[\r][\n]" mon may 13 15:33:08 edt 2013:debug:>> "authorization: basic bxlivlchjpbqbwwotkxmjg=[\r][\n]" mon may 13 15:33:08 edt 2013:debug:>> "content-length: 317[\r][\n]" mon may 13 15:33:08 edt 2013:debug:>> "host: api.test.com[\r][\n]" mon may 13 15:33:08 edt 2013:debug:>> "connection: keep-alive[\r][\n]" mon may 13 15:33:08 edt 2013:debug:>> "user-agent: apache-httpclient/4.1.1 (java 1.5)[\r][\n]" 


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -