Solved

"No Security header in message but required by policy" error message when calling a webservice

Posted on 2010-09-22
2
1,165 Views
Last Modified: 2012-05-10
How do I stop getting this error? There is no certificate for the web service. Am I missing something?
 Dim MyService As TESTWEBSERVICE.test.PersonInfoWebServiceClient = New TESTWEBSERVICE.test.PersonInfoWebServiceClient



        Dim MyResult As test.getPersonResponse = New test.getPersonResponse



        MyService.ClientCredentials.UserName.UserName = "uid"

        MyService.ClientCredentials.UserName.Password = "pwd20"

        Try

            MyResult.response = MyService.getPerson("TED")

        Catch ex As Exception

            MsgBox(ex.Message)

        End Try

Open in new window

0
Comment
Question by:cobolinx1
2 Comments
 

Author Comment

by:cobolinx1
ID: 33737345
Anyone?
0
 
LVL 15

Accepted Solution

by:
aibusinesssolutions earned 500 total points
ID: 33745129
Try using CredentialCache.DefaultCredentials.

DefaultCredentials represents the system credentials for the current security context in which the application is running. For a client-side application, these are usually the Windows credentials (user name, password, and domain) of the user running the application. For ASP.NET applications, the default credentials are the user credentials of the logged-in user, or the user being impersonated.

http://msdn.microsoft.com/en-us/library/system.net.credentialcache.defaultcredentials.aspx
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now