Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Getting JIRA listener to consume SOAP web service

Thomas Ehardt February 4, 2014

I am working on integrating JIRA (5.2.2) with other systems, and am planning on having the listener post a message to an external web service.

This external web service is capable of receiving SOAP messages; I've tried creating a JAX-WS client but ran into the problem mentioned here. I then created an Axis2 client library to consume the service, and I am still running into a problem.

When the listener tries to build the message, a ClassNotFoundException is thrown on org.w3c.dom.Node, and obviously the message never gets sent. If I run the same code outside of being in a JIRA plugin, it works just fine, so I'm pretty sure that the problem lies in how XML-API is exposed to the plugin.

When I look in the OSGi console, org.w3c.dom is a private import with the plugin, and I would expect it to be a public import. My OSGi knowledge is lacking, so I may just have a simple misunderstanding there.

If it makes a difference, I am trying to send a message to a WSO2 ESB (v4.6.0) service.

So, does anyone have a JIRA plugin communicating with a SOAP web service?

Alternatives I am going to pursue:

  • creating a JSON message and posting to a message queue, having the ESB consume this and translate to Java/XML as needed
  • using a ScriptRunner listener, but I'm not familiar with Groovy and do not know how to consume a web service with it

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Thomas Ehardt February 5, 2014

I found a workaround/solution to this.

First of all, WSO2 ESB supports JSON natively, so instead of worrying about creating a SOAP+XML message, we can POST a JSON message. This can be done in a listener plugin without issue.

Secondly, assuming we want to continue down the path of using a SOAP+XML message, as long as that message can be constructed (through a custom class not using XML-API), Apache Commons' HttpClient library can be easily used to POST the SOAP+XML message and consume the response.

This doesn't solve the spirit of the original problem (i.e., it's not using Axis2 or JAX-WS to consume the service), but it does solve the problem

1 vote
Steve Gerstner [bridgingIT]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 6, 2014

Hi Thomas,

SOAP is deprecated in JIRA from version 6 on -> https://developer.atlassian.com/display/JIRADEV/SOAP+and+XML-RPC+API+Deprecated+in+JIRA+6.0

Regards Steve

Thomas Ehardt February 7, 2014

correct, but I'm going from JIRA to a SOAP service

Steve Gerstner [bridgingIT]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 8, 2014

ok, mea culpa

do you have a dependency on org.w3c.dom in your pom?

If not, add it. This will embed the dependency in your bundle.

Thomas Ehardt February 9, 2014

I did ... however, this has taken a different route, as the latest release of WSO2 ESB can handle JSON natively (it could before but there were limitations that made it unusable).

TAGS
AUG Leaders

Atlassian Community Events