C# Server with HTTPS

Started by
13 comments, last by paulecoyote 17 years, 7 months ago
Quote:Original post by Serapth
Quote:Original post by paulecoyote
Poke around here for WSE http://msdn.microsoft.com/webservices/webservices/building/wse/default.aspx



The problem with WSE is he is going to need to run ASP.NET or another webserver to implement what he wants.


Actually it's independant from transport, you can just TCP. WSE 2 is .Net 1.1.

If you download the WSE Quickstarts you'll find an example called "TCPStockService" which illustrates this

/*=====================================================================  File:      StockService.cs  Summary:   This is a sample which allows the user to send a message             to a Web service. This sample illustrates using the same client proxy             to call either an ASP.NET Web Service via HTTP hosted in IIS or             an Web Service hosted by a console app via TCP.            To run this sample first run the TCPStockService Console App built here            \Samples\CS\QuickStart\Basic\TCPStockService\TCPStockService\bin\Debug            then run the client, assuming that you have already created the vdir            for the IIS hosted service by running CreateSampleVdir.bat---------------------------------------------------------------------  This file is part of the Web Services Enhancements 3.0 for Microsoft .NET Samples.  Copyright (C) Microsoft Corporation.  All rights reserved.This source code is intended only as a supplement to MicrosoftDevelopment Tools and/or on-line documentation.  See these othermaterials for detailed information regarding Microsoft code samples.This sample is designed to demonstrate WSE features and is not intended for production use. Code and policy for a production application must be developed to meet the specific data and security requirements of the application.THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANYKIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THEIMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR APARTICULAR PURPOSE.=====================================================================*/using System;using System.Collections;using System.Web;using System.Web.Services;using System.Web.Services.Protocols;using System.Xml.Serialization;using Microsoft.Web.Services3.QuickStart;[WebService(Namespace = "http://stockservice.contoso.com/wse/samples/2005/10")][WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]public class StockService : System.Web.Services.WebService{    public StockService()    {    }    [WebMethod]    [SoapDocumentMethod(ResponseElementName = "StockQuotes")]    [return: XmlElement("StockQuote")]    public StockQuote[] StockQuoteRequest([XmlArray(IsNullable = true), XmlArrayItem("Symbol", IsNullable = false)] string[] symbols)    {        ArrayList list = new ArrayList();        foreach (String symbol in symbols)        {            StockQuote quote = new StockQuote();            quote.Symbol = symbol;            if (symbol == "FABRIKAM")            {                quote.Name = "Fabrikam, Inc.";                quote.Last = 120.00;                quote.PreviousChange = 5.5;            }            else            {                quote.Name = "Contoso Corp.";                quote.Last = 50.07;                quote.PreviousChange = 1.15;            }            list.Add(quote);        }        return (StockQuote[])list.ToArray(typeof(StockQuote));    }    }
Anything posted is personal opinion which does not in anyway reflect or represent my employer. Any code and opinion is expressed “as is” and used at your own risk – it does not constitute a legal relationship of any kind.
Advertisement
Ok, I'v tried to create my server in C# with your documentation Serapth. I have only one problem remaining, How on earth do i create a certificate, and where do i configure this with my server. I have No idea how this work. I searched on the internet but there is so many different certificat under different server that i don't know what to chose. :(
Ok, I'v tried to create my server in C# with your documentation Serapth. I have only one problem remaining, How on earth do i create a certificate, and where do i configure this with my server. I have No idea how this work. I searched on the internet but there is so many different certificat under different server that i don't know what to chose. :(
Quote:Original post by deathwearer
Ok, I'v tried to create my server in C# with your documentation Serapth. I have only one problem remaining, How on earth do i create a certificate, and where do i configure this with my server. I have No idea how this work. I searched on the internet but there is so many different certificat under different server that i don't know what to chose. :(


Sorry, cant help much. The only time I needed to do this stuff, the place I was at had its own cert server, so it was a relatively trivial task to get one.
Google makecert.

If you've got a Windows Server OS, you can install certificate services and generate one.

Or look in to openssl and the like.
Anything posted is personal opinion which does not in anyway reflect or represent my employer. Any code and opinion is expressed “as is” and used at your own risk – it does not constitute a legal relationship of any kind.

This topic is closed to new replies.

Advertisement