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.




Error updating Issue from Custom Event Handler - **RESOLVED**

web-app

Has anyone encountered this issue before? I am trying to update an issue from a custom event handler.

I first encountered this error ...

'100' is an unexpected token. The expected token is '"' or '''. Line 20, position 65. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args) at System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(String expectedToken1, String expectedToken2) at System.Xml.XmlTextReaderImpl.ParseAttributes() at System.Xml.XmlTextReaderImpl.ParseElement() at System.Xml.XmlTextReaderImpl.ParseElementContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace) at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) at System.Xml.XmlDocument.Load(XmlReader reader) at System.Xml.XmlDocument.Load(Stream inStream) at CounterSoft.Gemini.Commons.Rest.Serializer.ConvertToObject[T](Stream stream) at CounterSoft.Gemini.WebServices.BaseService.GetObjectFromResponse[T](Stream stream) at CounterSoft.Gemini.WebServices.BaseService.ThrowResponseException(WebResponse response) at CounterSoft.Gemini.WebServices.BaseService.ProcessResponse[T](String url, Object obj, RequestType requestType) at CounterSoft.Gemini.WebServices.IssuesService.UpdateIssue(IssueEN issue) at Company.Gemini.Plugins.TDIssueEventListener.UpdateField(IssueEventArgs args) at Company.Gemini.Plugins.TDIssueEventListener.IssueUpdated(IssueEventArgs args) at CounterSoft.Gemini.Business.Events.GeminiEventDispatcher.PluginDelegateInvoker.<>cDisplayClass1.b0(Object func)

which I solved by granting write access to the "GeminiWebRoot\api" folder to my app pool identity.

But now I am running into the following error message:

Method requires authentication at CounterSoft.Gemini.WebServices.BaseService.ThrowResponseException(WebResponse response) at CounterSoft.Gemini.WebServices.BaseService.ProcessResponse[T](String url, Object obj, RequestType requestType) at CounterSoft.Gemini.WebServices.IssuesService.UpdateIssue(IssueEN issue) at Company.Gemini.Plugins.TDIssueEventListener.UpdateField(IssueEventArgs args) at Company.Gemini.Plugins.TDIssueEventListener.IssueUpdated(IssueEventArgs args) at CounterSoft.Gemini.Business.Events.GeminiEventDispatcher.PluginDelegateInvoker.<>cDisplayClass1.b0(Object func)

I have tried to authenticate using Windows authentication (anonymous access is turned off in IIS):

private ServiceManager serviceManager; serviceManager = new ServiceManager(url, userName, pwd, string.Empty, true);

I have also tried to authenticate using the apiKey method but that also generated the same error message.

Executing the same authentication/update code in the test harness (WinForms) is working as expected.

Thanks.

yu217171
· 1
yu217171
Replies (6)
helpful
0
not helpful

The plugin is running under different context (depends on the application pool). When using windows authentication the username is the one that is running the DLL, which is the app pool in your case.



Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

Hi Mark,

Thanks for replying. When I use the following code, am I not impersonating a user and using the webservice to update my issue?

ServiceManager serviceManager = new ServiceManager(url, userName, string.Empty, apiKey, false);

public override void IssueUpdated(IssueEventArgs args) { args.Issue.IssueLongDesc = "Updated from Event Listener"; serviceManager.IssuesService.UpdateIssue(args.Issue); }


yu217171
· 1
yu217171
helpful
0
not helpful

Unfortunately, no. You can either give the application pool user permissions in Gemini or create a forms authentication site pointing to the same Gemini database.


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

Ok so it appears that I will have to create a domain service account and then add that user account into Gemini. Is this is recommended approach?

Also, since impersonation is not working anyways, is there a way to update an issue directly without calling the webservice API? This seems to be more efficient no?


yu217171
· 1
yu217171
helpful
0
not helpful

Yes, that is the recommended approach. We are working new api that will be called before the issue is updated, so all you have to do is set the values and the update will be done.


Saar Cohen
· 5000
Saar Cohen
helpful
0
not helpful

Thanks Saar. I was able to successfully update the issue using this method.


yu217171
· 1
yu217171