[
https://wso2.org/jira/browse/ESBJAVA-522?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17383#action_17383
]
Ruwan Linton commented on ESBJAVA-522:
--------------------------------------
Eric, If this is the case you may add a custom mediator to build the SOAP
Envelope before sending the message. Earlier we have built the message but we
removed that as a performance improvement.
So from my point of view this is not blocking the 1.7 release. I think we can
provide a switch to the Send mediator to configure this behavior in the 1.7.1
release (which will be out very soon) so that if you are OK with building the
message before sending you can turn on building the message before send, which
will drop the performance a little (well, if the message is too large the perf
drop is considerable :-( ).
So for the moment you will have to have a custom mediator with the following
code in the mediate method;
synCtx.getEnvelope().build();
WDYT? Is this blocking the 1.7 release?
> Accessing SOAP fault code and fault message via Axis2/Axiom-API does not work
> -----------------------------------------------------------------------------
>
> Key: ESBJAVA-522
> URL: https://wso2.org/jira/browse/ESBJAVA-522
> Project: WSO2 ESB
> Issue Type: Bug
> Affects Versions: 1.7
> Reporter: Eric Hubert
> Assignee: Asankha Perera
> Priority: Blocker
>
> We are using the following code to access SOAP faultcode and faultstring:
> if (axis2MessageCtx.getEnvelope().getBody().getFault() != null) {
> SOAPFault fault = axis2MessageCtx.getEnvelope().getBody().getFault();
> OMElement faultcode = (OMElement) fault.getChildrenWithName(new
> QName("faultcode")).next();
> messagePropertyDTO.setFaultCode(faultcode.getText());
> OMElement faultmessage = (OMElement) fault.getChildrenWithName(new
> QName("faultstring")).next();
> messagePropertyDTO.setFault(faultmessage.getText());
> }
> it works with WSO2 ESB 1.7 Beta-2. In the proposed final version we get the
> following exception:
> 2008-06-09 10:20:24,261 [127.0.0.1-berjbolle-lx1] [HttpServerWorker-1] INFO
> TimeoutHandler This engine will expire all callbacks after : 86400 seconds,
> irrespective of the timeout action, after the specified or optional timeout
> Exception in thread "HttpClientWorker-1" org.apache.axiom.om.OMException:
> java.util.NoSuchElementException
> at
> org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:249)
> at
> org.apache.axiom.om.impl.llom.OMElementImpl.buildNext(OMElementImpl.java:633)
> at
> org.apache.axiom.om.impl.llom.OMElementImpl.getFirstOMChild(OMElementImpl.java:650)
> at
> org.apache.axiom.om.impl.llom.OMElementImpl.getChildrenWithName(OMElementImpl.java:217)
> at
> de.jamba.soa.esb.wso2.mediator.jtrace.JTraceMediator.setResponseProperties(JTraceMediator.java:130)
> at
> de.jamba.soa.esb.wso2.mediator.jtrace.JTraceMediator.mediate(JTraceMediator.java:65)
> at
> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:58)
> at
> org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:125)
> at
> org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:174)
> at
> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:58)
> at
> org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:125)
> at
> org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:162)
> at
> org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:301)
> at
> org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:131)
> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176)
> at
> org.apache.synapse.transport.nhttp.ClientWorker.run(ClientWorker.java:200)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
> at java.lang.Thread.run(Thread.java:619)
> Caused by: java.util.NoSuchElementException
> at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1083)
> at
> org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:506)
> at
> org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:161)
> ... 18 more
> One other problem we noticed on the way is a strange behaviour of
> getChildrenWithLocalName(). If we changed the above code in 1.7 Beta 2 to
> this:
> if (axis2MessageCtx.getEnvelope().getBody().getFault() != null) {
> SOAPFault fault = axis2MessageCtx.getEnvelope().getBody().getFault();
> OMElement faultcode = (OMElement)
> fault.getChildrenWithName("faultcode").next();
> messagePropertyDTO.setFaultCode(faultcode.getText());
> OMElement faultmessage = (OMElement)
> fault.getChildrenWithName("faultstring").next();
> messagePropertyDTO.setFault(faultmessage.getText());
> }
> getChildrenWithName() always returned the first Element. No matter of the
> specified string. It could also be "abc" which was not present. I would also
> consider this to be a bug.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://wso2.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
Esb-java-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev