Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6679627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:22:51+00:00 2026-05-26T04:22:51+00:00

Asmx web service is called using Visual Studio generated code from MVC2 controller using

  • 0

Asmx web service is called using Visual Studio generated code from MVC2 controller using code below.

Method call throws exception since web service certificate has expired. How to fix this so that web service can still used?

Using .NET 3.5 and MVC2.

public class AsmxController : Controller 
{ 
    public ActionResult Index() 
    { 
        var cl = new store2.CommerceSoapClient(); 

        //    System.ServiceModel.Security.SecurityNegotiationException was unhandled by user code 
        //Message=Could not establish trust relationship for the SSL/TLS secure channel with authority 'asmxwebservice.com'. 
        var vl = cl.GetVendorList(  AsmxService.LicenseHeader() , 
            new AsmxService.GetVendorListRequest()); 
        return View(); 
    } 
} 

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:22:52+00:00Added an answer on May 26, 2026 at 4:22 am

    From James blog:

    So, for testing, we needed to find a way to bypass the certificate
    validation. It turns out that you need to provide a
    RemoteCertificateValidationCallback delegate and attach it to
    ServicePointManager.ServerCertificateValidationCallback. What’s not
    clear is what happens if two threads are competing to set this
    property to different values, since it’s a static property. Reflector
    suggests that the property set method doesn’t do anything fancy, so
    you could easily get into a race condition.

    so, he does the following:

    // allows for validation of SSL conversations
    ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback(ValidateRemoteCertificate);
    
    // callback used to validate the certificate in an SSL conversation
    private static bool ValidateRemoteCertificate(
    object sender,  X509Certificate certificate,    X509Chain chain,    SslPolicyErrors policyErrors)
    {
        if (Convert.ToBoolean(ConfigurationManager.AppSettings["IgnoreSslErrors"]))
        {
            // allow any old dodgy certificate...
            return true;
        }
        else
        {
            return policyErrors == SslPolicyErrors.None;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using UpdateListItems method (Lists.asmx web service) to update fields of an uploaded
Say I have an ASMX web service, MyService. The service has a method, MyMethod.
Consider the following .Net ASMX web service with two web methods. using System; using
How do you expose a LINQ query as an ASMX web service? Usually, from
Using Visual Studio 2008 and VB.Net: I have a working web app that uses
I'm trying to call an ASP.NET .asmx webservice, from javascript, using other than the
I've got a web service: http://machine001/Services/conversionService.asmx This web service has one method in it
I'm using ajax in my website to call some information from a UserControl called
I am trying to take the code in an .ASMX web service and change
I'm trying to set up a .NET 3.5 web service project in Visual Studio.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.