Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Creating a SNAPSHOT for RQM using REST API

 Dear Team,

 I have tried creating snapshot using REST API and SNAPSHOT as HTTP method in Postman/Rest client and its working fine and creating snapshots as expected. But how do I implement Non-standard/Custom HTTP method SNAPSHOT in java. How do I do create custom HTTP method SNAPSHOT and incorporate with http client. Is there any jar file that could do this for me ? I have Apache webdav for propfind method which is used to get the snapshots. Similarly,how do i implement for HTTP method SNAPSHOT. 

In this document :  https://jazz.net/wiki/bin/view/Main/RqmApi#Create_a_Snapshot , it says about Non-standard HTTP method requiring a HTTP client that support the HTTP  SNAPSHOT  method.
How do I implement this ? 

Please help ! 

0 votes

Comments

 Request Body : 

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
        <ns3:title>TC3 Snapshot 1</ns3:title> 
        <ns3:description/> 
    </ns2:snapshot>


Accepted answer

Permanent link

This is more of a Java question rather than a RQM question.  


You can override the HTTP method type for your HTTP client library and implement your own SNAPSHOT HTTP method type.  For example (Apache Commons - org.apache.commons.httpclient.methods.EntityEnclosingMethod):

protected class SnapshotMethod extends EntityEnclosingMethod {

public SnapshotMethod(String uri) throws IllegalArgumentException, IllegalStateException {
super(uri);
}

@Override
public String getName() {
return "SNAPSHOT";
}
}
<style type="text/css"> p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; min-height: 15.0px} p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #646464} p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #2a00ff} span.s1 {color: #7f0055} span.s2 {text-decoration: underline} span.s3 {color: #6a3e3e} span.s4 {color: #000000} span.Apple-tab-span {white-space:pre} </style>

Ajith O M selected this answer as the correct answer

0 votes

Comments
Thanks a lot.

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 480
× 74

Question asked: Feb 04 '19, 12:13 a.m.

Question was seen: 1,959 times

Last updated: Feb 04 '19, 7:40 a.m.

Confirmation Cancel Confirm