web service cannot cast object saxsource class domsource

1
0
-1

I have a webservice to generate an id .
The script which i use to generate the token is as below

import javax.xml.transform.*
import javax.xml.transform.dom.*
import javax.xml.transform.stream.*
import org.w3c.dom.*
import groovy.xml.DOMBuilder

Element root = ((DOMSource) sourceResponse).getNode().getFirstChild();
NodeList result = root.getElementsByTagName("token");
String xmlContent = result.item(0).getTextContent();
String out = xmlContent

But i get the following error when i run the process.

Caused by: org.bonitasoft.engine.expression.exception.SExpressionEvaluationException: Groovy script throws an exception of type class org.codehaus.groovy.runtime.typehandling.GroovyCastException with message = Cannot cast object 'javax.xml.transform.sax.SAXSource@1071c6b' with class 'javax.xml.transform.sax.SAXSource' to class 'javax.xml.transform.dom.DOMSource'.

Can anyone help?
Im using Bonita 7.1

Regards,
A.

Comments

Submitted by Lionel Palacin on Tue, 08/16/2016 - 18:28

Hi,

Are you using the web service connector? Is that happening when you're trying to parse the response?

Thanks

Submitted by anandages841 on Thu, 08/18/2016 - 09:38

Hi,

Yes i am using a webservice connector . Yes happens when im trying to parse the repsonse.
The same script worked in version 5.10

Thanks.

No answers yet.
Notifications