Maksym RMA [
https://community.jboss.org/people/maksrma] created the discussion
"SOAPClient and multipart soap response"
To view the discussion, visit:
https://community.jboss.org/message/751419#751419
--------------------------------------------------------------
I have SoapClient service for extenal SOAP WS.
All works great.
When I set property:
<property name="responseAsOgnlMap" value="true" />
I had error processing response, because Content-Type is Content-Type: multipart/related;
type="application/xop+xml"
My environment:
JBoss 6.1 and esb 4.10
*Sevice config looks like:*
<action name="proxy"
class="com.cs.esb.core.ejb.util.CustomSoapClient">
<property name="wsdl" value="
http://localhost:8080/myservice?wsdl http://localhost:8080/myservice?wsdl" >
<http-client-property
name="configurators" value="AuthBASIC"/>
<http-client-property
name="auth-username" value="xxx"/>
<http-client-property
name="auth-password" value="xxx"/>
</property>
<property name="SOAPAction"
value="xxx" />
<property name="responseAsOgnlMap"
value="true" />
</action>
*Raw SOAP Response:*
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.1
Content-Type: multipart/related; type="application/xop+xml"; start="<
mailto:soap.xml@xfire.codehaus.org soap.xml(a)xfire.codehaus.org>";
start-info="text/xml";
boundary="----=_Part_600_1630724789.1343809898519"
Transfer-Encoding: chunked
Date: Wed, 01 Aug 2012 08:31:38 GMT
7aa
------=_Part_600_1630724789.1343809898519
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: 8bit
Content-ID: < mailto:soap.xml@xfire.codehaus.org soap.xml(a)xfire.codehaus.org>
<soap:Envelope xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/
http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="
http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance
http://www.w3.org/2001/XMLSchema-instance"><soap:Body>
.... correct response data....
</soap:Body></soap:Envelope>
2f
------=_Part_600_1630724789.1343809898519--
0
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.1
Content-Type: multipart/related; type="application/xop+xml"; start="<
mailto:soap.xml@xfire.codehaus.org soap.xml(a)xfire.codehaus.org>";
start-info="text/xml";
boundary="----=_Part_601_425283758.1343809902329"
Transfer-Encoding: chunked
Date: Wed, 01 Aug 2012 08:31:42 GMT
7a9
------=_Part_601_425283758.1343809902329
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: 8bit
Content-ID: < mailto:soap.xml@xfire.codehaus.org soap.xml(a)xfire.codehaus.org>
<soap:Envelope xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/
http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="
http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance
http://www.w3.org/2001/XMLSchema-instance"><soap:Body><n...
xmlns:ns1="
http://upbs.cs.com/ http://upbs.cs.com/">
.... correct response data....
</soap:Body></soap:Envelope>
2e
------=_Part_601_425283758.1343809902329--
0
*Exception trace is:*
2012-08-01 12:56:34,443 DEBUG
[org.jboss.soa.esb.listeners.message.ActionProcessingPipeline] (pool-37-thread-1)
Unexpected exception caught while processing the action pipeline:
org.jboss.soa.esb.actions.ActionProcessingException: soapUI Client Service invocation
failed.
at org.jboss.soa.esb.actions.soap.SOAPClient.process(SOAPClient.java:443)
at com.cs.esb.core.ejb.util.CustomSoapClient.process(CustomSoapClient.java:56)
at
org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:649)
at
org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:603)
at
org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:433)
at
org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:550)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.io.IOException: Failed to deserialize the SOAP message template
at
org.jboss.soa.esb.services.soapui.SoapUIClientService.getDocument(SoapUIClientService.java:704)
at
org.jboss.soa.esb.services.soapui.SoapUIClientService.mergeSOAPMessage(SoapUIClientService.java:603)
at
org.jboss.soa.esb.services.soapui.SoapUIClientService.mergeResponseTemplate(SoapUIClientService.java:491)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:271)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670)
at
org.jboss.soa.esb.actions.soap.MBeanSoapUIInvoker.mergeResponseTemplate(MBeanSoapUIInvoker.java:207)
at
com.cs.esb.core.ejb.util.CustomSoapClient$CustomSoapUIInvoker.mergeResponseTemplate(CustomSoapClient.java:107)
at org.jboss.soa.esb.actions.soap.SOAPClient.process(SOAPClient.java:440)
... 8 more
Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '-'
(code 45) in prolog; expected '<'
at [row,col {unknown-source}]: [2,1]
at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:648)
at
com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2047)
at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
at com.ctc.wstx.evt.WstxEventReader.nextEvent(WstxEventReader.java:196)
at com.ctc.wstx.evt.WstxEventWriter.add(WstxEventWriter.java:230)
at
org.jboss.internal.soa.esb.util.XMLHelper.copyXMLEventStream(XMLHelper.java:344)
at
org.jboss.internal.soa.esb.util.XMLHelper.copyXMLEventStream(XMLHelper.java:316)
at org.jboss.internal.soa.esb.util.XMLHelper.createDocument(XMLHelper.java:646)
at
org.jboss.soa.esb.services.soapui.SoapUIClientService.getDocument(SoapUIClientService.java:702)
... 22 more
I found as sulution to override SOAPClient class and SoapUIInvoker inside. In method
SoapUIInvoker.mergeResponseTemplate I parse response handly... it's terrible but I
haven't any outher ideas.
Please help....
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/751419#751419]
Start a new discussion in JBoss ESB Development at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]