cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1536875 - in /cxf/branches/2.7.x-fixes/distribution/src/main/release/samples/jaxws_dispatch_provider: pom.xml src/main/java/demo/hwDispatch/client/Client.java src/main/java/demo/hwDispatch/server/Server.java
Date Tue, 29 Oct 2013 20:02:20 GMT
Author: dkulp
Date: Tue Oct 29 20:02:20 2013
New Revision: 1536875

URL: http://svn.apache.org/r1536875
Log:
Accidentally committed this

Modified:
    cxf/branches/2.7.x-fixes/distribution/src/main/release/samples/jaxws_dispatch_provider/pom.xml
    cxf/branches/2.7.x-fixes/distribution/src/main/release/samples/jaxws_dispatch_provider/src/main/java/demo/hwDispatch/client/Client.java
    cxf/branches/2.7.x-fixes/distribution/src/main/release/samples/jaxws_dispatch_provider/src/main/java/demo/hwDispatch/server/Server.java

Modified: cxf/branches/2.7.x-fixes/distribution/src/main/release/samples/jaxws_dispatch_provider/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/distribution/src/main/release/samples/jaxws_dispatch_provider/pom.xml?rev=1536875&r1=1536874&r2=1536875&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/distribution/src/main/release/samples/jaxws_dispatch_provider/pom.xml
(original)
+++ cxf/branches/2.7.x-fixes/distribution/src/main/release/samples/jaxws_dispatch_provider/pom.xml
Tue Oct 29 20:02:20 2013
@@ -31,9 +31,7 @@
     </parent>
     <properties>
         <cxf.version>${project.version}</cxf.version>
-        <wsdl.file>${basedir}/src/main/resources/NewWSDLFile.wsdl</wsdl.file>
-        <wsdl.spring.file>${basedir}/src/main/resources/NewWSDLFileSpring.wsdl</wsdl.spring.file>
-        <cxf.xjc-utils.version>2.6.0</cxf.xjc-utils.version>
+        <wsdl.file>${basedir}/src/main/resources/hello_world.wsdl</wsdl.file>
     </properties>
     <build>
         <plugins>
@@ -121,64 +119,23 @@
                 </plugins>
             </build>
         </profile>
-        <profile>
-            <id>clientspring</id>
-            <build>
-                <defaultGoal>test</defaultGoal>
-                <plugins>
-                    <plugin>
-                        <groupId>org.codehaus.mojo</groupId>
-                        <artifactId>exec-maven-plugin</artifactId>
-                        <executions>
-                            <execution>
-                                <phase>test</phase>
-                                <goals>
-                                    <goal>java</goal>
-                                </goals>
-                                <configuration>
-                                    <mainClass>demo.hwDispatch.client.Client</mainClass>
-                                    <arguments>
-                                        <argument>${wsdl.spring.file}</argument>
-                                    </arguments>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
     </profiles>
     <dependencies>
         <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-frontend-jaxws</artifactId>
-            <version>${cxf.version}</version>
+            <version>2.7.8-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-transports-http</artifactId>
-            <version>${cxf.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.cxf.xjc-utils</groupId>
-            <artifactId>cxf-xjc-runtime</artifactId>
-            <version>${cxf.xjc-utils.version}</version>
+            <version>2.7.8-SNAPSHOT</version>
         </dependency>
-        <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-context-support</artifactId>
-            <version>3.2.4.RELEASE</version>
-            </dependency>
         <!-- Jetty is needed if you're using the CXFServlet -->
         <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-transports-http-jetty</artifactId>
-            <version>${cxf.version}</version>
-        </dependency>
-                <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-wstx-msv-validation</artifactId>
-            <version>${cxf.version}</version>
+            <version>2.7.8-SNAPSHOT</version>
         </dependency>
     </dependencies>
 </project>

Modified: cxf/branches/2.7.x-fixes/distribution/src/main/release/samples/jaxws_dispatch_provider/src/main/java/demo/hwDispatch/client/Client.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/distribution/src/main/release/samples/jaxws_dispatch_provider/src/main/java/demo/hwDispatch/client/Client.java?rev=1536875&r1=1536874&r2=1536875&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/distribution/src/main/release/samples/jaxws_dispatch_provider/src/main/java/demo/hwDispatch/client/Client.java
(original)
+++ cxf/branches/2.7.x-fixes/distribution/src/main/release/samples/jaxws_dispatch_provider/src/main/java/demo/hwDispatch/client/Client.java
Tue Oct 29 20:02:20 2013
@@ -33,7 +33,9 @@ import javax.xml.ws.Service.Mode;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
-import org.example.newwsdlfile.NewWSDLFile_Service;
+import org.apache.hello_world_soap_http.SOAPService1;
+import org.apache.hello_world_soap_http.SOAPService2;
+import org.apache.hello_world_soap_http.SOAPService3;
 
 public final class Client {
 
@@ -58,14 +60,14 @@ public final class Client {
         MessageFactory factory = MessageFactory.newInstance();
         System.out.println(wsdlURL + "\n\n");
 
-        QName serviceName1 = new QName("http://www.example.org/NewWSDLFile/", "NewWSDLFile");
-        QName portName1 = new QName("http://www.example.org/NewWSDLFile/", "NewWSDLFileSOAP");
+        QName serviceName1 = new QName("http://apache.org/hello_world_soap_http", "SOAPService1");
+        QName portName1 = new QName("http://apache.org/hello_world_soap_http", "SoapPort1");
 
-        NewWSDLFile_Service service1 = new NewWSDLFile_Service(wsdlURL, serviceName1);
-        InputStream is1 =  Client.class.getResourceAsStream("/NoteDocLiteralReq.xml");
+        SOAPService1 service1 = new SOAPService1(wsdlURL, serviceName1);
+        InputStream is1 =  Client.class.getResourceAsStream("/GreetMeDocLiteralReq1.xml");
         if (is1 == null) {
             System.err.println("Failed to create input stream from file "
-                               + "NoteDocLiteralReq.xml, please check");
+                               + "GreetMeDocLiteralReq1.xml, please check");
             System.exit(-1);
         }
         SOAPMessage soapReq1 = factory.createMessage(null, is1);
@@ -77,21 +79,49 @@ public final class Client {
         SOAPMessage soapResp = dispSOAPMsg.invoke(soapReq1);
         System.out.println("Response from server: " + soapResp.getSOAPBody().getTextContent());
 
-	NewWSDLFile_Service service2 = new NewWSDLFile_Service(wsdlURL, serviceName1);
-        InputStream is2 =  Client.class.getResourceAsStream("/NoteDocLiteralReq_doesnt_match_schema.xml");
+        QName serviceName2 = new QName("http://apache.org/hello_world_soap_http", "SOAPService2");
+        QName portName2 = new QName("http://apache.org/hello_world_soap_http", "SoapPort2");
+
+        SOAPService2 service2 = new SOAPService2(wsdlURL, serviceName2);
+        InputStream is2 =  Client.class.getResourceAsStream("/GreetMeDocLiteralReq2.xml");
         if (is2 == null) {
             System.err.println("Failed to create input stream from file "
-                               + "NoteDocLiteralReq_doesnt_match_schema.xml, please check");
+                               + "GreetMeDocLiteralReq2.xml, please check");
             System.exit(-1);
         }
         SOAPMessage soapReq2 = factory.createMessage(null, is2);
+        DOMSource domReqMessage = new DOMSource(soapReq2.getSOAPPart());
 
-        Dispatch<SOAPMessage> dispSOAPMsg2 = service2.createDispatch(portName1,
-                                                                    SOAPMessage.class, Mode.MESSAGE);
+        Dispatch<DOMSource> dispDOMSrcMessage = service2.createDispatch(portName2,
+                                                                        DOMSource.class,
Mode.MESSAGE);
+        System.out.println("Invoking server through Dispatch interface using DOMSource in
MESSAGE Mode");
+        DOMSource domRespMessage = dispDOMSrcMessage.invoke(domReqMessage);
+        System.out.println("Response from server: "
+                           + domRespMessage.getNode().getLastChild().getTextContent());
+
+
+        QName serviceName3 = new QName("http://apache.org/hello_world_soap_http", "SOAPService3");
+        QName portName3 = new QName("http://apache.org/hello_world_soap_http", "SoapPort3");
+
+        SOAPService3 service3 = new SOAPService3(wsdlURL, serviceName3);
+        InputStream is3 =  Client.class.getResourceAsStream("/GreetMeDocLiteralReq3.xml");
+        if (is3 == null) {
+            System.err.println("Failed to create input stream from file "
+                               + "GreetMeDocLiteralReq3.xml, please check");
+            System.exit(-1);
+        }
 
-        System.out.println("Invoking server through Dispatch interface using SOAPMessage");
-        SOAPMessage soapResp2 = dispSOAPMsg2.invoke(soapReq2);
-        System.out.println("Response from server: " + soapResp2.getSOAPBody().getTextContent());
+        SOAPMessage soapReq3 = MessageFactory.newInstance().createMessage(null, is3);
+        DOMSource domReqPayload = new DOMSource(soapReq3.getSOAPBody().extractContentAsDocument());
+
+        Dispatch<DOMSource> dispDOMSrcPayload = service3.createDispatch(portName3,
+                                                                        DOMSource.class,
Mode.PAYLOAD);
+        System.out.println("Invoking server through Dispatch interface using DOMSource in
PAYLOAD Mode");
+        DOMSource domRespPayload = dispDOMSrcPayload.invoke(domReqPayload);
+
+        System.out.println("Response from server: "
+                           + fetchElementByName(domRespPayload.getNode(), 
+                                                "greetMeResponse").getTextContent());
 
         System.exit(0);
     }

Modified: cxf/branches/2.7.x-fixes/distribution/src/main/release/samples/jaxws_dispatch_provider/src/main/java/demo/hwDispatch/server/Server.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/distribution/src/main/release/samples/jaxws_dispatch_provider/src/main/java/demo/hwDispatch/server/Server.java?rev=1536875&r1=1536874&r2=1536875&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/distribution/src/main/release/samples/jaxws_dispatch_provider/src/main/java/demo/hwDispatch/server/Server.java
(original)
+++ cxf/branches/2.7.x-fixes/distribution/src/main/release/samples/jaxws_dispatch_provider/src/main/java/demo/hwDispatch/server/Server.java
Tue Oct 29 20:02:20 2013
@@ -19,27 +19,26 @@
 
 package demo.hwDispatch.server;
 import javax.xml.ws.Endpoint;
-import org.apache.cxf.jaxws.EndpointImpl;
-import org.apache.cxf.ws.addressing.WSAddressingFeature;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 public class Server {
 
     protected Server() throws Exception {
         System.out.println("Starting Server");
 
-        System.out.println("Starting NewWSDLFile service");
-        Object implementor = new NewWSDLFileSoapMessageProvider();
-        String address = "http://localhost:9000/SoapContext/NewWSDLFileSOAP";
-        //EndpointImpl ep = (EndpointImpl)Endpoint.publish(address, implementor); 
-	//ep.getFeatures().add(new WSAddressingFeature());
-	EndpointImpl ep = (EndpointImpl)Endpoint.create(implementor);
-	ep.getProperties().put("schema-validation-enabled","true");
-	ep.publish(address);
-
-	// also start a second server using Spring
-	new ClassPathXmlApplicationContext("server-applicationContext.xml");
-        System.in.read();
+        System.out.println("Starting SoapService1");
+        Object implementor = new GreeterSoapMessageProvider();
+        String address = "http://localhost:9000/SoapContext/SoapPort1";
+        Endpoint.publish(address, implementor);
+        
+        System.out.println("Starting SoapService2");
+        implementor = new GreeterDOMSourceMessageProvider();
+        address = "http://localhost:9000/SoapContext/SoapPort2";
+        Endpoint.publish(address, implementor);
+        
+        System.out.println("Starting SoapService3");
+        implementor = new GreeterDOMSourcePayloadProvider();
+        address = "http://localhost:9000/SoapContext/SoapPort3";
+        Endpoint.publish(address, implementor);        
     }
 
     public static void main(String args[]) throws Exception {



Mime
View raw message