webservice.htc & https

Discussion in 'ASP .Net Web Services' started by Bart Malfait, Jan 13, 2004.

  1. Bart Malfait

    Bart Malfait Guest

    Hi,

    we want to access a webservice using https using webservices.htc (IE6). Is
    this possible ?

    Scenario: we've set up a server (W2K, .NET 1.1, latest SP's) with a
    test-certificate (generated with makecert.exe). We also installed the
    certificate as a trusted authority on the client (W2K, .NET 1.1, latest
    SP's). Calling https://MyServer/ServiceTest/MyWebService.asmx?wsdl in the
    client's IE succeeds. As expected, no pop-up anymore warning on an
    unauthorized certificate. So far so good.

    However, if we invoke the same URL in a piece of javascript in an html page,
    using webservice.htc, we get a 'service not available' error. Replacing
    'https' with 'http' succeeds. SSL-port is default on the server (443). Both
    the javascript & webservice.htc are installed locally on the client (see
    also below)

    Any ideas what may go wrong are very appreciated !


    ----
    FYI - client html page using webservices.htc:

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=windows-1252">
    <title>New Page 2</title>
    </head>
    <script>
    var webServiceNameSpace;
    var webService;

    function loadWebService()
    {
    webServiceNameSpace = document.namespaces.add("webServiceNS",
    "http://MyClient/Resources/webService");

    webServiceNameSpace.doImport("http://MyClient/Resources/webservice.htc");

    if (webServiceNameSpace != "complete") {
    webServiceNameSpace .attachEvent("onreadystatechange",
    createWebService);
    }
    else {
    createWebService();
    }
    }

    function createWebService()
    {
    var useOptions;

    if (webServiceNameSpace .readyState == "complete")
    {
    webService = document.createElement("webServiceNS:webservice");
    webService.id = "_servicegateway";
    webService.visibility = "none";
    document.appendChild(webService);
    useOptions = webService.createUseOptions(true);

    webService.useService("https://MyServer/ServiceTest/MyWebService.asmx?wsdl",
    "myWebService", useOptions);
    webService.myWebService.callService(handleResponse,
    "HelloWorld");
    }
    }

    function handleResponse(result)
    {
    alert(result.error);
    }
    </script>

    <body onload = "loadWebService()"> ... </body>

    </html>
     
    Bart Malfait, Jan 13, 2004
    #1
    1. Advertising

  2. Bart Malfait

    Bart Malfait Guest

    Bart Malfait, Jan 13, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cory
    Replies:
    2
    Views:
    1,353
    Eric Lawrence [MSFT]
    Feb 20, 2004
  2. al

    webservice.htc???

    al, Jun 27, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    443
    John Timney \(Microsoft MVP\)
    Jun 27, 2004
  3. batista
    Replies:
    1
    Views:
    950
    Laurent Bugnion
    Jan 26, 2006
  4. batista
    Replies:
    0
    Views:
    581
    batista
    Jan 26, 2006
  5. batista
    Replies:
    0
    Views:
    269
    batista
    Jan 26, 2006
Loading...

Share This Page