
/**
 * Javascript generated by BeNOW Service API
 * Andrew Taylor <andy@benow.ca>
 * http://benow.ca 
 */
    
// @PreReq(org.benow.util.Request.js)    
    
function onError(url,http_request) {
  throw 'error: '+http_request.responseText
}
var errHandlerName='onError';
    
/**
 * calls org.benow.project.ProjectService.createIssue.
 * @params handlerMethod name of method to call on results, 
 *                       in format handlerName(url,http_request);
 *                       if not provided onCreateIssue(url,http_request) will be called.
 */
function createIssue(title,body,handlerMethod) {
  if (!handlerMethod&&handlerMethod!=NO_RESPONSE)
	  handlerMethod='onCreateIssue';
  if (handlerMethod==NO_RESPONSE||eval(handlerMethod)) {
    // if given complex js object, remember to return complex js object (if possible)    
    var hadComplex=false;
    
    
    var params='title='+escape(title)+'&body='+escape(body)+'';
    handlerMethod=(handlerMethod==NO_RESPONSE?NO_RESPONSE:handlerMethod+'(url,http_request,result)');
    
    serviceRequest(
      'org.benow.project.ProjectService',
      'createIssue(java.lang.String,java.lang.String)',
      params,
      handlerMethod,
      errHandlerName+'(url,http_request)',
      hadComplex
    );
  } else
    alert('method does not exist: '+handlerMethod);
    
}
	