c# - How to add security header to a SOAP message? -


i'm trying consume webservice written in java our provider our c# app. when it's time communicate, this:

wsdoallreceiver: incoming message not contain required security header

since yesterday i'm trying find out how add security header soap message.

yes, read ( clueless how create soap <wsse:security> header ) did not work.

i looked around , seems rather asked question. wonder if can here, pointers, code, me started.

i managed achieve using wse. funny thing provider's web services not work wse 3.0, did wse 2.0. here steps

  • get wse 2.0
  • add web reference project
  • in web reference proxy implementation:

replace

public partial class userws : system.web.services.protocols.soaphttpclientprotocol 

by

public partial class userws : microsoft.web.services2.webservicesclientprotocol 
  • before calling web service:

set authentication info

usernametoken token = new usernametoken("user", "pwd", passwordoption.sendplaintext); yourproxy.requestsoapcontext.security.tokens.add(token); 

and that's it! fyi, provider blackboard instance.


Comments