Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jul 28, 2011 10:54 AM by DarrellNorton
Member
7 Points
8 Posts
Jul 27, 2011 06:05 PM|LINK
I am accessing a client's XML web service and it is currently working. To get to this point they commented out the code that was checking for the user name and password credentials. This is what they are expecting:
<env:Header> <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <UsernameToken xsi:type="m2:UsernameTokenType"> <Username Id="myUsernameTokenId">dev2dev</Username> <Password xsi:type="m2:PasswordString" Id="irrelevant_to_xx">d2dpwd</Password> </UsernameToken> </Security> </env:Header>
This is the code I have now trying to send them the username and password:
XService rome = new XService(); rome.Credentials = new NetworkCredential("xxxxxxxx", "xxxxxxxx");
How do I send the proper credentials?
Thanks,
Mike
All-Star
86635 Points
9629 Posts
Moderator
MVP
Jul 28, 2011 10:54 AM|LINK
Try code like this to set your credentials:
rome.ClientCredentials.UserName.UserName = "joecool"; rome.ClientCredentials.UserName.Password = "test123";
If that doesn't work, try checking this link: http://www.codeproject.com/KB/cpp/authforwebservices.aspx
bigasscactus
Member
7 Points
8 Posts
Trouble with WSSE security.
Jul 27, 2011 06:05 PM|LINK
I am accessing a client's XML web service and it is currently working. To get to this point they commented out the code that was checking for the user name and password credentials. This is what they are expecting:
<env:Header> <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <UsernameToken xsi:type="m2:UsernameTokenType"> <Username Id="myUsernameTokenId">dev2dev</Username> <Password xsi:type="m2:PasswordString" Id="irrelevant_to_xx">d2dpwd</Password> </UsernameToken> </Security> </env:Header>This is the code I have now trying to send them the username and password:
XService rome = new XService(); rome.Credentials = new NetworkCredential("xxxxxxxx", "xxxxxxxx");How do I send the proper credentials?
Thanks,
Mike
DarrellNorto...
All-Star
86635 Points
9629 Posts
Moderator
MVP
Re: Trouble with WSSE security.
Jul 28, 2011 10:54 AM|LINK
Try code like this to set your credentials:
If that doesn't work, try checking this link: http://www.codeproject.com/KB/cpp/authforwebservices.aspx
Darrell Norton's Blog
Please click "Mark as Answer" if this helped you.