Jiwa 7.184 API Compile Error  Topic is solved

Discussions relating to the REST API of Jiwa 7.

Jiwa 7.184 API Compile Error

Postby SBarnes » Mon Aug 07, 2017 3:55 pm

Hi Mike,

The following section of the API generated code is producing an error, it's the HttpResult that the compiler doesn't like, for the time being I have simply commented it out.


Code: Select all
    [Route("/Reports/{ReportID}/PDF/Download", "POST")]
    [ApiResponse(Description = "Not authenticated", StatusCode = 401)]
    [ApiResponse(Description = "No report with the ReportID. provided was found", StatusCode = 404)]
    [ApiResponse(Description = "Not authorised", StatusCode = 403)]
    [ApiResponse(Description = "OK", StatusCode = 200)]
    public partial class ReportsPDFPOSTRequest
        : IReturn<HttpResult>
    {
        public ReportsPDFPOSTRequest()
        {
            ReportParameters = new List<ReportParameter> { };
        }

        public virtual string ReportID { get; set; }
        public virtual List<ReportParameter> ReportParameters { get; set; }
    }
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1620
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Jiwa 7.184 API Compile Error  Topic is solved

Postby Mike.Sheen » Mon Aug 07, 2017 4:19 pm

Thanks - it needs a reference to the ServiceStack.Server because that's where HttpResult is defined - which is silly because clients should not need a reference to anything other than the ServiceStack.Client.

I thought I was doing something wrong, but apparently returning HttpResult is the recommended way to return files with ServiceStack... I'll look a bit more closely at it and ask the question on the ServiceStack forums.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: Jiwa 7.184 API Compile Error

Postby SBarnes » Mon Aug 07, 2017 5:07 pm

Hi Mike,

Yes that fixes it, I have used a Get call returning an object with the request DTO having no IReturn and then using System.Net.HttpWebResponse and GetResponseStream to pull through a pdf and it works in the client in another project.

But I do agree with your comment on what's in what package, you need ServiceStack.Server for the app settings as well in a client.

Thanks.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1620
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Jiwa 7.184 API Compile Error

Postby Mike.Sheen » Fri Aug 11, 2017 3:26 pm

Fixed in 7.00.185.00 - DEV-6180 - turns out just needed to define the return result as IHttpResult, instead of HttpResult. IHttpResult is defined in ServiceStack.Interfaces assembly - so no need for clients to reference the ServiceStack nuget package anymore.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757


Return to REST API

Who is online

Users browsing this forum: No registered users and 3 guests