Gemini 3.5.3: Where is WSDL?
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 |
|
Monday, August 17, 2009, 1:15:08 PM |
0
|
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. |
||||
|
0
|
Hi, I just added this method to IssuesWebServiceHelper: |
||||
|
0
|
I went through the same thing a few weeks ago. See thread: http://support.countersoft.com/forums/thread/11455.aspx |
||||
|
0
|
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
|
||||
|
0
|
Thanks bobw, |
||||
|
0
|
Nobody can help me? I'm thinking about downgrade to older version. |
||||
|
0
|
Is it possible for you to send all you JAVA files to support at countersoft dot com? |
||||
|
0
|
No problem, check your mailbox. |
||||
|
0
|
I found something. It works but only when comment doesn't contain any czech characters. |
||||
|
0
|
Can you please send an example of it to support at countersoft dot com? |
||||
|
0
|
It is on the way... |
||||
|
0
|
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.
Should read:
|
||||
|
0
|
[quote user="MarkWing"]lWriter.writeUTF("<?xml version=\"1.0\" encoding=\"utf-8\"?>" + obj.toXML()); |
||||
|
0
|
Good news, we will update our sample soon. Thank you for sharing this. |
||||
|