Using Wadl generated code, when creating a issue with post command it creates 5 entries

Hi,

With 4.1.1 and 4.1.2 i see this behaviour. Can someone confirm this and open a yt issue

thanks in advance

Jorge Costa
5 comments
Comment actions Permalink
Hi sorry for the spam but seems there are so many test messages in the forum that this was night have been lost. Can someone help me with this
Thanks
Jorge Costa
0
Comment actions Permalink
Hello Jorge,
Sorry for not responding earlier. I've just checked this and everything works fine. Could you please provide a bit more details?

Regards,
  Alexander
0
Comment actions Permalink
Hi Alexander,

No problem with delay, was just worried about the big ammount to spam mails in the forum.

So here are the steps:
1. Get application.wadl from rest/application.wadl
2. generate source using the following commands:
E:\wadl-dist-1.1.4-SNAPSHOT\bin>wadl2java.bat -o out -p org.sonar.plugins.issuetracker.soap application.wadl

This generated the java file that ive imported into my project (attach file 1, BGit_Rest.java):
3. Need to modify the generated file to make it compile, some import functions(attached file 3, YouTrack_Rest.java)
4. create a small client apit (YouTrackRestSession.java):

From a test run:
        YouTrackRestSession myYTSession = new YouTrackRestSession(new URL("http://localhost:83/rest/"));
        myYTSession.logIn("", "Buildmaster", "Buildmaster");
        myYTSession.CreateIssue(-1, "TT", "To be imported Manually", "Bug", "Manual Import", "Show-Stopper", "Bug", "", "Open", "", "", "", "");

This code creates the 5 entries. Can be sure what is the problem, but im guessing the generation of the Wadl file.

By the way this is related with youtrack issue to create a sonar plugin for youtrack. Pretty sure it will be handy in the future.

Thanks in advance
JC
BGit_Rest.java (2MB)
YouTrack_Rest.java (2MB)
YouTrackRestSession.java (19KB)
YouTrackIssue.java (2.2KB)
0
Comment actions Permalink
Jorge,
I think you are correct assuming that the situation is caused by the generated code behaviour — I just tried this with a simple client that allows sending POST and PUT requests.

Regards,
  Alexander
0
Comment actions Permalink
Can you give some suggestion how to reuse the wadl code from YouTrack?

Thanks in advance
Br,
Jorge Costa
0

Please sign in to leave a comment.