From 3f71a69dceef150843750eb388b863d089c758da Mon Sep 17 00:00:00 2001 From: Ramesh Reddy Date: Mon, 13 Feb 2017 12:18:50 -0500 Subject: [PATCH] TEIID-4755: WS SOAP Response with WS-A Headers results in ClassCastException (Using the DOM based return in MESSAGE mode as CXF does not allow StAX based Source) # Conflicts: # build/kits/jboss-as7/overlay/docs/teiid/teiid-releasenotes.html --- .../translator/ws/WSProcedureExecution.java | 65 ++++++++--- .../java/org/teiid/arquillian/AdminUtil.java | 2 + .../IntegrationTestSOAPWebService.java | 110 ++++++++++++++++++ .../src/test/resources/addressing-service.war | Bin 0 -> 8327 bytes .../common/src/test/resources/soapsvc-vdb.xml | 37 ++++++ 5 files changed, 198 insertions(+), 16 deletions(-) create mode 100644 test-integration/common/src/test/java/org/teiid/arquillian/IntegrationTestSOAPWebService.java create mode 100644 test-integration/common/src/test/resources/addressing-service.war create mode 100644 test-integration/common/src/test/resources/soapsvc-vdb.xml diff --git a/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSProcedureExecution.java b/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSProcedureExecution.java index ed37aa45f5..af8a625aa8 100644 --- a/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSProcedureExecution.java +++ b/connectors/translator-ws/src/main/java/org/teiid/translator/ws/WSProcedureExecution.java @@ -22,6 +22,10 @@ package org.teiid.translator.ws; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; import java.io.StringReader; import java.io.StringWriter; import java.sql.SQLException; @@ -30,15 +34,20 @@ import java.util.List; import javax.xml.stream.XMLStreamException; +import javax.xml.transform.Result; +import javax.xml.transform.Source; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stax.StAXSource; import javax.xml.transform.stream.StreamResult; import javax.xml.ws.Dispatch; +import javax.xml.ws.Service.Mode; import javax.xml.ws.WebServiceException; import javax.xml.ws.handler.MessageContext; +import org.teiid.core.types.InputStreamFactory; import org.teiid.core.types.SQLXMLImpl; import org.teiid.core.types.XMLType; import org.teiid.core.types.XMLType.Type; @@ -63,7 +72,7 @@ public class WSProcedureExecution implements ProcedureExecution { RuntimeMetadata metadata; ExecutionContext context; private Call procedure; - private StAXSource returnValue; + private Source returnValue; private WSConnection conn; private WSExecutionFactory executionFactory; @@ -78,29 +87,34 @@ public WSProcedureExecution(Call procedure, RuntimeMetadata metadata, ExecutionC this.executionFactory = executionFactory; } + @SuppressWarnings("unchecked") public void execute() throws TranslatorException { List arguments = this.procedure.getArguments(); String style = (String)arguments.get(0).getArgumentValue().getValue(); String action = (String)arguments.get(1).getArgumentValue().getValue(); XMLType docObject = (XMLType)arguments.get(2).getArgumentValue().getValue(); - StAXSource source = null; + Source source = null; try { - source = convertToSource(docObject); + Class type = StAXSource.class; + if (executionFactory.getDefaultServiceMode() == Mode.MESSAGE) { + type = DOMSource.class; + } + + source = convertToSource(type, docObject); String endpoint = (String)arguments.get(3).getArgumentValue().getValue(); if (style == null) { style = executionFactory.getDefaultBinding().getBindingId(); } else { try { - Binding type = Binding.valueOf(style.toUpperCase()); - style = type.getBindingId(); + style = Binding.valueOf(style.toUpperCase()).getBindingId(); } catch (IllegalArgumentException e) { throw new TranslatorException(WSExecutionFactory.UTIL.getString("invalid_invocation", Arrays.toString(Binding.values()))); //$NON-NLS-1$ } } - Dispatch dispatch = conn.createDispatch(style, endpoint, StAXSource.class, executionFactory.getDefaultServiceMode()); + Dispatch dispatch = conn.createDispatch(style, endpoint, type, executionFactory.getDefaultServiceMode()); if (Binding.HTTP.getBindingId().equals(style)) { if (action == null) { @@ -133,7 +147,7 @@ public void execute() throws TranslatorException { // JBoss Native DispatchImpl throws exception when the source is null source = new StAXSource(XMLType.getXmlInputFactory().createXMLEventReader(new StringReader(""))); //$NON-NLS-1$ } - this.returnValue = dispatch.invoke(source); + this.returnValue = (Source) dispatch.invoke(source); } catch (SQLException e) { throw new TranslatorException(e); } catch (WebServiceException e) { @@ -145,12 +159,12 @@ public void execute() throws TranslatorException { } } - private StAXSource convertToSource(SQLXML xml) throws SQLException { - if (xml == null) { - return null; - } - return xml.getSource(StAXSource.class); - } + private Source convertToSource(Class T, SQLXML xml) throws SQLException { + if (xml == null) { + return null; + } + return xml.getSource(T); + } @Override public List next() throws TranslatorException, DataNotAvailableException { @@ -160,14 +174,33 @@ public List next() throws TranslatorException, DataNotAvailableException { @Override public List getOutputParameterValues() throws TranslatorException { Object result = returnValue; - if (returnValue != null && procedure.getArguments().size() > 4 + if (returnValue != null && (returnValue instanceof StAXSource) && procedure.getArguments().size() > 4 && procedure.getArguments().get(4).getDirection() == Direction.IN && Boolean.TRUE.equals(procedure.getArguments().get(4).getArgumentValue().getValue())) { - SQLXMLImpl sqlXml = new StAXSQLXML(returnValue); + SQLXMLImpl sqlXml = new StAXSQLXML((StAXSource)returnValue); XMLType xml = new XMLType(sqlXml); xml.setType(Type.DOCUMENT); result = xml; - } + } else if (returnValue != null && returnValue instanceof DOMSource){ + final DOMSource xmlSource = (DOMSource) returnValue; + SQLXMLImpl sqlXml = new SQLXMLImpl(new InputStreamFactory() { + @Override + public InputStream getInputStream() throws IOException { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + Result outputTarget = new StreamResult(outputStream); + try { + TransformerFactory.newInstance().newTransformer() + .transform(xmlSource, outputTarget); + } catch (Exception e) { + throw new IOException(e); + } + return new ByteArrayInputStream(outputStream.toByteArray()); + } + }); + XMLType xml = new XMLType(sqlXml); + xml.setType(Type.DOCUMENT); + result = xml; + } return Arrays.asList(result); } diff --git a/test-integration/common/src/test/java/org/teiid/arquillian/AdminUtil.java b/test-integration/common/src/test/java/org/teiid/arquillian/AdminUtil.java index b899b6aea4..422d761597 100644 --- a/test-integration/common/src/test/java/org/teiid/arquillian/AdminUtil.java +++ b/test-integration/common/src/test/java/org/teiid/arquillian/AdminUtil.java @@ -33,6 +33,8 @@ @SuppressWarnings("nls") public class AdminUtil { + + public static final int MANAGEMENT_PORT = 9990; static void cleanUp(Admin admin) throws AdminException { //TODO: cleanup when as supports it diff --git a/test-integration/common/src/test/java/org/teiid/arquillian/IntegrationTestSOAPWebService.java b/test-integration/common/src/test/java/org/teiid/arquillian/IntegrationTestSOAPWebService.java new file mode 100644 index 0000000000..0120a383ed --- /dev/null +++ b/test-integration/common/src/test/java/org/teiid/arquillian/IntegrationTestSOAPWebService.java @@ -0,0 +1,110 @@ +/* + * JBoss, Home of Professional Open Source. + * See the COPYRIGHT.txt file distributed with this work for information + * regarding copyright ownership. Some portions may be licensed + * to Red Hat, Inc. under one or more contributor license agreements. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301 USA. + */ + +package org.teiid.arquillian; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import java.io.FileInputStream; +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.Statement; +import java.util.Collection; +import java.util.Properties; + +import org.jboss.arquillian.junit.Arquillian; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.teiid.adminapi.Admin; +import org.teiid.adminapi.AdminException; +import org.teiid.adminapi.VDB; +import org.teiid.adminapi.VDB.Status; +import org.teiid.adminapi.jboss.AdminFactory; +import org.teiid.core.util.UnitTestUtil; +import org.teiid.jdbc.TeiidDriver; + +@RunWith(Arquillian.class) +@SuppressWarnings("nls") +public class IntegrationTestSOAPWebService { + + private Admin admin; + + @Before + public void setup() throws Exception { + admin = AdminFactory.getInstance().createAdmin("localhost", AdminUtil.MANAGEMENT_PORT, "admin", + "admin".toCharArray()); + } + + @After + public void teardown() throws AdminException { + AdminUtil.cleanUp(admin); + admin.close(); + } + + @Test + public void testVDBDeployment() throws Exception { + Collection vdbs = admin.getVDBs(); + assertTrue(vdbs.isEmpty()); + + assertTrue(admin.getDataSourceTemplateNames().contains("webservice")); + String raSource = "web-ds"; + assertFalse(admin.getDataSourceNames().contains(raSource)); + + admin.deploy("addressing-service.war", new FileInputStream(UnitTestUtil.getTestDataFile("addressing-service.war"))); + + Properties p = new Properties(); + p.setProperty("class-name", "org.teiid.resource.adapter.ws.WSManagedConnectionFactory"); + p.setProperty("EndPoint", "http://localhost:8080/jboss-jaxws-addressing/AddressingService"); + + admin.createDataSource(raSource, "webservice", p); + + assertTrue(admin.getDataSourceNames().contains(raSource)); + + admin.deploy("soapsvc-vdb.xml",new FileInputStream(UnitTestUtil.getTestDataFile("soapsvc-vdb.xml"))); + vdbs = admin.getVDBs(); + assertFalse(vdbs.isEmpty()); + + VDB vdb = admin.getVDB("WSMSG", 1); + AdminUtil.waitForVDBLoad(admin, "WSMSG", 1, 3); + + vdb = admin.getVDB("WSMSG", 1); + assertTrue(vdb.isValid()); + assertTrue(vdb.getStatus().equals(Status.ACTIVE)); + + Connection conn = TeiidDriver.getInstance().connect("jdbc:teiid:WSMSG@mm://localhost:31000;user=user;password=user;", null); + Statement stmt = conn.createStatement(); + String sql = "SELECT *\n" + + "FROM ADDRESSINGSERVICE.SAYHELLO\n" + + "WHERE MESSAGEID = 'UUID-100' AND SAYHELLO = 'Teiid'\n" + + "AND ADDRESSINGSERVICE.SAYHELLO.To = 'http://www.w3.org/2005/08/addressing/anonymous'\n" + + "AND ADDRESSINGSERVICE.SAYHELLO.ReplyTo = 'http://www.w3.org/2005/08/addressing/anonymous'\n" + + "AND ADDRESSINGSERVICE.SAYHELLO.Action = 'http://www.w3.org/2005/08/addressing/ServiceIface/sayHello'"; + ResultSet rs = stmt.executeQuery(sql); + assertTrue(rs.next()); + assertEquals("Hello World!", rs.getString(1)); + conn.close(); + } +} diff --git a/test-integration/common/src/test/resources/addressing-service.war b/test-integration/common/src/test/resources/addressing-service.war new file mode 100644 index 0000000000000000000000000000000000000000..030d6995702773889e55b1c82c0d28e0a5613f2c GIT binary patch literal 8327 zcmb_h2|SeD_a7Ao4YDsuvhQSH60+}&ea#G$eI5IfJ=rQd*=5bXmXIZ6%U0GwD3M*F zZ28aR6~DLg|GoeJdwrgH9y8~B&$;KG=iGbFQByp74jX_PnF{g>KOX-2z(U@Yr8Okj z!qFqROvQ^5rOIT##bV{d)xvWWcOL0#dHQ&taj0@xL9YW^*BKG~`aV&Bg0-E2dQ zULcX<-QimPvXu(A?OpDEkoNAySvP=~zeFL(q&_f$pp*XG`BpOp*00GKrRC4NxV~Kt zp?m43X;Cv_JDBaxxWFx)^F*F$#t;&7YpzMcHJ$C{drK%qovv!(Y}y#ho_Pva&*%HI z%Kh2>p;{D*)cAD_uQRY=L044C?-mJqu)i0CBpB%y@waA7mGyy);4+^uVBv40sq<-8Sf&V0Yh>n^j)s?ZC271&Eu1svOk!xW2_w1LV=WUI zITWS$;^6KUnT(CyVAmtj_*Sl=vYSgb>z3!kJWGsXSP}Z;!P_-^jlmtd|NYF!z%cdI+X2 ztA8Ca5q^^$k7v7njqZfjl86~$8Knt2;x!h{$GexaELHiO)Ze06md^EHRVIM8^M}?&%vBvo9+LhEu%v zAfF2T1#7fKU*W^K`37oe?`G&!#jqNmA-i#bUf9&7VD2jcp)AgMyn|Jo3`(ER@=I@% zt~%9|9I(dQag(T}Qv);=K^M~#v9lc#w32VjZ1jz3mvWA7p;LtE+LP0+&2|e zzV98Pg%N4GY4NY6A{9J#lL)hen)+?f6roG4+hD6z0H4e7JEktjfMo%@;QU%gemG4T zEwi^AE@()0yE6P!L2tXUmDFtP0}J~VXy}4%z{KjC%XcKNi|#te+>&f>4e32gSx5O1 z1~r_X!6{!~8sE8`^#;2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%}CXj!T+v6LZ8yJz*WZP%}7a!#}d zI4n4|Tf8Mg(`Ni8)iHDV9GT`AdnLUmF2^2*@c2z<@~5rUDVIu{IKE*N+gxZ`*xq^< zRk+(B_Ix78%`bN4Ls1{RO~4tp`C{FQ@Xky@^=DRaLwujG(`NNP=UbT_LRJcviPhCv zV{LE+dC+F5EaaNC!|I8|994|phk*I~kRkB_^3wX3L!-T;ojuIa$pQwa3N6EK=E4{M z>eVVS7s#tv)+cc;EFgN{&k8=IA-745^ZHLr|2bi#J< zJeqp-c|CgR2xba{-0%qVsnrzG&JdmbbE^V5bL7AWEK8v7KR2^uw%@ldP{gQ_<;RHp z{K#aaGDTQhvQgC(f?h@ zVZYdI?L0txNwYnIM+YrM#q@H<{qd-<#6Bw4h|ZSm_MWNQQC6k zalbO33>OCnOTRLomd5-U7L~{x>%>Fwi%x%rJv78AY0Z(;-zPRlax483|3#^Pr8&pT qaJU)%{pfHkypr_an=(rH@j*gO5gqw<0sy4QzjjOjAfF8N-~Rwbsc5bM literal 0 HcmV?d00001 diff --git a/test-integration/common/src/test/resources/soapsvc-vdb.xml b/test-integration/common/src/test/resources/soapsvc-vdb.xml new file mode 100644 index 0000000000..7903a2373e --- /dev/null +++ b/test-integration/common/src/test/resources/soapsvc-vdb.xml @@ -0,0 +1,37 @@ + + + + + + + 'SOAP11', action => '', request => request.xml_out, endpoint => 'http://localhost:8080/jboss-jaxws-addressing/AddressingService', stream => TRUE)) AS response, TABLE(EXEC AddressingService.sayHello_response(response.result)) AS t; + END; + + CREATE VIRTUAL PROCEDURE sayHello_request(IN sayHello string NOT NULL, IN MessageID string NOT NULL, IN "To" string NOT NULL, IN ReplyTo string NOT NULL, IN Action string NOT NULL) RETURNS TABLE (xml_out xml) + AS + BEGIN + SELECT XMLELEMENT(NAME "soap:Envelope", XMLNAMESPACES('http://schemas.xmlsoap.org/soap/envelope/' AS soap, 'http://www.jboss.org/jbossws/ws-extensions/wsaddressing' AS tns, 'http://www.w3.org/2005/08/addressing' AS wsa), XMLELEMENT(NAME "soap:Header", XMLELEMENT(NAME "wsa:MessageID", AddressingService.sayHello_request.MessageID), XMLELEMENT(NAME "wsa:To", AddressingService.sayHello_request."To"), XMLELEMENT(NAME "wsa:ReplyTo", AddressingService.sayHello_request.ReplyTo), XMLELEMENT(NAME "wsa:Action", AddressingService.sayHello_request.Action)), XMLELEMENT(NAME "soap:Body", XMLELEMENT(NAME "tns:sayHello", AddressingService.sayHello_request.sayHello))) AS xml_out; + END; + + CREATE VIRTUAL PROCEDURE sayHello_response(IN xml_in xml NOT NULL) RETURNS TABLE (sayHelloResponse string) + AS + BEGIN + EXECUTE logMsg(context=>'org.teiid', level=>'ERROR', msg=>XMLSERIALIZE(sayHello_response.xml_in AS string)); + SELECT t.* FROM XMLTABLE(XMLNAMESPACES('http://www.jboss.org/jbossws/ws-extensions/wsaddressing' AS tns, + 'http://schemas.xmlsoap.org/soap/envelope/' AS soap), + 'soap:Envelope/soap:Body' PASSING AddressingService.sayHello_response.xml_in + COLUMNS sayHelloResponse string PATH 'tns:sayHelloResponse/return') AS t; + END; + ]]> + + + + + + + + \ No newline at end of file