Note that there are some explanatory texts on larger screens.

plurals
  1. POSwagger not able to retrieve operations from ServiceStack resources Service
    primarykey
    data
    text
    <p>I am trying to get Swagger to work with ServiceStack. The web server is located behind a Firewall and accessed from the Internet (my.domain.de:80). Requests are then forwarded to the web server on Port 8070.</p> <p>When visiting the swagger page it is able to access <code>/api/resources</code> and retrieve the List of ServiceMethods, but then fails to retrieve the List of Operations.</p> <p>When I use fiddler to inspect the result I see that he <code>/api</code> is missing so that swagger tries to get the List of Operations from <code>/resources/ServiceName</code> instead of <code>/api/resources/ServiceName</code>.</p> <p>The Swagger-UI gives me the following error message:</p> <blockquote> <p>Unable to read api 'ServiceName' from path <a href="http://my.domain.de/resource/ServiceName" rel="nofollow noreferrer">http://my.domain.de/resource/ServiceName</a> (server returned Not Found)</p> </blockquote> <p>SwaggerConfig:</p> <pre><code>discoveryUrl:"../../api/resources", </code></pre> <p>ServiceStack Config:</p> <pre><code>WebHostUrl = "http://my.domain.de" </code></pre> <p><strong>Update(2)</strong> If I dont set the WebHostUrl the BasePath in the initial response from ServiceStacks resources service contains the portnumber from the webserver <code>basePath=http://my.domain.de:8060/api</code>. But on the Firewall this port is not reachable, nor do we want it to be reachable.</p> <p><code>web.config</code>:</p> <pre><code>&lt;location path="api"&gt; &lt;system.web&gt; &lt;httpHandlers&gt; &lt;add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" /&gt; &lt;/httpHandlers&gt; &lt;/system.web&gt; &lt;system.webServer&gt; &lt;modules runAllManagedModulesForAllRequests="true" /&gt; &lt;validation validateIntegratedModeConfiguration="false" /&gt; &lt;handlers&gt; &lt;add path="*" name="ServiceStack.Factory" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true" /&gt; &lt;/handlers&gt; &lt;/system.webServer&gt; &lt;/location&gt; </code></pre> <p><strong>Update</strong></p> <p>in the Inital response the basepath is:</p> <pre><code>basePath=http://my.domain.de </code></pre> <p>and by my.domain.de I mean a real world url which is just the hostname without port, url-path, querystring or fragment (I acctually checked wikipedia for the correct names ;)</p> <p>I have found this other question on StackOverflow, but it did not help me. <a href="https://stackoverflow.com/questions/18150351/swagger-with-service-stack-not-working">Swagger with Service Stack not working</a></p> <p>How can I get ServiceStack/Resources Service to either add <code>/api</code> for its returned ServiceList?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload