Bonita 7 / Error on web-service response

1
0
-1

Hello.

I'm going further on my test against Bonita 7... and I got another issue...

I'm testing a very simple SAOP web service, that just takes a string and returns its length. The service is served by a SoapUI mock that seems to work as expected.

The request is built in my process connector using a Groovy MarkupBuilder, and is correctly sent to the service that returns the same response I've successfully tested out of Bonita.

Here is the Groovy script.

  1. def xml = new StringWriter()
  2. def mb = new groovy.xml.MarkupBuilder(xml)
  3.  
  4. mb.doubleQuotes = true
  5. mb.mkp.xmlDeclaration(version:'1.0', encoding:'UTF-8')
  6.  
  7. mb.'soap:Envelope'('xmlns:soap':'http://www.w3.org/2003/05/soap-envelope', 'xmlns:moon':'urn:moon-ws-1/schema') {
  8. 'soap:Body' {
  9. 'moon:computeStringLength' {
  10. 'moon:string' {mb.mkp.yield(request.getQuestion())}
  11. }
  12. }
  13. }
  14.  
  15. return xml.toString()

The request :

  1. <?xml version='1.0' encoding='UTF-8'?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:moon="urn:moon-ws-1/schema"><soap:Body>
  2. <moon:computeStringLength>
  3. <moon:string>q</moon:string>
  4. </moon:computeStringLength>
  5. </soap:Body></soap:Envelope>

And the response :

  1. <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:sch="urn:moon-ws-1/schema">
  2. <soap:Body>
  3. <sch:computeStringLengthResponse>
  4. <sch:return>1</sch:return>
  5. </sch:computeStringLengthResponse>
  6. </soap:Body>
  7. </soap:Envelope>

But Bonita fails handling this response with the following exception.

  1. org.bonitasoft.engine.core.connector.exception.SConnectorException: PROCESS_DEFINITION_ID=4978914611161110206 | PROCESS_NAME=Processus-Un | PROCESS_VERSION=2.0 | PROCESS_INSTANCE_ID=3 | ROOT_PROCESS_INSTANCE_ID=3 | FLOW_NODE_DEFINITION_ID=8533947796320219787 | FLOW_NODE_INSTANCE_ID=12 | FLOW_NODE_NAME=Calculer | CONNECTOR_DEFINITION_IMPLEMENTATION_CLASS_NAME=WS | CONNECTOR_INSTANCE_ID=5 | org.bonitasoft.engine.connector.exception.SConnectorException: java.util.concurrent.ExecutionException: org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: Tentative d'insertion d'un noeud à un emplacement non autorisé.
  2. at org.bonitasoft.engine.core.connector.impl.ConnectorServiceImpl.executeConnectorInClassloader(ConnectorServiceImpl.java:327)
  3. at org.bonitasoft.engine.core.connector.impl.ConnectorServiceImpl.executeConnector(ConnectorServiceImpl.java:145)
  4. at org.bonitasoft.engine.connector.ConnectorServiceDecorator.executeConnector(ConnectorServiceDecorator.java:111)
  5. at org.bonitasoft.engine.execution.work.ExecuteConnectorWork.work(ExecuteConnectorWork.java:131)
  6. at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
  7. at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
  8. at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
  9. at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
  10. at org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork.work(FailureHandlingBonitaWork.java:66)
  11. at org.bonitasoft.engine.work.BonitaWork.run(BonitaWork.java:56)
  12. at org.bonitasoft.engine.work.SequenceRunnableExecutor.innerRun(SequenceRunnableExecutor.java:47)
  13. at org.bonitasoft.engine.work.BonitaRunnable.run(BonitaRunnable.java:35)
  14. at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
  15. at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  16. at java.lang.Thread.run(Unknown Source)
  17. Caused by: org.bonitasoft.engine.connector.exception.SConnectorException: java.util.concurrent.ExecutionException: org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: Tentative d'insertion d'un noeud à un emplacement non autorisé.
  18. at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.execute(ConnectorExecutorImpl.java:128)
  19. at org.bonitasoft.engine.core.connector.impl.ConnectorServiceImpl.executeConnectorInClassloader(ConnectorServiceImpl.java:319)
  20. ... 14 more
  21. Caused by: java.util.concurrent.ExecutionException: org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: Tentative d'insertion d'un noeud à un emplacement non autorisé.
  22. at java.util.concurrent.FutureTask.report(Unknown Source)
  23. at java.util.concurrent.FutureTask.get(Unknown Source)
  24. at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.getValue(ConnectorExecutorImpl.java:152)
  25. at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.execute(ConnectorExecutorImpl.java:122)
  26. ... 15 more
  27. Caused by: org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: Tentative d'insertion d'un noeud à un emplacement non autorisé.
  28. at com.sun.org.apache.xerces.internal.dom.ParentNode.internalInsertBefore(Unknown Source)
  29. at com.sun.org.apache.xerces.internal.dom.ParentNode.insertBefore(Unknown Source)
  30. at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.insertBefore(Unknown Source)
  31. at com.sun.org.apache.xerces.internal.dom.NodeImpl.appendChild(Unknown Source)
  32. at org.bonitasoft.connectors.ws.cxf.SecureWSConnector.buildResponseDocumentBody(SecureWSConnector.java:246)
  33. at org.bonitasoft.connectors.ws.cxf.SecureWSConnector.executeBusinessLogic(SecureWSConnector.java:197)
  34. at org.bonitasoft.engine.connector.AbstractConnector.execute(AbstractConnector.java:77)
  35. at org.bonitasoft.engine.core.connector.impl.SConnectorAdapter.execute(SConnectorAdapter.java:69)
  36. at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:208)
  37. at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:179)
  38. at java.util.concurrent.FutureTask.run(Unknown Source)
  39. ... 3 more

I've triedto change some things in my connector, but no effect...

Any idea ?

Thanks again !

Regards.

Comments

Submitted by ephemeris.lappis on Thu, 07/02/2015 - 08:47

Hum... No emotion about my web services troubles ?... :(

Submitted by ephemeris.lappis on Wed, 07/08/2015 - 18:55

Hello.

I've changed the connector to produce the SOAP envelope instead of the body, and adapted my code, and that works. It seems the problems comes from the body construction in the SOAP connector.

Submitted by the_antman on Thu, 11/24/2016 - 12:27

Hi,

I'm doing the same as you, using a SOAP mock service, and I came across the same error. I've switched the connector to process the envelope and not the body but I'd be very interested to see what the groovy script was that you used (as I'm no programmer and I wouldn't know where to start).

Kind regards,

Anthony

No answers yet.
Notifications