Gemini Community Support Site

This Gemini community support site can be used to find solutions to product issues. You can log in using Open Id, Google Profile and even Facebook. Feel free to ask a question or browse FAQs and documentation. Product tour videos are also available along with how-to videos demonstrating key Gemini capabilities.




Gemini 3.5.3: Where is WSDL?

web-app

In previous versions we used our custom java client to connect to Gemini web services. We used this URL

http://<our_server>/webservices/Gemini.asmx?WSDL

to get WSDL. Now, after upgrade to 3.5.3, this application doesn't work. So I tried to re-import WSDL and noticed that this URL doesn't exists?

I also noticed that there is a JAVA API for Gemini, but there is no possibility to add a comment to issue via this API. Am I right?

stepand76
· 504
stepand76
Replies (14)
helpful
0
not helpful

With Gemini 3.5 we have moved to REST web services. You can see how to use them here: http://api.countersoft.com/

Our sample JAVA api is as it says only a sample. But it does give an idea of how to use the REST web services.

You can do all the actions (create comment) using the new web services as well.


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

Hi, I just added this method to IssuesWebServiceHelper:

public IssueCommentEN createComment(int issueId, IssueCommentEN issueComment) throws Exception {
        return new IssueCommentEN(new JSONObject(getResponse("/api/issues.ashx/issues/" + Integer.toString(issueId) + "/comments", issueComment, "POST")));
}

I'm using it in this way:

IssuesWebServiceHelper geminiIssuesWebServiceHelper = new IssuesWebServiceHelper(geminiWsUrl, geminiUserName, geminiPassword);
IssueEN issue = geminiIssuesWebServiceHelper.getIssue(issueId);
if (issue != null) {
  IssueCommentEN issueComment = new IssueCommentEN();
  issueComment.setVisibility(1);
  issueComment.setVisibilityMemberType(2);
  issueComment.setProjectID(issue.getProjectID());
  issueComment.setIssueID(issue.getIssueID());
  issueComment.setUserName(geminiUserName);
  issueComment.setComment(comment);
  geminiIssuesWebServiceHelper.createComment(issue.getIssueID(), issueComment);
}                                       

But it throws this exception:

java.io.IOException: Server returned HTTP response code: 500 for URL: http://airforceone/gemini/api/issues.ashx/issues/4272/comments
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1305)

What's wrong?
Which IssueCommentEN fields are required to create comment? How to set VisibilityMemberType?

Missing more documentation...


stepand76
· 504
stepand76
helpful
0
not helpful

I went through the same thing a few weeks ago. See thread: http://support.countersoft.com/forums/thread/11455.aspx


bobw
· 1
bobw
helpful
0
not helpful

Here's the PHP code I came up with. You won't be able to use this directly without having all the support functions, but it should be enough to get you going. For non-PHP, the XML is really what you're after.

/**  * Adds a comment to an issue in Gemini  *  * @param int a Gemini issues's ID  * @param string the text of the comment as an ISO8859-1 string  *  * @return SimpleXMLElement object corresponding to Gemini's IssueCommentEN type containing the new comment  *  * @throws GLCGemini_exception  */ public function AddComment($id, $text) {     assert('isset($id)');     assert('is_int($id)');     assert('isset($text)');     assert('is_string($text)');     //for "security reasons", Gemini insists that we pass in a project ID (though it'll work sometimes), so we need to get it     $issue = $this->GetIssue($id);     $projectId = $issue->ProjectID;     $curlOptions = array(         CURLOPT_RETURNTRANSFER => true,         CURLOPT_CUSTOMREQUEST => 'POST',         CURLOPT_HTTPHEADER => array('Content-Type: text/xml; charset=iso-8859-1'),         CURLOPT_POSTFIELDS => ("<IssueCommentEN><Comment>" . GLEncodeXML($text) . "</Comment><IssueID>$id</IssueID><ProjectID>$projectId</ProjectID></IssueCommentEN>"),     ); //curlOptions     $curl = curl_init($this->BuildRequestUrl("issues.ashx/issues/$id/comments"));     curl_setopt_array($curl, $curlOptions);     $data = @curl_exec($curl);     if (false === $data):         throw new GLCGemini_exception('curl error: ' . curl_error($curl));     else:         return new SimpleXMLElement($data);     endif; } //AddComment

bobw
· 1
bobw
helpful
0
not helpful

Thanks bobw,

but I think there isn't problem with passing Project Id. I'm passing it as you can see in my code...


stepand76
· 504
stepand76
helpful
0
not helpful

Nobody can help me? I'm thinking about downgrade to older version.


stepand76
· 504
stepand76
helpful
0
not helpful

Is it possible for you to send all you JAVA files to support at countersoft dot com?


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

No problem, check your mailbox.


stepand76
· 504
stepand76
helpful
0
not helpful

I found something. It works but only when comment doesn't contain any czech characters.


stepand76
· 504
stepand76
helpful
0
not helpful

Can you please send an example of it to support at countersoft dot com?


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

It is on the way...


stepand76
· 504
stepand76
helpful
0
not helpful

We have found the issue. It is to do with the XML we are sending in. You will need to modify some code in the WebServiceHelper.java file.
The line:
lWriter.write(obj.toXML());

Should read:
lWriter.writeUTF("<?xml version=\"1.0\" encoding=\"utf-8\"?>" + obj.toXML());   

However, you will need to drop the first 2 bytes (the unicode bytes).


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

[quote user="MarkWing"]lWriter.writeUTF("<?xml version=\"1.0\" encoding=\"utf-8\"?>" + obj.toXML());   
However, you will need to drop the first 2 bytes (the unicode bytes).[/quote]

Thank you. Now it works!
Just a note: To avoid unicode BOM I tuned your patch to:

String objAsXML = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + obj.toXML();
lWriter.write(objAsXML.getBytes("UTF-8"));


stepand76
· 504
stepand76
helpful
0
not helpful

Good news, we will update our sample soon. Thank you for sharing this.


Mark Wing
· 9108
Mark Wing