Wayne Brantley - 169 - Dec 9, 2013

Servicestack 4 conversion help.

I converted everything that changed in v4 and it compiles.   I fired up the website that hosts these and I got the ‘exceeded more that 10 DTO’.  I put in my license key…and tried to bring up the metadata page.   Problem is, I get a blank page!

The good news is the services work - just the metadata page shows up blank.  Additionally, I have swagger installed and it does not seem to work either (says cant read swagger JSON from resource).  

Any ideas?

Yeah it doesn’t auto re-direct, you can add a ‘default.html’ (or if you’re using razor default.cshtml). Metadata page is available from /metadata

With swagger, did you try /swagger-ui ?

Wayne Brantley:

Swagger - I had this working with V3.  With version 3, I had edited the index.html and changed the url parameter to be …/ssapi/resources.   That was working fine.   When I uninstalled everything and put V4 in, those changes were lost and I was left with the swagger-ui page that points to the default todo app.  (launching /swagger-ui launched swagger and showed the API from that site).  So, I changed that back to what I had before “…/ssapi/resources” and it does not work.  Simply shows “Can’t read swagger JSON from http://localhost/../ssapi/resources”.  So, I cannot get it to work at all.  (Also, my understanding was if I requested /swagger-ui it would just work (with your new binding) and I would not have to edit anything…? )

Wayne Brantley:

Most everything is working, except swagger.  Any ideas?  Can you advise - am I supposed to be able to run this without modifying index.html (with your new autohook up)?  Going to /ssapi/resources shows a json result.  The json result shows {“swaggerVersion”:“1.1”,“basePath”:“http://localhost/ssapi”,“apis”:[{“path”:"/resource/Imaging"}]}.   Problem with that is the basepath is wrong.  It is located http://localhost/testsite/ssapi.   Upon further testing, if I put the full path of “http://localhost/testsite/ssapi/resources” in, it  will show the ‘imaging’ service, but then give an error of being unable to load “http://localhost/ssapi/resource/Imaging”.  So, it looks like the servicestack resources is returning an absolute URL instead of a relative one?

The correct url should be: http://localhost/testsite/ssapi/swagger-ui/ What does that show?

Also if the base path is wrong it might have something to do with the auto stripping of the App Virtual Path, which you can try skipping with:

            SetConfig(new HostConfig
            {
                StripApplicationVirtualPath = false,
            });

FYI I just enabled Swagger and deployed it on the public website: https://servicestack.net/swagger-ui/

Can you tell me some details about your environment, i.e. is it Stand-alone SS or with MVC? Are you using IIS, IIS Express, VS Dev server? and can you send me the results of this: http://localhost/testsite/ssapi/?debug=requestinfo (needs to be in DebugMode or as an Admin user).

Wayne Brantley:

This is an ASP.NET website, based off MVC template – but there are no controllers or anything.  Essentially just a SS site.  I am running this as an ‘iis application’ under IIS on Windows 7.  

Emailed you the results you requested.  Note how the absoluteUri and are resolveAbsoluteUrl incorrect.  The other values seems to have the correct path, but those two are wrong….

Actually debugging it now, I know why I’ve kept it /swagger-ui/ it’s so all the resource links in the static templates still work. So I’m going to have to keep the same name, will just have to document it better, i.e. add a link to the metadata page or something.

Wayne Brantley:

Agree…let me know if you need anymore info.

Hi Wayne, I just deployed v4.04 that should fix the swagger issue, and the default url should also redirect to the /metadata page by default. A link to the Swagger UI should appear in the /metadata page under “Plugin Links”.

Wayne Brantley:

Not working, see email.