What is the best way to request a POST web service in Grails?

I want to make a POST request for a web service in grails, but it seems that the available JAVA solutions are at a very low level of abstraction, for example to create a POST request (here is a sample I found: http://www.exampledepot.com/ egs / java.net / Post.html )

Is there a better solution to this problem in Grails? I searched for guides and other materials, but actually found nothing. Just interesting, because, as a rule, I did not see a lot of code like this wen development of Grails.

So, if there is no other solution, then it will be OK, abstracted by me and hidden somewhere in our libraries, but, I think, there is a better solution there.

+5
source share
2 answers

There Groovy is a specific HTTPBuilder that provides a nice interface built on the Apache HTTP client . It even has a REST client if it is suitable for the service you are trying to access. There's even a Grails plugin to wrap it all up for you.

If the REST service is enabled, there are a number of Java projects and APIs that can simplify the process.

On the other hand, if the web service you are trying to access is SOAP based, you can use GroovyWS , which is also wrapped in the Grails plugin available here .

. , , , . Grails , , .

+8

-, http://www.soapui.org/. wsdl. . , .

0

All Articles