Page 1 of 1

Error deploying REST API via IIS

PostPosted: Fri Sep 27, 2019 5:53 pm
by DannyC
I am trying to deploy the REST API via the instructions for IIS according to
https://docs.jiwa.com.au/display/J7UG/REST+API

The reason for using IIS is we want to deploy a signed certificate to use HTTPS.

I am at the step where I run
Code: Select all
JiwaAPI.deploy.cmd /T
from the folder C:\Program Files (x86)\Jiwa Financials\Jiwa 7\JiwaAPI.
But it is returning an error
Code: Select all
\Jiwa was unexpected at this time


I have no idea what that means or how to fix it.
Or if there is an easier way to use the REST API with a signed certificate over HTTPS, let me know!

cheers
Danny

Re: Error deploying REST API via IIS

PostPosted: Tue Oct 01, 2019 7:23 pm
by DannyC
Client was hoping for a quick answer. Any tips?

Re: Error deploying REST API via IIS

PostPosted: Wed Oct 02, 2019 9:51 am
by Scott.Pearce
Copy the JiwaAPI folder from c:\Program Files (x86)\Jiwa Financials\Jiwa 7\ to somewhere where there are no spaces in the path (i.e. c:\). Then run the JiwaAPI.deploy.cmd from there instead.

Re: Error deploying REST API via IIS  Topic is solved

PostPosted: Fri Oct 11, 2019 3:20 pm
by SBarnes
In the end we did it manually by taking the files from the zip file and copying them to a directory.

Re: Error deploying REST API via IIS

PostPosted: Fri Oct 11, 2019 3:39 pm
by Mike.Sheen
DannyC wrote:I
The reason for using IIS is we want to deploy a signed certificate to use HTTPS.


If that's the only reason for using IIS over self-hosted then you're doing it wrong!

You just need to install the certificate into the store on the machine running the self-hosted service and then change the config to use the urlbase of https://*:443/ - that's exactly what I did when I setup https://api.jiwa.com.au - it's using the self hosted service and an SSL certificate from Comodo.

Where you would want to use IIS is if you want to have multiple virtual sites - so you want port 443 to be forwarded from the WAN to the machine and you can then have multiple sites using the default SSL port 443 - IIS will look at the request header and route the requests to the correct virtual site.

If you despise IIS and still want multiple sites, you can put an NginX, Apache or whatever proxy you fancy in and have that forward requests to other ports or machines as well.

Re: Error deploying REST API via IIS

PostPosted: Fri Oct 11, 2019 3:47 pm
by SBarnes
My friend don't even go there :roll: they are using 443 for their vpn this was the easiest outcome

Re: Error deploying REST API via IIS

PostPosted: Fri Oct 11, 2019 4:47 pm
by DannyC
As Stuart says, the client had already used 443.
So we used a random port, happened to be 3999.

IIS seemed to be simplest at the time. Anyway we got it working, but good to know the solution for use over port 443.

Re: Error deploying REST API via IIS

PostPosted: Fri Oct 11, 2019 5:00 pm
by Mike.Sheen
DannyC wrote:As Stuart says, the client had already used 443.
So we used a random port, happened to be 3999.

IIS seemed to be simplest at the time. Anyway we got it working, but good to know the solution for use over port 443.


Ok, so you should be able to still run it as self hosted on 3999, and create a virtual site in IIS which is a reverse proxy to the service running on port 3999.

Googling IIS Reverse Proxy has some good guides and resources - eg: https://blogs.msdn.microsoft.com/friis/ ... orld-apps/

Re: Error deploying REST API via IIS

PostPosted: Tue Feb 25, 2020 12:46 pm
by Mike.Sheen
I've just worked this out and documented it - see this article - Running the Jiwa Self Hosted REST API on same port as existing IIS webserver using a Reverse Proxy.