c# - Cannot find security header in the message -
i did research related questions, not find answer in case.
i have created service reference , when calling method, i'm getting following exception:
security processor unable find security header in message. might because message unsecured fault or because there binding mismatch between communicating parties. can occur if service configured security , client not using security
i have following setting in appconfig file:
<system.servicemodel> <bindings> <basichttpsbinding> <binding name="myhttpbinding"> <security mode="transportwithmessagecredential"> <transport clientcredentialtype="none"></transport> <!--<message clientcredentialtype="username"/>--> </security> </binding> </basichttpsbinding> </bindings> <client> <endpoint address="https://webserviceurl/services/myobject" binding="basichttpsbinding" bindingconfiguration="myhttpbinding" contract="myobject.myobjectporttype" name="myobjecthttpport" /> </client> </system.servicemodel>
and code:
responseobject responseobj = new responseobject(); system.servicemodel.description.clientcredentials clientcredentials = new system.servicemodel.description.clientcredentials(); myobjectporttypeclient myclient = new myobjectporttypeclient(); myclient.clientcredentials.username.username = "username"; myclient.clientcredentials.username.password = "password"; responseobj = myclient.mymethod(objectwithfieldstosend)
when calling mymethod
, i'm getting mentioned exception.
according exception, there should security header in message. however, webservice vendors not mention how build header in specification.
also, tried create web reference service, thinking may solve problem, when calling same method, got following exception:
the request failed empty response
any suggestions?
Comments
Post a Comment