Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Carlos Mosqueda 244 posts 435 karma points
    Oct 08, 2015 @ 17:37
    Carlos Mosqueda
    0

    Custom controller calling secure HTTPS service. Not bringing back data

    We created some custom C# controllers that call a service that has both HTTP and HTTPS. The other webservice is hosted on another server and access another DB for us so we can use the data in a custom Umbraco Backend Control.

    We then made a controller in Angular for the Umbraco Backend that pulls data to call the custom C# controller calls (we compile them in Umbraco, so there is a DLL), that call our HTTPS service.
    When we call the HTTPS service we don't get a response in the Umbraco Backend, but when we call the HTTP service we do.

    Our Umbraco website is on Port :80.

    Is this an issue with Umbraco and the way the BackEnd service calls an HTTPS service? Is this a configuration of our network? Is there a setting on IIS or in Umbraco we need to set in order to get a response from HTTPS services?

    Thanks in advance. We are really on a push to find this out. We have been trying to figure it out for about 3 days now.

    We used a Chrome extension, Advanced REST console and was able to hit the HTTPS service and get a response from the same server our Umbraco website is on, but when we try to hit the HTTPS service from Umbraco, we do not get a response.

    (Note, updated wording to include the type of Controller we are using)

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Oct 08, 2015 @ 18:19
    Nicholas Westby
    0

    This may be due to a browser feature that prevents HTTP requests across different origin domains. If it is the same domain, but on HTTPS rather than HTTP, that may be considered a different origin. Refer to this: http://stackoverflow.com/questions/8414786/javascript-cross-domain-call-call-from-http-to-https

    One workaround is to call to that other server from the server side (e.g., a C# MVC or WebApi controller) rather than from the client-side (e.g., an AngularJS controller). Then, your AngularJS controller can call your local server-side controller.

    You could try setting the Access-Control-Allow-Origin on the service so that it allows all origins, but that can potentially fail on some browsers: https://developer.mozilla.org/en-US/docs/Web/HTTP/AccesscontrolCORS#Access-Control-Allow-Origin. Might be better off doing the server-side call I mentioned above.

    By the way, are you not getting a response, or are you just not getting a response body? You should at least be getting an HTTP response code (e.g., 200 for success, 500 for error, 404 for not found, and so on). The Chrome network tab would show this code.

  • Carlos Mosqueda 244 posts 435 karma points
    Oct 08, 2015 @ 19:01
    Carlos Mosqueda
    1

    Hi Nicholas,

    I updated my post. I guess I wasn't quite clear.

    Our custom controller is a C# controller that we are making calls against using Angular to call the C# controller (compiled in Umbraco), that then calls the other service on the other server.

    We actually just found out the the service can not be hit by a desktop application we developed too. So this may not have anything to do with Umbraco. Might be from our other service having issues.

    I just didn't know if anyone had experienced this with this.

    UPDATE: We JUST found out right this second, as I was writing this post, that our server to server calls are having issues. The ServiceStack JSONClient is stopping the communication. So the certificate on the server is stopping the communication. Just an FYI.

    Can just close this post.

Please Sign in or register to post replies

Write your reply to:

Draft