You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2006/09/07 20:33:03 UTC
svn commit: r441171 [2/3] - in /incubator/cxf/trunk:
api/src/main/java/org/apache/cxf/databinding/
api/src/main/java/org/apache/cxf/ws/addressing/
api/src/main/resources/schemas/wsdl/ api/src/test/java/org/apache/cxf/wsdl/
api/src/test/resources/wsdl/ ...
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java?view=diff&rev=441171&r1=441170&r2=441171
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java Thu Sep 7 11:32:57 2006
@@ -1,167 +1,167 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.cxf.systest.dispatch;
-
-import java.io.InputStream;
-import java.net.URL;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.namespace.QName;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.ws.Dispatch;
-import javax.xml.ws.Endpoint;
-import javax.xml.ws.Service;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.apache.cxf.systest.common.ClientServerSetupBase;
-import org.apache.cxf.systest.common.ClientServerTestBase;
-import org.apache.cxf.systest.common.TestServerBase;
-import org.apache.hello_world_soap_http.GreeterImpl;
-import org.apache.hello_world_soap_http.SOAPService;
-import org.apache.hello_world_soap_http.types.GreetMe;
-import org.apache.hello_world_soap_http.types.GreetMeResponse;
-
-public class DispatchClientServerTest extends ClientServerTestBase {
-
- private final QName serviceName = new QName("http://apache.org/hello_world_soap_http", "SOAPService");
- private final QName portName = new QName("http://apache.org/hello_world_soap_http", "SoapPort");
-
- public static class Server extends TestServerBase {
-
- protected void run() {
- Object implementor = new GreeterImpl();
- String address = "http://localhost:9000/SoapContext/SoapPort";
- Endpoint.publish(address, implementor);
-
- }
-
- public static void main(String[] args) {
- try {
- Server s = new Server();
- s.start();
- } catch (Exception ex) {
- ex.printStackTrace();
- System.exit(-1);
- } finally {
- System.out.println("done!");
- }
- }
- }
-
- public static Test suite() throws Exception {
- TestSuite suite = new TestSuite(DispatchClientServerTest.class);
- return new ClientServerSetupBase(suite) {
- public void startServers() throws Exception {
- assertTrue("server did not launch correctly", launchServer(Server.class));
- }
- };
- }
-
- public void testSOAPMessage() throws Exception {
-
- URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
- assertNotNull(wsdl);
-
- SOAPService service = new SOAPService(wsdl, serviceName);
- assertNotNull(service);
-
- InputStream is = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq.xml");
- SOAPMessage soapReqMsg = MessageFactory.newInstance().createMessage(null, is);
- assertNotNull(soapReqMsg);
-
- Dispatch<SOAPMessage> disp = service
- .createDispatch(portName, SOAPMessage.class, Service.Mode.MESSAGE);
- SOAPMessage soapResMsg = disp.invoke(soapReqMsg);
- assertNotNull(soapResMsg);
- String expected = "Hello TestSOAPInputMessage";
- assertEquals("Response should be : Hello TestSOAPInputMessage", expected, soapResMsg.getSOAPBody()
- .getTextContent());
-
- }
-
- public void testDOMSourceMESSAGE() throws Exception {
- URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
- assertNotNull(wsdl);
-
- SOAPService service = new SOAPService(wsdl, serviceName);
- assertNotNull(service);
-
- InputStream is = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq.xml");
- SOAPMessage soapReqMsg = MessageFactory.newInstance().createMessage(null, is);
- DOMSource domReqMsg = new DOMSource(soapReqMsg.getSOAPPart());
- assertNotNull(domReqMsg);
-
- Dispatch<DOMSource> disp = service.createDispatch(portName, DOMSource.class, Service.Mode.MESSAGE);
- DOMSource domResMsg = disp.invoke(domReqMsg);
- assertNotNull(domResMsg);
- String expected = "Hello TestSOAPInputMessage";
-
- assertEquals("Response should be : Hello TestSOAPInputMessage", expected, domResMsg.getNode()
- .getFirstChild().getTextContent());
- }
-
- public void testDOMSourcePAYLOAD() throws Exception {
- URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
- assertNotNull(wsdl);
-
- SOAPService service = new SOAPService(wsdl, serviceName);
- assertNotNull(service);
-
- InputStream is = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq.xml");
- SOAPMessage soapReqMsg = MessageFactory.newInstance().createMessage(null, is);
- DOMSource domReqMsg = new DOMSource(soapReqMsg.getSOAPBody().extractContentAsDocument());
- assertNotNull(domReqMsg);
-
- Dispatch<DOMSource> disp = service.createDispatch(portName, DOMSource.class, Service.Mode.PAYLOAD);
-
- // invoke
- DOMSource domResMsg = disp.invoke(domReqMsg);
- assertNotNull(domResMsg);
- String expected = "Hello TestSOAPInputMessage";
- assertEquals("Response should be : Hello TestSOAPInputMessage", expected, domResMsg.getNode()
- .getFirstChild().getTextContent());
- }
-
- public void testJAXBObjectPAYLOAD() throws Exception {
- URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
- assertNotNull(wsdl);
-
- SOAPService service = new SOAPService(wsdl, serviceName);
- assertNotNull(service);
-
- JAXBContext jc = JAXBContext.newInstance("org.apache.hello_world_soap_http.types");
- Dispatch<Object> disp = service.createDispatch(portName, jc, Service.Mode.PAYLOAD);
-
- String expected = "Hello Jeeves";
- GreetMe greetMe = new GreetMe();
- greetMe.setRequestType("Jeeves");
-
- Object response = disp.invoke(greetMe);
- assertNotNull(response);
- String responseValue = ((GreetMeResponse)response).getResponseType();
- assertTrue("Expected string, " + expected , expected.equals(responseValue));
- }
-
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.dispatch;
+
+import java.io.InputStream;
+import java.net.URL;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.ws.Dispatch;
+import javax.xml.ws.Endpoint;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.apache.cxf.systest.common.ClientServerSetupBase;
+import org.apache.cxf.systest.common.ClientServerTestBase;
+import org.apache.cxf.systest.common.TestServerBase;
+import org.apache.hello_world_soap_http.GreeterImpl;
+import org.apache.hello_world_soap_http.SOAPService;
+import org.apache.hello_world_soap_http.types.GreetMe;
+import org.apache.hello_world_soap_http.types.GreetMeResponse;
+
+public class DispatchClientServerTest extends ClientServerTestBase {
+
+ private final QName serviceName = new QName("http://apache.org/hello_world_soap_http", "SOAPService");
+ private final QName portName = new QName("http://apache.org/hello_world_soap_http", "SoapPort");
+
+ public static class Server extends TestServerBase {
+
+ protected void run() {
+ Object implementor = new GreeterImpl();
+ String address = "http://localhost:9000/SoapContext/SoapPort";
+ Endpoint.publish(address, implementor);
+
+ }
+
+ public static void main(String[] args) {
+ try {
+ Server s = new Server();
+ s.start();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ System.exit(-1);
+ } finally {
+ System.out.println("done!");
+ }
+ }
+ }
+
+ public static Test suite() throws Exception {
+ TestSuite suite = new TestSuite(DispatchClientServerTest.class);
+ return new ClientServerSetupBase(suite) {
+ public void startServers() throws Exception {
+ assertTrue("server did not launch correctly", launchServer(Server.class));
+ }
+ };
+ }
+
+ public void testSOAPMessage() throws Exception {
+
+ URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
+ assertNotNull(wsdl);
+
+ SOAPService service = new SOAPService(wsdl, serviceName);
+ assertNotNull(service);
+
+ InputStream is = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq.xml");
+ SOAPMessage soapReqMsg = MessageFactory.newInstance().createMessage(null, is);
+ assertNotNull(soapReqMsg);
+
+ Dispatch<SOAPMessage> disp = service
+ .createDispatch(portName, SOAPMessage.class, Service.Mode.MESSAGE);
+ SOAPMessage soapResMsg = disp.invoke(soapReqMsg);
+ assertNotNull(soapResMsg);
+ String expected = "Hello TestSOAPInputMessage";
+ assertEquals("Response should be : Hello TestSOAPInputMessage", expected, soapResMsg.getSOAPBody()
+ .getTextContent());
+
+ }
+
+ public void testDOMSourceMESSAGE() throws Exception {
+ URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
+ assertNotNull(wsdl);
+
+ SOAPService service = new SOAPService(wsdl, serviceName);
+ assertNotNull(service);
+
+ InputStream is = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq.xml");
+ SOAPMessage soapReqMsg = MessageFactory.newInstance().createMessage(null, is);
+ DOMSource domReqMsg = new DOMSource(soapReqMsg.getSOAPPart());
+ assertNotNull(domReqMsg);
+
+ Dispatch<DOMSource> disp = service.createDispatch(portName, DOMSource.class, Service.Mode.MESSAGE);
+ DOMSource domResMsg = disp.invoke(domReqMsg);
+ assertNotNull(domResMsg);
+ String expected = "Hello TestSOAPInputMessage";
+
+ assertEquals("Response should be : Hello TestSOAPInputMessage", expected, domResMsg.getNode()
+ .getFirstChild().getTextContent());
+ }
+
+ public void testDOMSourcePAYLOAD() throws Exception {
+ URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
+ assertNotNull(wsdl);
+
+ SOAPService service = new SOAPService(wsdl, serviceName);
+ assertNotNull(service);
+
+ InputStream is = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq.xml");
+ SOAPMessage soapReqMsg = MessageFactory.newInstance().createMessage(null, is);
+ DOMSource domReqMsg = new DOMSource(soapReqMsg.getSOAPBody().extractContentAsDocument());
+ assertNotNull(domReqMsg);
+
+ Dispatch<DOMSource> disp = service.createDispatch(portName, DOMSource.class, Service.Mode.PAYLOAD);
+
+ // invoke
+ DOMSource domResMsg = disp.invoke(domReqMsg);
+ assertNotNull(domResMsg);
+ String expected = "Hello TestSOAPInputMessage";
+ assertEquals("Response should be : Hello TestSOAPInputMessage", expected, domResMsg.getNode()
+ .getFirstChild().getTextContent());
+ }
+
+ public void testJAXBObjectPAYLOAD() throws Exception {
+ URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
+ assertNotNull(wsdl);
+
+ SOAPService service = new SOAPService(wsdl, serviceName);
+ assertNotNull(service);
+
+ JAXBContext jc = JAXBContext.newInstance("org.apache.hello_world_soap_http.types");
+ Dispatch<Object> disp = service.createDispatch(portName, jc, Service.Mode.PAYLOAD);
+
+ String expected = "Hello Jeeves";
+ GreetMe greetMe = new GreetMe();
+ greetMe.setRequestType("Jeeves");
+
+ Object response = disp.invoke(greetMe);
+ assertNotNull(response);
+ String responseValue = ((GreetMeResponse)response).getResponseType();
+ assertTrue("Expected string, " + expected , expected.equals(responseValue));
+ }
+
+
+}
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq.xml?view=diff&rev=441171&r1=441170&r2=441171
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq.xml (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq.xml Thu Sep 7 11:32:57 2006
@@ -1,21 +1,21 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body><ns4:greetMe xmlns:ns4="http://apache.org/hello_world_soap_http/types"><ns4:requestType>TestSOAPInputMessage</ns4:requestType></ns4:greetMe></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body><ns4:greetMe xmlns:ns4="http://apache.org/hello_world_soap_http/types"><ns4:requestType>TestSOAPInputMessage</ns4:requestType></ns4:greetMe></SOAP-ENV:Body></SOAP-ENV:Envelope>
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/dispatch/resources/GreetMeDocLiteralReq.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerTestImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/HandlerTestImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/PingReq.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/Server.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/Server.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TestHandler.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TestHandlerBase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TestHandlerBase.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TestSOAPHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TestSOAPHandler.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/TestStreamHandler.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/handlers.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/handlers.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/handlers/handlers.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourceMessageProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourceMessageProvider.java?view=diff&rev=441171&r1=441170&r2=441171
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourceMessageProvider.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourceMessageProvider.java Thu Sep 7 11:32:57 2006
@@ -1,85 +1,85 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.cxf.systest.provider;
-import java.io.InputStream;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.ws.Provider;
-import javax.xml.ws.Service;
-import javax.xml.ws.ServiceMode;
-import javax.xml.ws.WebServiceProvider;
-
-import org.w3c.dom.Node;
-
-//The following wsdl file is used.
-//wsdlLocation = "/trunk/testutils/src/main/resources/wsdl/hello_world_rpc_lit.wsdl"
-@WebServiceProvider(portName = "SoapPortRPCLit1", serviceName = "SOAPServiceRPCLit1",
- targetNamespace = "http://apache.org/hello_world_rpclit",
- wsdlLocation = "/wsdl/hello_world_rpc_lit.wsdl")
-@ServiceMode(value = Service.Mode.MESSAGE)
-public class HWDOMSourceMessageProvider implements Provider<DOMSource> {
-
- private static QName sayHi = new QName("http://apache.org/hello_world_rpclit", "sayHi");
- private static QName greetMe = new QName("http://apache.org/hello_world_rpclit", "greetMe");
- private SOAPMessage sayHiResponse;
- private SOAPMessage greetMeResponse;
- private MessageFactory factory;
-
- public HWDOMSourceMessageProvider() {
-
- try {
- factory = MessageFactory.newInstance();
- InputStream is = getClass().getResourceAsStream("resources/sayHiRpcLiteralResp.xml");
- sayHiResponse = factory.createMessage(null, is);
- is.close();
- is = getClass().getResourceAsStream("resources/GreetMeRpcLiteralResp.xml");
- greetMeResponse = factory.createMessage(null, is);
- is.close();
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- public DOMSource invoke(DOMSource request) {
- DOMSource response = new DOMSource();
- try {
- SOAPMessage msg = factory.createMessage();
- msg.getSOAPPart().setContent(request);
- SOAPBody body = msg.getSOAPBody();
- Node n = body.getFirstChild();
-
- while (n.getNodeType() != Node.ELEMENT_NODE) {
- n = n.getNextSibling();
- }
- if (n.getLocalName().equals(sayHi.getLocalPart())) {
- response.setNode(sayHiResponse.getSOAPPart());
- } else if (n.getLocalName().equals(greetMe.getLocalPart())) {
- response.setNode(greetMeResponse.getSOAPPart());
- }
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- return response;
- }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.provider;
+import java.io.InputStream;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.ws.Provider;
+import javax.xml.ws.Service;
+import javax.xml.ws.ServiceMode;
+import javax.xml.ws.WebServiceProvider;
+
+import org.w3c.dom.Node;
+
+//The following wsdl file is used.
+//wsdlLocation = "/trunk/testutils/src/main/resources/wsdl/hello_world_rpc_lit.wsdl"
+@WebServiceProvider(portName = "SoapPortRPCLit1", serviceName = "SOAPServiceRPCLit1",
+ targetNamespace = "http://apache.org/hello_world_rpclit",
+ wsdlLocation = "/wsdl/hello_world_rpc_lit.wsdl")
+@ServiceMode(value = Service.Mode.MESSAGE)
+public class HWDOMSourceMessageProvider implements Provider<DOMSource> {
+
+ private static QName sayHi = new QName("http://apache.org/hello_world_rpclit", "sayHi");
+ private static QName greetMe = new QName("http://apache.org/hello_world_rpclit", "greetMe");
+ private SOAPMessage sayHiResponse;
+ private SOAPMessage greetMeResponse;
+ private MessageFactory factory;
+
+ public HWDOMSourceMessageProvider() {
+
+ try {
+ factory = MessageFactory.newInstance();
+ InputStream is = getClass().getResourceAsStream("resources/sayHiRpcLiteralResp.xml");
+ sayHiResponse = factory.createMessage(null, is);
+ is.close();
+ is = getClass().getResourceAsStream("resources/GreetMeRpcLiteralResp.xml");
+ greetMeResponse = factory.createMessage(null, is);
+ is.close();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ public DOMSource invoke(DOMSource request) {
+ DOMSource response = new DOMSource();
+ try {
+ SOAPMessage msg = factory.createMessage();
+ msg.getSOAPPart().setContent(request);
+ SOAPBody body = msg.getSOAPBody();
+ Node n = body.getFirstChild();
+
+ while (n.getNodeType() != Node.ELEMENT_NODE) {
+ n = n.getNextSibling();
+ }
+ if (n.getLocalName().equals(sayHi.getLocalPart())) {
+ response.setNode(sayHiResponse.getSOAPPart());
+ } else if (n.getLocalName().equals(greetMe.getLocalPart())) {
+ response.setNode(greetMeResponse.getSOAPPart());
+ }
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ return response;
+ }
+}
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourceMessageProvider.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourceMessageProvider.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java?view=diff&rev=441171&r1=441170&r2=441171
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java Thu Sep 7 11:32:57 2006
@@ -1,90 +1,90 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.cxf.systest.provider;
-import java.io.InputStream;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.ws.Provider;
-import javax.xml.ws.WebServiceProvider;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-//The following wsdl file is used.
-//wsdlLocation = "/trunk/testutils/src/main/resources/wsdl/hello_world_rpc_lit.wsdl"
-@WebServiceProvider(portName = "SoapPortRPCLit2", serviceName = "SOAPServiceRPCLit2",
- targetNamespace = "http://apache.org/hello_world_rpclit",
- wsdlLocation = "/wsdl/hello_world_rpc_lit.wsdl")
-public class HWDOMSourcePayloadProvider implements Provider<DOMSource> {
-
- private static QName sayHi = new QName("http://apache.org/hello_world_rpclit", "sayHi");
- private static QName greetMe = new QName("http://apache.org/hello_world_rpclit", "greetMe");
- private SOAPMessage sayHiResponse;
- private SOAPMessage greetMeResponse;
- private MessageFactory factory;
-
- public HWDOMSourcePayloadProvider() {
-
- try {
- factory = MessageFactory.newInstance();
- InputStream is = getClass().getResourceAsStream("resources/sayHiRpcLiteralResp.xml");
- sayHiResponse = factory.createMessage(null, is);
- is.close();
- is = getClass().getResourceAsStream("resources/GreetMeRpcLiteralResp.xml");
- greetMeResponse = factory.createMessage(null, is);
- is.close();
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- public DOMSource invoke(DOMSource request) {
- DOMSource response = new DOMSource();
- try {
- SOAPMessage msg = factory.createMessage();
- SOAPBody body = msg.getSOAPBody();
- body.addDocument((Document)request.getNode());
-
- Node n = getElementChildNode(body);
- if (n.getLocalName().equals(sayHi.getLocalPart())) {
- response.setNode(sayHiResponse.getSOAPBody().extractContentAsDocument());
- } else if (n.getLocalName().equals(greetMe.getLocalPart())) {
- response.setNode(greetMeResponse.getSOAPBody().extractContentAsDocument());
- }
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- return response;
- }
-
- private Node getElementChildNode(SOAPBody body) {
- Node n = body.getFirstChild();
-
- while (n.getNodeType() != Node.ELEMENT_NODE) {
- n = n.getNextSibling();
- }
-
- return n;
- }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.provider;
+import java.io.InputStream;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.ws.Provider;
+import javax.xml.ws.WebServiceProvider;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+//The following wsdl file is used.
+//wsdlLocation = "/trunk/testutils/src/main/resources/wsdl/hello_world_rpc_lit.wsdl"
+@WebServiceProvider(portName = "SoapPortRPCLit2", serviceName = "SOAPServiceRPCLit2",
+ targetNamespace = "http://apache.org/hello_world_rpclit",
+ wsdlLocation = "/wsdl/hello_world_rpc_lit.wsdl")
+public class HWDOMSourcePayloadProvider implements Provider<DOMSource> {
+
+ private static QName sayHi = new QName("http://apache.org/hello_world_rpclit", "sayHi");
+ private static QName greetMe = new QName("http://apache.org/hello_world_rpclit", "greetMe");
+ private SOAPMessage sayHiResponse;
+ private SOAPMessage greetMeResponse;
+ private MessageFactory factory;
+
+ public HWDOMSourcePayloadProvider() {
+
+ try {
+ factory = MessageFactory.newInstance();
+ InputStream is = getClass().getResourceAsStream("resources/sayHiRpcLiteralResp.xml");
+ sayHiResponse = factory.createMessage(null, is);
+ is.close();
+ is = getClass().getResourceAsStream("resources/GreetMeRpcLiteralResp.xml");
+ greetMeResponse = factory.createMessage(null, is);
+ is.close();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ public DOMSource invoke(DOMSource request) {
+ DOMSource response = new DOMSource();
+ try {
+ SOAPMessage msg = factory.createMessage();
+ SOAPBody body = msg.getSOAPBody();
+ body.addDocument((Document)request.getNode());
+
+ Node n = getElementChildNode(body);
+ if (n.getLocalName().equals(sayHi.getLocalPart())) {
+ response.setNode(sayHiResponse.getSOAPBody().extractContentAsDocument());
+ } else if (n.getLocalName().equals(greetMe.getLocalPart())) {
+ response.setNode(greetMeResponse.getSOAPBody().extractContentAsDocument());
+ }
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ return response;
+ }
+
+ private Node getElementChildNode(SOAPBody body) {
+ Node n = body.getFirstChild();
+
+ while (n.getNodeType() != Node.ELEMENT_NODE) {
+ n = n.getNextSibling();
+ }
+
+ return n;
+ }
+}
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWDOMSourcePayloadProvider.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSAXSourceMessageProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSAXSourceMessageProvider.java?view=diff&rev=441171&r1=441170&r2=441171
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSAXSourceMessageProvider.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSAXSourceMessageProvider.java Thu Sep 7 11:32:57 2006
@@ -1,89 +1,89 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.cxf.systest.provider;
-
-import java.io.InputStream;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.ws.Provider;
-import javax.xml.ws.Service;
-import javax.xml.ws.ServiceMode;
-import javax.xml.ws.WebServiceProvider;
-
-import org.w3c.dom.Node;
-
-import org.xml.sax.InputSource;
-
-//The following wsdl file is used.
-//wsdlLocation = "/trunk/testutils/src/main/resources/wsdl/hello_world_rpc_lit.wsdl"
-@WebServiceProvider(portName = "SoapPortRPCLit3", serviceName = "SOAPServiceRPCLit3",
- targetNamespace = "http://apache.org/hello_world_rpclit",
-wsdlLocation = "/wsdl/hello_world_rpc_lit.wsdl")
-@ServiceMode(value = Service.Mode.MESSAGE)
-public class HWSAXSourceMessageProvider implements Provider<SAXSource> {
-
- private static QName sayHi = new QName("http://apache.org/hello_world_rpclit", "sayHi");
- private static QName greetMe = new QName("http://apache.org/hello_world_rpclit", "greetMe");
- private InputSource sayHiInputSource;
- private InputSource greetMeInputSource;
- private MessageFactory factory;
-
- public HWSAXSourceMessageProvider() {
-
- try {
- factory = MessageFactory.newInstance();
- InputStream is1 = getClass().getResourceAsStream("resources/sayHiRpcLiteralResp.xml");
- sayHiInputSource = new InputSource(is1);
-
- InputStream is2 = getClass().getResourceAsStream("resources/GreetMeRpcLiteralResp.xml");
- greetMeInputSource = new InputSource(is2);
-
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- public SAXSource invoke(SAXSource request) {
- SAXSource response = new SAXSource();
- try {
- SOAPMessage msg = factory.createMessage();
- msg.getSOAPPart().setContent(request);
- SOAPBody body = msg.getSOAPBody();
- Node n = body.getFirstChild();
-
- while (n.getNodeType() != Node.ELEMENT_NODE) {
- n = n.getNextSibling();
- }
- if (n.getLocalName().equals(sayHi.getLocalPart())) {
- response.setInputSource(sayHiInputSource);
- } else if (n.getLocalName().equals(greetMe.getLocalPart())) {
- response.setInputSource(greetMeInputSource);
- }
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- return response;
- }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.provider;
+
+import java.io.InputStream;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.ws.Provider;
+import javax.xml.ws.Service;
+import javax.xml.ws.ServiceMode;
+import javax.xml.ws.WebServiceProvider;
+
+import org.w3c.dom.Node;
+
+import org.xml.sax.InputSource;
+
+//The following wsdl file is used.
+//wsdlLocation = "/trunk/testutils/src/main/resources/wsdl/hello_world_rpc_lit.wsdl"
+@WebServiceProvider(portName = "SoapPortRPCLit3", serviceName = "SOAPServiceRPCLit3",
+ targetNamespace = "http://apache.org/hello_world_rpclit",
+wsdlLocation = "/wsdl/hello_world_rpc_lit.wsdl")
+@ServiceMode(value = Service.Mode.MESSAGE)
+public class HWSAXSourceMessageProvider implements Provider<SAXSource> {
+
+ private static QName sayHi = new QName("http://apache.org/hello_world_rpclit", "sayHi");
+ private static QName greetMe = new QName("http://apache.org/hello_world_rpclit", "greetMe");
+ private InputSource sayHiInputSource;
+ private InputSource greetMeInputSource;
+ private MessageFactory factory;
+
+ public HWSAXSourceMessageProvider() {
+
+ try {
+ factory = MessageFactory.newInstance();
+ InputStream is1 = getClass().getResourceAsStream("resources/sayHiRpcLiteralResp.xml");
+ sayHiInputSource = new InputSource(is1);
+
+ InputStream is2 = getClass().getResourceAsStream("resources/GreetMeRpcLiteralResp.xml");
+ greetMeInputSource = new InputSource(is2);
+
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ public SAXSource invoke(SAXSource request) {
+ SAXSource response = new SAXSource();
+ try {
+ SOAPMessage msg = factory.createMessage();
+ msg.getSOAPPart().setContent(request);
+ SOAPBody body = msg.getSOAPBody();
+ Node n = body.getFirstChild();
+
+ while (n.getNodeType() != Node.ELEMENT_NODE) {
+ n = n.getNextSibling();
+ }
+ if (n.getLocalName().equals(sayHi.getLocalPart())) {
+ response.setInputSource(sayHiInputSource);
+ } else if (n.getLocalName().equals(greetMe.getLocalPart())) {
+ response.setInputSource(greetMeInputSource);
+ }
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ return response;
+ }
+
+}
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSAXSourceMessageProvider.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSAXSourceMessageProvider.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSAXSourcePayloadProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSAXSourcePayloadProvider.java?view=diff&rev=441171&r1=441170&r2=441171
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSAXSourcePayloadProvider.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSAXSourcePayloadProvider.java Thu Sep 7 11:32:57 2006
@@ -1,117 +1,117 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.cxf.systest.provider;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.MessageFactory;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.ws.Provider;
-import javax.xml.ws.Service;
-import javax.xml.ws.ServiceMode;
-import javax.xml.ws.WebServiceProvider;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.bootstrap.DOMImplementationRegistry;
-import org.w3c.dom.ls.DOMImplementationLS;
-import org.w3c.dom.ls.LSOutput;
-import org.w3c.dom.ls.LSSerializer;
-
-import org.xml.sax.InputSource;
-
-
-//The following wsdl file is used.
-//wsdlLocation = "/trunk/testutils/src/main/resources/wsdl/hello_world_rpc_lit.wsdl"
-@WebServiceProvider(portName = "SoapPortRPCLit5", serviceName = "SOAPServiceRPCLit5",
- targetNamespace = "http://apache.org/hello_world_rpclit",
-wsdlLocation = "/wsdl/hello_world_rpc_lit.wsdl")
-@ServiceMode(value = Service.Mode.PAYLOAD)
-public class HWSAXSourcePayloadProvider implements Provider<SAXSource> {
-
- private static QName sayHi = new QName("http://apache.org/hello_world_rpclit", "sayHi");
- private static QName greetMe = new QName("http://apache.org/hello_world_rpclit", "greetMe");
- private MessageFactory factory;
- private InputSource sayHiInputSource;
- private InputSource greetMeInputSource;
-
- public HWSAXSourcePayloadProvider() {
-
- try {
- factory = MessageFactory.newInstance();
- InputStream is = getClass().getResourceAsStream("resources/sayHiRpcLiteralResp.xml");
- Document sayHiDocument = factory.createMessage(null, is).getSOAPBody().extractContentAsDocument();
- sayHiInputSource = new InputSource(getSOAPBodyStream(sayHiDocument));
-
- InputStream is2 = getClass().getResourceAsStream("resources/GreetMeRpcLiteralResp.xml");
- Document greetMeDocument =
- factory.createMessage(null, is2).getSOAPBody().extractContentAsDocument();
- greetMeInputSource = new InputSource(getSOAPBodyStream(greetMeDocument));
-
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- public SAXSource invoke(SAXSource request) {
- SAXSource response = new SAXSource();
- try {
-
- DOMResult domResult = new DOMResult();
- Transformer transformer = TransformerFactory.newInstance().newTransformer();
- transformer.transform(request, domResult);
- Node n = domResult.getNode().getFirstChild();
-
- while (n.getNodeType() != Node.ELEMENT_NODE) {
- n = n.getNextSibling();
- }
- if (n.getLocalName().equals(sayHi.getLocalPart())) {
- response.setInputSource(sayHiInputSource);
-
- } else if (n.getLocalName().equals(greetMe.getLocalPart())) {
- response.setInputSource(greetMeInputSource);
- }
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- return response;
- }
-
- private InputStream getSOAPBodyStream(Document doc) throws Exception {
- System.setProperty(DOMImplementationRegistry.PROPERTY,
- "com.sun.org.apache.xerces.internal.dom.DOMImplementationSourceImpl");
- DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
- DOMImplementationLS impl = (DOMImplementationLS)registry.getDOMImplementation("LS");
- LSOutput output = impl.createLSOutput();
- ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
- output.setByteStream(byteArrayOutputStream);
- LSSerializer writer = impl.createLSSerializer();
- writer.write(doc, output);
- byte[] buf = byteArrayOutputStream.toByteArray();
- return new ByteArrayInputStream(buf);
- }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.provider;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.ws.Provider;
+import javax.xml.ws.Service;
+import javax.xml.ws.ServiceMode;
+import javax.xml.ws.WebServiceProvider;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.bootstrap.DOMImplementationRegistry;
+import org.w3c.dom.ls.DOMImplementationLS;
+import org.w3c.dom.ls.LSOutput;
+import org.w3c.dom.ls.LSSerializer;
+
+import org.xml.sax.InputSource;
+
+
+//The following wsdl file is used.
+//wsdlLocation = "/trunk/testutils/src/main/resources/wsdl/hello_world_rpc_lit.wsdl"
+@WebServiceProvider(portName = "SoapPortRPCLit5", serviceName = "SOAPServiceRPCLit5",
+ targetNamespace = "http://apache.org/hello_world_rpclit",
+wsdlLocation = "/wsdl/hello_world_rpc_lit.wsdl")
+@ServiceMode(value = Service.Mode.PAYLOAD)
+public class HWSAXSourcePayloadProvider implements Provider<SAXSource> {
+
+ private static QName sayHi = new QName("http://apache.org/hello_world_rpclit", "sayHi");
+ private static QName greetMe = new QName("http://apache.org/hello_world_rpclit", "greetMe");
+ private MessageFactory factory;
+ private InputSource sayHiInputSource;
+ private InputSource greetMeInputSource;
+
+ public HWSAXSourcePayloadProvider() {
+
+ try {
+ factory = MessageFactory.newInstance();
+ InputStream is = getClass().getResourceAsStream("resources/sayHiRpcLiteralResp.xml");
+ Document sayHiDocument = factory.createMessage(null, is).getSOAPBody().extractContentAsDocument();
+ sayHiInputSource = new InputSource(getSOAPBodyStream(sayHiDocument));
+
+ InputStream is2 = getClass().getResourceAsStream("resources/GreetMeRpcLiteralResp.xml");
+ Document greetMeDocument =
+ factory.createMessage(null, is2).getSOAPBody().extractContentAsDocument();
+ greetMeInputSource = new InputSource(getSOAPBodyStream(greetMeDocument));
+
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ public SAXSource invoke(SAXSource request) {
+ SAXSource response = new SAXSource();
+ try {
+
+ DOMResult domResult = new DOMResult();
+ Transformer transformer = TransformerFactory.newInstance().newTransformer();
+ transformer.transform(request, domResult);
+ Node n = domResult.getNode().getFirstChild();
+
+ while (n.getNodeType() != Node.ELEMENT_NODE) {
+ n = n.getNextSibling();
+ }
+ if (n.getLocalName().equals(sayHi.getLocalPart())) {
+ response.setInputSource(sayHiInputSource);
+
+ } else if (n.getLocalName().equals(greetMe.getLocalPart())) {
+ response.setInputSource(greetMeInputSource);
+ }
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ return response;
+ }
+
+ private InputStream getSOAPBodyStream(Document doc) throws Exception {
+ System.setProperty(DOMImplementationRegistry.PROPERTY,
+ "com.sun.org.apache.xerces.internal.dom.DOMImplementationSourceImpl");
+ DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
+ DOMImplementationLS impl = (DOMImplementationLS)registry.getDOMImplementation("LS");
+ LSOutput output = impl.createLSOutput();
+ ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+ output.setByteStream(byteArrayOutputStream);
+ LSSerializer writer = impl.createLSSerializer();
+ writer.write(doc, output);
+ byte[] buf = byteArrayOutputStream.toByteArray();
+ return new ByteArrayInputStream(buf);
+ }
+
+}
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSAXSourcePayloadProvider.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSAXSourcePayloadProvider.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageDocProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageDocProvider.java?view=diff&rev=441171&r1=441170&r2=441171
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageDocProvider.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageDocProvider.java Thu Sep 7 11:32:57 2006
@@ -1,82 +1,82 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.cxf.systest.provider;
-
-import java.io.InputStream;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.Provider;
-import javax.xml.ws.Service;
-import javax.xml.ws.ServiceMode;
-import javax.xml.ws.WebServiceProvider;
-
-import org.w3c.dom.Node;
-
-//The following wsdl file is used.
-//wsdlLocation = "/trunk/testutils/src/main/resources/wsdl/hello_world.wsdl"
-@WebServiceProvider(portName = "SoapProviderPort", serviceName = "SOAPProviderService",
- targetNamespace = "http://apache.org/hello_world_soap_http",
- wsdlLocation = "/wsdl/hello_world.wsdl")
-@ServiceMode(value = Service.Mode.MESSAGE)
-public class HWSoapMessageDocProvider implements Provider<SOAPMessage> {
-
- private static QName sayHi = new QName("http://apache.org/hello_world_soap_http", "sayHi");
- private static QName greetMe = new QName("http://apache.org/hello_world_soap_http", "greetMe");
- private SOAPMessage sayHiResponse;
- private SOAPMessage greetMeResponse;
-
- public HWSoapMessageDocProvider() {
-
- try {
- MessageFactory factory = MessageFactory.newInstance();
- InputStream is = getClass().getResourceAsStream("resources/sayHiDocLiteralResp.xml");
- sayHiResponse = factory.createMessage(null, is);
- is.close();
- is = getClass().getResourceAsStream("resources/GreetMeDocLiteralResp.xml");
- greetMeResponse = factory.createMessage(null, is);
- is.close();
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- public SOAPMessage invoke(SOAPMessage request) {
- SOAPMessage response = null;
- try {
- SOAPBody body = request.getSOAPBody();
- Node n = body.getFirstChild();
-
- while (n.getNodeType() != Node.ELEMENT_NODE) {
- n = n.getNextSibling();
- }
- if (n.getLocalName().equals(sayHi.getLocalPart())) {
- response = sayHiResponse;
- } else if (n.getLocalName().equals(greetMe.getLocalPart())) {
- response = greetMeResponse;
- }
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- return response;
- }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.provider;
+
+import java.io.InputStream;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.Provider;
+import javax.xml.ws.Service;
+import javax.xml.ws.ServiceMode;
+import javax.xml.ws.WebServiceProvider;
+
+import org.w3c.dom.Node;
+
+//The following wsdl file is used.
+//wsdlLocation = "/trunk/testutils/src/main/resources/wsdl/hello_world.wsdl"
+@WebServiceProvider(portName = "SoapProviderPort", serviceName = "SOAPProviderService",
+ targetNamespace = "http://apache.org/hello_world_soap_http",
+ wsdlLocation = "/wsdl/hello_world.wsdl")
+@ServiceMode(value = Service.Mode.MESSAGE)
+public class HWSoapMessageDocProvider implements Provider<SOAPMessage> {
+
+ private static QName sayHi = new QName("http://apache.org/hello_world_soap_http", "sayHi");
+ private static QName greetMe = new QName("http://apache.org/hello_world_soap_http", "greetMe");
+ private SOAPMessage sayHiResponse;
+ private SOAPMessage greetMeResponse;
+
+ public HWSoapMessageDocProvider() {
+
+ try {
+ MessageFactory factory = MessageFactory.newInstance();
+ InputStream is = getClass().getResourceAsStream("resources/sayHiDocLiteralResp.xml");
+ sayHiResponse = factory.createMessage(null, is);
+ is.close();
+ is = getClass().getResourceAsStream("resources/GreetMeDocLiteralResp.xml");
+ greetMeResponse = factory.createMessage(null, is);
+ is.close();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ public SOAPMessage invoke(SOAPMessage request) {
+ SOAPMessage response = null;
+ try {
+ SOAPBody body = request.getSOAPBody();
+ Node n = body.getFirstChild();
+
+ while (n.getNodeType() != Node.ELEMENT_NODE) {
+ n = n.getNextSibling();
+ }
+ if (n.getLocalName().equals(sayHi.getLocalPart())) {
+ response = sayHiResponse;
+ } else if (n.getLocalName().equals(greetMe.getLocalPart())) {
+ response = greetMeResponse;
+ }
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ return response;
+ }
+}
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageDocProvider.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageDocProvider.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java?view=diff&rev=441171&r1=441170&r2=441171
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java Thu Sep 7 11:32:57 2006
@@ -1,81 +1,81 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.cxf.systest.provider;
-import java.io.InputStream;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.ws.Provider;
-import javax.xml.ws.Service;
-import javax.xml.ws.ServiceMode;
-import javax.xml.ws.WebServiceProvider;
-
-import org.w3c.dom.Node;
-
-//The following wsdl file is used.
-//wsdlLocation = "/trunk/testutils/src/main/resources/wsdl/hello_world_rpc_lit.wsdl"
-@WebServiceProvider(portName = "SoapPortRPCLit", serviceName = "SOAPServiceRPCLit",
- targetNamespace = "http://apache.org/hello_world_rpclit",
- wsdlLocation = "/wsdl/hello_world_rpc_lit.wsdl")
-@ServiceMode(value = Service.Mode.MESSAGE)
-public class HWSoapMessageProvider implements Provider<SOAPMessage> {
-
- private static QName sayHi = new QName("http://apache.org/hello_world_rpclit", "sayHi");
- private static QName greetMe = new QName("http://apache.org/hello_world_rpclit", "greetMe");
- private SOAPMessage sayHiResponse;
- private SOAPMessage greetMeResponse;
-
- public HWSoapMessageProvider() {
-
- try {
- MessageFactory factory = MessageFactory.newInstance();
- InputStream is = getClass().getResourceAsStream("resources/sayHiRpcLiteralResp.xml");
- sayHiResponse = factory.createMessage(null, is);
- is.close();
- is = getClass().getResourceAsStream("resources/GreetMeRpcLiteralResp.xml");
- greetMeResponse = factory.createMessage(null, is);
- is.close();
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- public SOAPMessage invoke(SOAPMessage request) {
- SOAPMessage response = null;
- try {
- SOAPBody body = request.getSOAPBody();
- Node n = body.getFirstChild();
-
- while (n.getNodeType() != Node.ELEMENT_NODE) {
- n = n.getNextSibling();
- }
- if (n.getLocalName().equals(sayHi.getLocalPart())) {
- response = sayHiResponse;
- } else if (n.getLocalName().equals(greetMe.getLocalPart())) {
- response = greetMeResponse;
- }
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- return response;
- }
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.provider;
+import java.io.InputStream;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.Provider;
+import javax.xml.ws.Service;
+import javax.xml.ws.ServiceMode;
+import javax.xml.ws.WebServiceProvider;
+
+import org.w3c.dom.Node;
+
+//The following wsdl file is used.
+//wsdlLocation = "/trunk/testutils/src/main/resources/wsdl/hello_world_rpc_lit.wsdl"
+@WebServiceProvider(portName = "SoapPortRPCLit", serviceName = "SOAPServiceRPCLit",
+ targetNamespace = "http://apache.org/hello_world_rpclit",
+ wsdlLocation = "/wsdl/hello_world_rpc_lit.wsdl")
+@ServiceMode(value = Service.Mode.MESSAGE)
+public class HWSoapMessageProvider implements Provider<SOAPMessage> {
+
+ private static QName sayHi = new QName("http://apache.org/hello_world_rpclit", "sayHi");
+ private static QName greetMe = new QName("http://apache.org/hello_world_rpclit", "greetMe");
+ private SOAPMessage sayHiResponse;
+ private SOAPMessage greetMeResponse;
+
+ public HWSoapMessageProvider() {
+
+ try {
+ MessageFactory factory = MessageFactory.newInstance();
+ InputStream is = getClass().getResourceAsStream("resources/sayHiRpcLiteralResp.xml");
+ sayHiResponse = factory.createMessage(null, is);
+ is.close();
+ is = getClass().getResourceAsStream("resources/GreetMeRpcLiteralResp.xml");
+ greetMeResponse = factory.createMessage(null, is);
+ is.close();
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ public SOAPMessage invoke(SOAPMessage request) {
+ SOAPMessage response = null;
+ try {
+ SOAPBody body = request.getSOAPBody();
+ Node n = body.getFirstChild();
+
+ while (n.getNodeType() != Node.ELEMENT_NODE) {
+ n = n.getNextSibling();
+ }
+ if (n.getLocalName().equals(sayHi.getLocalPart())) {
+ response = sayHiResponse;
+ } else if (n.getLocalName().equals(greetMe.getLocalPart())) {
+ response = greetMeResponse;
+ }
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ return response;
+ }
+}
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWSoapMessageProvider.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWStreamSourceMessageProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWStreamSourceMessageProvider.java?view=diff&rev=441171&r1=441170&r2=441171
==============================================================================
--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWStreamSourceMessageProvider.java (original)
+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWStreamSourceMessageProvider.java Thu Sep 7 11:32:57 2006
@@ -1,86 +1,86 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.cxf.systest.provider;
-
-import java.io.InputStream;
-
-import javax.xml.namespace.QName;
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.SOAPBody;
-import javax.xml.soap.SOAPMessage;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.ws.Provider;
-import javax.xml.ws.Service;
-import javax.xml.ws.ServiceMode;
-import javax.xml.ws.WebServiceProvider;
-
-import org.w3c.dom.Node;
-
-
-
-//The following wsdl file is used.
-//wsdlLocation = "/trunk/testutils/src/main/resources/wsdl/hello_world_rpc_lit.wsdl"
-@WebServiceProvider(portName = "SoapPortRPCLit4", serviceName = "SOAPServiceRPCLit4",
- targetNamespace = "http://apache.org/hello_world_rpclit",
-wsdlLocation = "/wsdl/hello_world_rpc_lit.wsdl")
-@ServiceMode(value = Service.Mode.MESSAGE)
-public class HWStreamSourceMessageProvider implements Provider<StreamSource> {
-
- private static QName sayHi = new QName("http://apache.org/hello_world_rpclit", "sayHi");
- private static QName greetMe = new QName("http://apache.org/hello_world_rpclit", "greetMe");
- private InputStream sayHiInputStream;
- private InputStream greetMeInputStream;
- private MessageFactory factory;
-
- public HWStreamSourceMessageProvider() {
-
- try {
- factory = MessageFactory.newInstance();
- sayHiInputStream = getClass().getResourceAsStream("resources/sayHiRpcLiteralResp.xml");
- greetMeInputStream = getClass().getResourceAsStream("resources/GreetMeRpcLiteralResp.xml");
-
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- public StreamSource invoke(StreamSource request) {
- StreamSource response = new StreamSource();
- try {
- SOAPMessage msg = factory.createMessage();
- msg.getSOAPPart().setContent(request);
- SOAPBody body = msg.getSOAPBody();
- Node n = body.getFirstChild();
-
- while (n.getNodeType() != Node.ELEMENT_NODE) {
- n = n.getNextSibling();
- }
- if (n.getLocalName().equals(sayHi.getLocalPart())) {
- response.setInputStream(sayHiInputStream);
- } else if (n.getLocalName().equals(greetMe.getLocalPart())) {
- response.setInputStream(greetMeInputStream);
- }
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- return response;
- }
-
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.provider;
+
+import java.io.InputStream;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.Provider;
+import javax.xml.ws.Service;
+import javax.xml.ws.ServiceMode;
+import javax.xml.ws.WebServiceProvider;
+
+import org.w3c.dom.Node;
+
+
+
+//The following wsdl file is used.
+//wsdlLocation = "/trunk/testutils/src/main/resources/wsdl/hello_world_rpc_lit.wsdl"
+@WebServiceProvider(portName = "SoapPortRPCLit4", serviceName = "SOAPServiceRPCLit4",
+ targetNamespace = "http://apache.org/hello_world_rpclit",
+wsdlLocation = "/wsdl/hello_world_rpc_lit.wsdl")
+@ServiceMode(value = Service.Mode.MESSAGE)
+public class HWStreamSourceMessageProvider implements Provider<StreamSource> {
+
+ private static QName sayHi = new QName("http://apache.org/hello_world_rpclit", "sayHi");
+ private static QName greetMe = new QName("http://apache.org/hello_world_rpclit", "greetMe");
+ private InputStream sayHiInputStream;
+ private InputStream greetMeInputStream;
+ private MessageFactory factory;
+
+ public HWStreamSourceMessageProvider() {
+
+ try {
+ factory = MessageFactory.newInstance();
+ sayHiInputStream = getClass().getResourceAsStream("resources/sayHiRpcLiteralResp.xml");
+ greetMeInputStream = getClass().getResourceAsStream("resources/GreetMeRpcLiteralResp.xml");
+
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ public StreamSource invoke(StreamSource request) {
+ StreamSource response = new StreamSource();
+ try {
+ SOAPMessage msg = factory.createMessage();
+ msg.getSOAPPart().setContent(request);
+ SOAPBody body = msg.getSOAPBody();
+ Node n = body.getFirstChild();
+
+ while (n.getNodeType() != Node.ELEMENT_NODE) {
+ n = n.getNextSibling();
+ }
+ if (n.getLocalName().equals(sayHi.getLocalPart())) {
+ response.setInputStream(sayHiInputStream);
+ } else if (n.getLocalName().equals(greetMe.getLocalPart())) {
+ response.setInputStream(greetMeInputStream);
+ }
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ return response;
+ }
+
+}
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWStreamSourceMessageProvider.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/provider/HWStreamSourceMessageProvider.java
------------------------------------------------------------------------------
svn:keywords = Rev Date