I am trying to write a script that will talk to the Autotask API and I'm using the Script Console to test on.
When I run I am hitting this error:
javax.xml.stream.FactoryConfigurationError: Provider for class javax.xml.stream.XMLInputFactory cannot be created
and I've tried adding that as an import but it still fails.
Based on some posts online I believe the issue is something to do with the Autotask API messages needing to be in XML but not sure how to get around this.
I'm just doing a very simple call right now to verify the connection will work.
Here is the test code I've written, this is taken from some sample code I was given and also from their documentation:
def ATWS newser = new ATWS()
ATWSSoap port = newser.getPort(ATWSSoap.class)
BindingProvider prov = (BindingProvider) port
def ATWSZoneInfo azi = new ATWSZoneInfo()
azi = port.getZoneInfo("username")
My hunch is that you would need to make sure that a library with the AutoTask API was available on the classpath. I've been unable to find such a library in any maven repositories. Is there a particular plugin you're using to integrate AutoTask with Jira?
I've done that. As you can see by my imports I am referring to a Java version of their API. the error I'm getting appears to be from a conflict with an XML library.
The Scriptrunner console seems to find their libs fine as I get no errors loading it in the editor whereas I did when it could not find them.
At run time though I get that XML error.
Your right in that it sounds like it's some conflict with an XML library. Similar to this question here.
In that case they excluded the dependency which was causing the issue. If this is a JAR file that's just been provided to you then it's difficult to seework out which dependency is causing the issue.
I see your getting the JAR file from here: https://github.com/jmuthu/autotask-helloworld
I've unzipped the JAR file and taken a look. It looks like it could be one of the compiled classes that is conflicting. Is there any other API you could use apart from the Java API? The REST API may be easier to use for you. I'd assume this is just a wrapper around that one.
The Java lib was ported over from .Net libs they use. That would be the only other option.
The issue I'm having is that Autotask's API uses SOAP and expects it's messages in XML. So I was trying to use their libs to construct the required formats. Without their libs I'll have to write all that myself.
I'm no Java/Groovy expert so I was looking for the easiest route here.
I do know about the Rest Client and have used it a bit before but with Json.
Take our 5-minute survey to win a $500 Visa gift card! Are you currently using Confluence Cloud? We want to hear from you! Fill out this quick survey about your Confluence Cloud experience so we ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events