问题
I'm attempting, with great difficulty, to have an WCF client communicate with a WSE 2.0. The wse service requires UserName token for authentication and it would appear that this is not possible over an unsecured channel.
I have configured the following custom bindings:
<customBinding>
<binding name="wse2Binding">
<textMessageEncoding messageVersion="Soap11WSAddressingAugust2004" />
<security authenticationMode="UserNameOverTransport">
<secureConversationBootstrap authenticationMode="UserNameOverTransport" />
</security>
<httpTransport authenticationScheme="Digest"/>
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="http://ecareweb/eCareMessaging1_1/Notification.asmx"
binding="customBinding" bindingConfiguration="wse2Binding"
contract="NotificationSrv.NotificationSoap" name="NotificationSoap1" />
</client>
Do you know of a work-around for this problem
Thanks in advance
回答1:
WCF does not allow you by default, but if you have exceptional circumstances you can still do it. Here is some sample code for using ClearUserNameBinding
回答2:
WCF will not let you send username/password over an HTTP connection. If you have control over the service side I would suggest adding an HTTPS endpoint so you can use transport level security.
来源:https://stackoverflow.com/questions/1425973/wcf-interop-with-wse2-0