self-hosted (web) service

Forum folks,
I’m looking at writing a self-hosted (web) service. This service will run under windows server 2008 without IIS running. The windows server is running MSSQL Server 2012. The service should take input from a remote machine with data to be massaged by an already extant stored procedure so the service should pass the incoming data through to the stored procedure after some verification etc. My thought is to have the remote machine send a JSON string that the service then verifies and configures before sending it off to the stored procedure.

It seems that I’ll need to be able to build to the web version of Xojo and then deploy… or do I? I don’t know enough about the deployment deliverables of the web version to answer my question. Is it a cgi that needs to be run under a web server? I want to be able to talk to the build deliverable without having the overhead of maintaining a web server as well (thus ‘self-hosted’). Is it possible to write/build a service that accepts something like a JSON string without using the web version i.e. using desktop framework or perhaps even just the console framework?

I know there are solutions for this process through visual studio. Having spent the last two days looking at the requirements and running through tutorials using the WCF (Windows Communication Framework) and the Holy Hell of configuration options that sorta work when you do things ‘just so’, I thought I would step back and take a look at this problem from a Xojo perspective and get some feedback from the most excellent Xojo forum.

Thoughts?

It sounds like a standalone web app ought to work for you. The Web Services webinar covers how you can create a web service using a Xojo web app.

Web Services webinar

Excellent. I had looked at the QuoteService-SpecialURL example and this Webinar absolutely builds out on that. Consuming now.

Well… this all worked until I started testing and ran smack into Cross-Origin XMLHttpRequest issues. I don’t seem to be able to set the Access-Control-Allow-Origin header on the web-app so that Cross-Origin Resource Sharing (CORS) can be implemented… I think. In any case, everything works when testing from latest safari on os x but not from any other browser (win or os x) due to:

XMLHttpRequest cannot load http://10.211.55.7:8080/special/DMVin. No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘null’ is therefore not allowed access.

Have any of you web gurus seen this before?

Well apparently I only need that when the request is coming from a browser. Since the request I’ll be working with will be coming from another program, the restrictions I’ve seen in the various browsers are just that - restrictions in the browser (for your safety of course)