Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I have WSDL file, which I added as ServiceReference in my WCF service.
Now I want to authenticate first and then invoke the method.
How do I achieve this? The soap is like below.

HTML
<soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pay="http://TestPaymentService.com/">
<soapenv:header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<wsse:security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext">
<wsse:usernametoken>
<wsse:username>MyUserName</wsse:username>
<wsse:password>MyPassword</wsse:password>
</wsse:usernametoken>
</wsse:security>
</soapenv:header>
<soapenv:body>
</soapenv:body>
</soapenv:envelope>
Posted
Updated 24-Aug-15 3:45am
v2
Comments
virusstorm 25-Aug-15 13:40pm    
Have you looked at this:
http://codebetter.com/petervanooijen/2010/03/22/a-simple-wcf-service-with-username-password-authentication-the-things-they-don-t-tell-you/

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900