curl syntax to send and receive REST Service API response (xml) from jenkins

47 views
Skip to first unread message

panneerrselvam natarajan

unread,
Oct 16, 2018, 11:08:55 PM10/16/18
to Jenkins Users
Hi All,

I need to execute the test suite using jenkins pipeline, The test suites  which has developed using pega (REST service API). Please do let me know syntax to get the xml based response.

Regards
Panneer

Jan Monterrubio

unread,
Oct 17, 2018, 12:28:18 AM10/17/18
to jenkins...@googlegroups.com
Do you know how to get the response with just curl?

If so I think you can have a step in the pipeline that’s a script curl YOUR_OTHER_STUFF’


pipeline {

    agent any

    stages {

        stage('Example') {

            steps {

                curl 'Your call here'

            }

        }

    }

}



--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/8950b629-48b7-4441-a37f-29880fb25410%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

panneerrselvam natarajan

unread,
Oct 17, 2018, 1:48:17 AM10/17/18
to Jenkins Users
Hi ,

Thanks for your response.

I am expecting complete curl statement (syntax ) for request and xml response.

Regards
Panneer

Matt Hicks

unread,
Oct 24, 2018, 10:52:03 AM10/24/18
to Jenkins Users
Hi Panneer,

Could you please explain in more detail how you run the tests outside of Jenkins?

Cheers,
Matt

panneerrselvam natarajan

unread,
Oct 24, 2018, 11:55:54 AM10/24/18
to Jenkins Users
Hi Matt,

We have Pega test suite (Rest API) and it is working fine in pega and postman. Now through jenkins pipeline i need to call the test suite and verify the xml response thru jenkins.


Please do let me know if you need clarification.

Regards
Panneer

Matt Hicks

unread,
Oct 24, 2018, 12:25:41 PM10/24/18
to Jenkins Users

Jan Monterrubio

unread,
Oct 25, 2018, 12:31:35 AM10/25/18
to jenkins...@googlegroups.com
You could also try this: 

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.

prasad venkata ramasatya Nandagiri

unread,
Oct 29, 2018, 2:46:41 AM10/29/18
to Jenkins Users
In the curl command give -o so that you get response back. You can also specify output format by using —output-format attribute.

But I prefer http request plugin to make rest calls from pipeline script. It is very easy to use.

https://jenkins.io/doc/pipeline/steps/http_request/

panneerrselvam natarajan

unread,
Oct 29, 2018, 9:02:30 PM10/29/18
to Jenkins Users
Hi Prasad,

Thanks for your response.

I am getting response using HTTP instead of HTTPS and stored in xml file.. How do i read the xml file? 
The new XmlParser().parseText() displayed some error

Regards
Panneer

Martin d'Anjou

unread,
Oct 30, 2018, 12:48:37 PM10/30/18
to Jenkins Users
I wrote a proposal to create a plugin to wrap the jenkins-rest library inside a jenkins plugin for Google Summer of Code 2019 (GSoC). This would eliminate the need to parse XML responses and deal with errors. It would make the pipeline scripts simpler. I would need someone to co-mentor this project. If you want to know more let me know. There are other projects too.

Martin
Reply all
Reply to author
Forward
0 new messages