WebService authentication

M

Maxim

Hello, everybody!

I need to connect to a WebService, that requires authentication. From
service description page I have found that SOAP request header should be as
follows:

<SOAP-ENV:Header>
<wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecuri
ty-secext-1.0.xsd">
<wsse:UsernameToken>
<wsse:Username>username</wsse:Username>
<wsse:password>password</wsse:password>
</wsse:UsernameToken>
</wsse:Security>
</SOAP-ENV:Header>

I have tried to use the following code snippet:

service.Credentials = new NetworkCredential(tbUsername.Text,

tbPassword.Text);
service.PreAuthenticate = true;

But it doesn't work.

WebService has sample code but it uses NET Framework 1.1 and
Web Service Enhancements 2.0. While I'm using CF2.

So how should I authenticate my request?

Or is there any possibility to get and modify the SOAP request just before
it is posted to a WebService?

Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top