.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

WsHttpBinding over Https

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :WCF


I have created wcf web service with wsHttpBinding with certificate, when i install it on client machine i accept the following exception :

[ServiceActivationException: The service cannot be activated due to an exception during compilation.  The exception message is: Could not find a base address that matches scheme http for the endpoint with binding WSHttpBinding. Registered base address schemes are [https]..]


View Complete Post

More Related Resource Links

Automatically redirect to HTTPS and check if SSL is active



I've set in the web.config:

    <!-- User Authentication -->
    <authentication mode="Forms">
      <forms loginUrl="~/Page/View/Content/Login.aspx" timeout="2880" requireSSL="true" />

This works fine. If there is no ssl connection, the login form doesn't continue. But I would like to check if ssl is active (in codebehind) and, if it's possible, to automatically the user to the https page if he's currently on http. (I could do this job by manually redirect with page.response("https://url.../login.aspx"); but this is not really generic. For example if the webapp is moved to another domain it doesn't work anymore... I'm looking for something like: FormsAuthentication.RedirectWithSSL(); or so... :D)


How to switch between HTTP and HTTPS in ASP.NET MVC2


ASP.NET MVC2 has the new RequireHttpsAttribute that you can use to decorate any action to force any non-secure request to come through HTTPS (SSL).  It can be used as simply as this:

        public ActionResult LogOn()

Now any request to the LogOn action that is not over HTTPS will automatically be redirected back to itself over HTTPS.  This is very useful and easy to implement.

Unfortunately though, once the scheme is changed to HTTPS, all following requests will also be under HTTPS, which is not necessarily what you want.  In most cases you do not need all requests to your site to be secure but only certain ones such as the logon page or pages that accept credit card information. 

To handle this you can override the Controller.OnAuthorization method.  From within this method, you can check to see if the RequireHttps attribute is set on the Controller Action by searching the Attributes collection of the ActionDescriptor object. If the RequireHttpsAttribute is not set AND the request is under SSL, then return a redirect result to the HTTP (no

https subdomain


 i have set up a site with various subdomains (samples, secure and customers)

one subdomain secure.[sitename].com is available only to logged in customers and should be accessed via https

using IIS Manager I have done the 'edit bindings' thing to set up a https binding

I have purchased a SSL Certificate which I have bound to the subdomain only

if i go to http://secure.[sitename].com the user is prompted to login (via a login.aspx page in the main site root directory) and once authenticated taken to the secure subdomains Default.aspx page

however if i go to https://secure.[sitename].com i get the internet explorer cannot display the page

is there anything i am missing?

am a complete newbie at this, so if i am missing something obvious i apologise, or if i need to give more info here please let me know

any help GREATLY appreciated

HTTPS SSL Bing Searches in SharePoint 2007


I love the federation of Bing search results in our Search Center, but the content delivered via non-SSL connection pop-up is super annoying.
Is there a way to keep the Bing search federation, but have it use an SSL connection instead so that I don't get this error?

I tried to use Bing manually by visiting https://www.bing.com and I get redirected back to http://www.bing.com.


Richard Green, MCSE Windows Server 2003

workflows on https: versus http:

I have a production site that uses https:.  I noticed that if I access the site with http instead, the workflows don't start.  Can anyone explain that to me please?

why does WSDL file have httpS? i just need http

I built my c# web service.  Tested it.  I built my android app.  Tested it.  All is well.  I tried to get these things to talk to each other...FAIL.  I found these lines in my wsdl. <wsdl:service name="Service1"> - <wsdl:port name="Service1Soap" binding="tns:Service1Soap"> <soap:address location="" /> </wsdl:port> - <wsdl:port name="Service1Soap12" binding="tns:Service1Soap12"> <soap12:address location="" /> </wsdl:port> </wsdl:service> What decided that the path should be https?  I never told it that.  It is overriding IIS which says everything should be http.  Someone please help me before I go ballistic.  Oh and for others developing on android 2.2, it won't take unsigned certs, so you either have to configure a local certificate authority or go http. 

C# - Creating web client for automating user activity on a HTTPS site

I've been wracking my brain for a couple of weeks on this.  I need to create a web client (I don't want to use the webBrowser control because I need this to be as lightweight as possible) to log in to a secure web site, and then effectively click links and fill in fields to get the data that would normally be displayed in the web browser.  I'm then going to parse the data and perform other actions with it. I have been working with HttpWebRequest and HttpWebResponse and many permutations of suggestions I have found while Googling my issue, but I can't get rid of my problem:  Sometimes when I effictively click the ultimate link that I need to click to get to my data, I get what I am looking for.  However, MOST of the timel, I get a response page that tells me my connection timed out and that I need to log in again.  I have tried messing with cookies and such, but to no avail. I know it's good form to post my code, but it is so sloppy and screwed up right now from tweaking this and trying that, that I'd rather not take the approach of fixing what's there, rather I'd like to start with solid, clean code to begin with. Your help will be greatly appreciated. Thanks, ALo

Posting data to a website (HTTPS) from a Desktop Application in Visual Basic (.Net 3.5 or .Net 4.0)

Hello everyone, I'm trying to create a desktop application that will update my IPv4 address to an IPv6 Tunnel broker.  I have the app running up to the point where it sends the data to the website, and then I get exceptions.  I'd like someone to take a look at my code, and tell me what I've got wrong (if anything).  Here's the code that I have (the only portion that is filled in is for Hurricane Electric) Dim strUsername As String = txtUsername.Text.ToString 'User Id supplied by the User. Dim strPassword As String = txtPassword.Text.ToString 'Password supplied by the User. Dim strPasswordHash As String = "" ' this will be created from the hashing of the password supplied by the user. Dim strTunnelID As String = txtGlobalTunnelId.Text.ToString 'Global Tunnel ID (He.net and ) Dim strUrl As String = "" ' Place holder for the URL Which will be provided after the password is hashed and specified by the tunnel broker. Dim strTunnelBroker As String = cbxTunnelBroker.SelectedItem 'Sets the Tunnel Broker to the user specified one. Dim wc As New WebClient() 'Allows for posting data to the server 'holds the server response. Dim strData As String = "" 'Provides the data for the form. Dim result As String = "" Select Case strTunnelBroker Case

asp:Menu submenu hover/expansion + HTTPS = Security Information Popup

Hello,I have a an asp:Menu with a datasource and the page is being accessed by https. If I hover over one of the menu items that has a subitem I get this popup.Here is my code,//asp <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="UI_Common_Test" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:Menu ID="Menu1" runat="server" DataSourceID="dsSiteMap" Orientation="Vertical" StaticDisplayLevels="2"> <DataBindings> <asp:MenuItemBinding DataMember="SiteMapNode" TextField="Title" /> </DataBindings> </asp:Menu> <asp:SiteMapDataSource ID="dsSiteMap" runat="server" SiteMapProvider="Public" /> </div> </form> </body> </html> //cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI;

switch between http to https

What is the best way to switch to https from http for some of my aspx pages. Currently, I"m using relative page for all pages.

run over https

Hi I have to fix some bugs. My client is using https instead of http. They are getting some problems. I think those are due to security reasons. Website is developed using visual studio 2008 (ASP.Net 3.5), SQL server 2008.I want to repeat the problem by running webapp on https:.can I run my website over https instead of http.any ideas???

User permissions in SharePoint 2010 act differently in http and https

I installed SharePoint 2010, created a site (complete with a document library), and assigned user permissions.  Additionally, I set up certificate authentication for all users.  Two problems occur: 1. As the system administrator, when I access the https site, I no longer have permissions to add/edit users 2. When user's, who have permissions to edit/add a document/folder click on "Add document" or the folder icon to add a new folder, they get an error. Any help is much appreciated.

WCF with wsHttpBinding and x509 Certificate - can I use VB/C# to connect with PHP?

We connect to a web service hosted by another company.  We send a customer's basic info to the service, and replies with rates/prices for that customer. I am a PHP guy -- started out playing with basic HTML, then delved into PHP about 8 years ago, and my entire web app is PHP with javascrtipt/ajax mixed in as needed.  I'm a learn-as-I-go guy. For the last two years, the service has been an aspx web service, which was easy -- just connect with PHP's SoapClient.  Now, the company hosting the service has changed it to WCF, and the binding is wsHttpBinding, and authentication is done via x509 certification. I've determined that PHP's SoapClient can't handle wsHttpBinding.  So my first roadblack - how the heck do I connect to this service?  I went as far as to install MS Visual Web Developer 2010 Express, and then I used svcutil.exe to create .config and .cs files for the service.  But understand, I've never written anything in C# or VB.  I've done a few little VBScripts in the past, and I can handle javascript... but I'm looking at these .config and .cs files and thinking, now what the heck do I do with these?? Basically, I just want to connect to this service using PHP and javascript.  But since it seems that's impossible (correct?), is there a way I can invoke a VB/C# operation from within my PHP script?  For ins

WSHttpBinding with out WS- securty?

Hey!Is it posible to use WSHttpBinding without the WS-security?The Config could look like this:            <wsHttpBinding>                <binding name="Binding1"    hostNameComparisonMode="StrongWildcard"    receiveTimeout="00:10:00"    sendTimeout="00:10:00"    openTimeout="00:10:00"    closeTimeout="00:10:00"    maxReceivedMessageSize="131072"    maxBufferPoolSize="1048576"    messageEncoding="Text"    textEncoding="utf-8"    bypassProxyOnLocal="false"    useDefaultWebProxy="true" >                    <security mode="Message">                        <transport clientCredentialType="None"/>                    </security>                    <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />                </binding>            </wsHttpBinding>But if we change the security mode to the fallowing:            <wsHttpBinding>                <binding name="Binding1"    hostNameComparisonMode="StrongWildcard"    receiveTimeout="00:10:00"    sendTimeout="00:10:00"    openTimeout="00:1

WCF fails to work for HTTPS & HTTP

Currently I am having an issue with getting my WCF ajax calls to work with HTTPS. I get a javascript error telling me the service cannot be found. We need to be able to be able to access the site through http and https. We have some of our consultants who cannnot access the site via their client site without using https. We need both http and https to work. Here is my web.config as is now...   <system.serviceModel> <behaviors> <endpointBehaviors> <behavior name="Time.AjaxServiceAspNetAjaxBehavior"> <enableWebScript /> </behavior> </endpointBehaviors> </behaviors> <bindings> <webHttpBinding> <binding name="webHttpBindingAuthenticated" sendTimeout="00:04:00"> <security mode="TransportCredentialOnly"> <transport clientCredentialType="Ntlm" /> </security> </binding> </webHttpBinding> </bindings> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" > <baseAddressPrefixFilters> <add prefix="http://www.ourdomain.com"/> </baseAddressPrefixFilters> </serviceHostingEnvironment> <services> <service name="Time.AjaxService"> <endpoint address="" behaviorConfiguratio

Security exception on Merge Replication over HTTPS,

Hi, I've setup SQL 2005 Merge replication over HTTPS for few remote machines. Most of them are working great but this particular machine is causing me a lot of problem. Here's message details from SQL agent job. Message 2010-08-04 15:57:00.999 The system cannot find the file specified. 2010-08-04 15:57:01.015 Category:NULL Source:  Merge Process Number:  -2147221502 Message: The system cannot find the file specified. 2010-08-04 15:57:01.031 Category:NULL Source:  Merge Process Number:  -2147199373 Message: The Merge Agent failed to connect to the Internet proxy server for user 'UserName' during Web synchronization. Ensure that the proxy server settings are correctly configured in Internet Explorer, or specify the -InternetProxyServer parameter when starting the Merge Agent. 2010-08-04 15:57:01.031 Category:NULL Source:  Merge Process(Web Sync Client) Number:  -2147010889 Message: The Merge Agent could not connect to the URL 'https://serveraddress/replisapi.dll' during Web synchronization. Please verify that the URL, Internet login credentials and proxy server settings are correct and that the Web server is reachable.   Machine is directly connected to the internet, doens't use proxy server so it's not proxy issue. Any checkboxes in IE connection setting are all unchecked. I searched web, some people resolved this issue by instal

WCF client WS-Security Username + X.509 + https

Hi all, I need help to build a wcf client. The client has to send a ws-security message wiht BinarySecurityToken tag and UsernameToken tag. The transport is https. The UserNameToken is composed only by the Username field without the Password. I have set in configuration file the security mode="TransportWithMessageCredential" but  I cannot set in the <message clientCredentialType="">  "Username" and "Certificate" both active at the same time. I have to send in the soap header two Reference with two digest, one for the body, one for the UsernameToken. Can someone  help me ? By and Thanks
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend