Hi Holger, 

Thank you for your help, I can now use GET requests with parameters, but I 
still get the same error when I try to use POST requests

Any idea why that might be ?

Thanks in advance,
Nicolas

Le vendredi 26 novembre 2021 à 00:01:03 UTC+1, Holger Knublauch a écrit :

> Hi Nicolas,
>
> please try the argument names without the prefix, e.g.
>
>
> http://localhost:8083/tbl/swp?_viewClass=directorysynchro:_test_ImportDirectory_zipFile&entityDirectoryGraph=urn:x-evn-master:graph_in_edg&entityDirectoryZipFilePath=/project/filepath
>
> The interpretation of spl:Arguments in SWP (and SPIN) is that only the 
> local name part of the predicate will be used. So for ex:predicate you 
> would use the parameter predicate without the ex:
> HTH
> Holger
>
> On 2021-11-26 3:01 am, Nicolas Fouqué wrote:
>
> Hello,  
> I have a SWP webservice taht is defined the most basically possible, it's 
> a ui:JSONService and it is supposed to use a few parameters defined with 
> spin:constraint : 
> Argument directorysynchro:entityDirectoryGraph : rdfs:Resource
> Argument directorysynchro:entityDirectoryZipFilePath : xsd:string
>
> However, when I use Postman to send the following POST request : 
>
> http://localhost:8083/tbl/swp?_viewClass=directorysynchro:_test_ImportDirectory_zipFile&directorysynchro:entityDirectoryGraph=urn:x-evn-master:graph_in_edg&directorysynchro:entityDirectoryZipFilePath=/project/filepath
> I instantly get this error
>
> org.topbraid.core.servlet.HttpErrorException: Exception in SWP Servlet
> at org.topbraidlive.swp.servlet.SWPServlet.run(SWPServlet.java:220)
> at org.topbraidlive.swp.servlet.SWPServlet.run(SWPServlet.java:132)
> at org.topbraidlive.swp.servlet.SWPServlet.run(SWPServlet.java:114)
> at org.topbraidlive.swp.servlet.SWPServlet.doPost(SWPServlet.java:77)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
> ... Rest omitted
> Caused by: java.lang.NullPointerException
> at 
> org.topbraid.spin.swp.servlet.SWPServletUtil.addParametersToScope(SWPServletUtil.java:585)
> at 
> org.topbraid.spin.swp.servlet.SWPServletUtil.addParametersToScope(SWPServletUtil.java:543)
> at 
> org.topbraid.spin.swp.servlet.SWPServletUtil.getView(SWPServletUtil.java:413)
> at 
> org.topbraid.spin.swp.servlet.SWPServletUtil.runUncached(SWPServletUtil.java:740)
> at 
> org.topbraid.spin.swp.servlet.SWPServletUtil.run(SWPServletUtil.java:729)
> at org.topbraidlive.swp.servlet.SWPServlet.run(SWPServlet.java:180)
> ... 45 more
>
> What's strange is that when I try to send the same request as a GET, the 
> service does start (I get logs and ui:dumpScope), however the parameters 
> are not properly bound (I check them with ui:dumpscope but they are all 
> empty)
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "TopBraid Suite Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/topbraid-users/8ed2df51-2b1c-4a1e-b4ee-019be28002f9n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/topbraid-users/8ed2df51-2b1c-4a1e-b4ee-019be28002f9n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/1e5d129f-d732-4825-8928-29afdafb5a78n%40googlegroups.com.

Reply via email to