cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r492421 - in /incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor: ./ src/ src/demo/ src/demo/stream/ src/demo/stream/client/ src/demo/stream/interceptor/ src/demo/stream/server/ wsdl/
Date Thu, 04 Jan 2007 06:18:37 GMT
Author: jliu
Date: Wed Jan  3 22:18:36 2007
New Revision: 492421

URL: http://svn.apache.org/viewvc?view=rev&rev=492421
Log:
Apply patch CXF-300 on behalf of Unreal Jiang: add a stream interceptor sample

Added:
    incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/
    incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/README.txt
  (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/build.xml
  (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/client.xml
  (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/server.xml
  (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/
    incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/
    incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/
    incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/client/
    incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/client/Client.java
  (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/interceptor/
    incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/interceptor/StreamInterceptor.java
  (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/server/
    incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/server/GreeterImpl.java
  (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/server/Server.java
  (with props)
    incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/wsdl/
    incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/wsdl/hello_world.wsdl
  (with props)

Added: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/README.txt
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/README.txt?view=auto&rev=492421
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/README.txt
(added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/README.txt
Wed Jan  3 22:18:36 2007
@@ -0,0 +1,105 @@
+Stream GZIP Interceptor Demo 
+============================
+This demo shows how to develope an user interceptor and add
+the interceptor into the interceptor chain through configuration.
+
+Please review the README in the samples directory before
+continuing.
+
+Prerequisite
+------------
+
+If your environment already includes cxf-incubator.jar on the
+CLASSPATH, and the JDK and ant bin directories on the PATH
+it is not necessary to set the environment as described in
+the samples directory README.  If your environment is not
+properly configured, or if you are planning on using wsdl2java,
+javac, and java to build and run the demos, you must set the
+environment.
+
+
+Building and running the demo using ant
+---------------------------------------
+
+From the samples/streamInterceptor directory, the ant build script
+can be used to build and run the demo.
+
+Using either UNIX or Windows:
+
+  ant build
+  ant server
+  ant client
+    
+
+To remove the code generated from the WSDL file and the .class
+files, run:
+
+  ant clean
+
+Building the demo using wsdl2java and javac
+-------------------------------------------
+
+From the samples/streamInterceptor directory, first create the target
+directory build/classes and then generate code from the WSDL file.
+
+For UNIX:
+  mkdir -p build/classes
+
+  wsdl2java -d build/classes -compile ./wsdl/hello_world.wsdl
+
+For Windows:
+  mkdir build\classes
+    Must use back slashes.
+
+  wsdl2java -d build\classes -compile .\wsdl\hello_world.wsdl
+    May use either forward or back slashes.
+
+Now compile the provided client and server applications with the commands:
+
+For UNIX:  
+  
+  export CLASSPATH=$CLASSPATH:$CXF_HOME/lib/cxf-incubator.jar:./build/classes
+  javac -d build/classes src/demo/stream/interceptor/*.java
+  javac -d build/classes src/demo/stream/client/*.java
+  javac -d build/classes src/demo/stream/server/*.java
+
+For Windows:
+  set classpath=%classpath%;%CXF_HOME%\lib\cxf-incubator.jar;.\build\classes
+  javac -d build\classes src\demo\stream\interceptor\*.java
+  javac -d build\classes src\demo\stream\client\*.java
+  javac -d build\classes src\demo\stream\server\*.java
+
+
+
+Running the demo using java
+---------------------------
+
+From the samples/streamInterceptor directory run the commands, entered on a
+single command line:
+
+For UNIX (must use forward slashes):
+    java -Dcxf.config.file=server.xml
+         demo.stream.server.Server &
+
+    java -Dcxf.config.file=client.xml
+         demo.stream.client.Client ./wsdl/hello_world.wsdl
+
+The server process starts in the background.  After running the client,
+use the kill command to terminate the server process.
+
+For Windows (may use either forward or back slashes):
+  start 
+    java -Dcxf.config.file=server.xml
+         demo.stream.server.Server
+
+    java -Dcxf.config.file=client.xml
+       demo.stream.client.Client .\wsdl\hello_world.wsdl
+
+A new command windows opens for the server process.  After running the
+client, terminate the server process by issuing Ctrl-C in its command window.
+
+To remove the code generated from the WSDL file and the .class
+files, either delete the build directory and its contents or run:
+
+  ant clean
+

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/README.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/README.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/build.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/build.xml?view=auto&rev=492421
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/build.xml
(added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/build.xml
Wed Jan  3 22:18:36 2007
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<!--
+  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.
+-->
+<project name="StreamHandle Interceptor demo" default="build" basedir=".">
+
+  <import file="../common_build.xml"/>
+
+  <path id="other.classpath">
+
+  </path>
+
+  <target name="client" description="run demo client" depends="build">
+    <cxfrun classname="demo.stream.client.Client"
+	    param1="${basedir}/wsdl/hello_world.wsdl"
+	    jvmarg1="-Dcxf.config.file=client.xml"/>
+  </target>
+
+  <target name="server" description="run demo server" depends="build">
+    <cxfrun classname="demo.stream.server.Server"
+	    param1="${basedir}/wsdl/hello_world.wsdl"
+	    jvmarg1="-Dcxf.config.file=server.xml"/>
+  </target>
+
+  <target name="server1" description="run demo server" depends="build">
+    <cxfrun classname="demo.stream.server.Server"
+	    param1="${basedir}/wsdl/hello_world.wsdl"/>
+  </target>
+
+  <target name="generate.code">
+    <echo level="info" message="Generating code using wsdl2java..."/>
+    <wsdl2java file="hello_world.wsdl"/>
+  </target>
+</project>

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/build.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/build.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/client.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/client.xml?view=auto&rev=492421
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/client.xml
(added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/client.xml
Wed Jan  3 22:18:36 2007
@@ -0,0 +1,56 @@
+<?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.
+-->
+
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"
+       xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+  
+    <bean name="{http://apache.org/hello_world_soap_http}SoapPort.http-conduit" abstract="true">
    
+        <property name="client">
+            <value>
+                <http-conf:client DecoupledEndpoint="http://localhost:9999/decoupled_endpoint"/>
+            </value>
+        </property>
+    </bean>
+    <bean id="GZIPStream" class="demo.stream.interceptor.StreamInterceptor"/>
+
+    <!-- We are adding the interceptors to the bus as we will have only one endpoint/service/bus.
-->
+
+    <bean id="cxf" class="org.apache.cxf.bus.spring.SpringBusImpl">
+        <property name="inInterceptors">
+            <list>
+                <ref bean="GZIPStream"/>
+            </list>
+        </property>
+        <!--property name="outInterceptors">
+            <list>
+                <ref bean="GZIPStream"/>
+            </list>
+        </property>
+        <property name="outFaultInterceptors">
+            <list>
+                <ref bean="GZIPStream"/>
+            </list>
+        </property-->
+    </bean> 
+
+</beans>

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/client.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/client.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/client.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/server.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/server.xml?view=auto&rev=492421
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/server.xml
(added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/server.xml
Wed Jan  3 22:18:36 2007
@@ -0,0 +1,51 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+  
+    <bean id="GZIPStream" class="demo.stream.interceptor.StreamInterceptor"/>
+
+    <!-- We are adding the interceptors to the bus as we will have only one endpoint/service/bus.
-->
+
+    <bean id="cxf" class="org.apache.cxf.bus.spring.SpringBusImpl">
+        <!--property name="inInterceptors">
+            <list>
+                <ref bean="GZIPStream"/>
+            </list>
+        </property>
+        <property name="inFaultInterceptors">
+            <list>
+                <ref bean="GZIPStream"/>
+            </list>
+        </property-->
+        <property name="outInterceptors">
+            <list>
+                <ref bean="GZIPStream"/>
+            </list>
+        </property>
+        <!--property name="outFaultInterceptors">
+            <list>
+                <ref bean="GZIPStream"/>
+            </list>
+        </property-->
+    </bean> 
+</beans>

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/server.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/server.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/server.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/client/Client.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/client/Client.java?view=auto&rev=492421
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/client/Client.java
(added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/client/Client.java
Wed Jan  3 22:18:36 2007
@@ -0,0 +1,68 @@
+/**
+ * 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 demo.stream.client;
+
+import java.io.File;
+import java.net.URL;
+import javax.xml.namespace.QName;
+//import javax.xml.ws.ProtocolException;
+import org.apache.hello_world_soap_http.Greeter;
+//import org.apache.hello_world_soap_http.PingMeFault;
+import org.apache.hello_world_soap_http.SOAPService;
+//import org.apache.hello_world_soap_http.types.FaultDetail;
+
+public final class Client {
+
+    private static final QName SERVICE_NAME 
+        = new QName("http://apache.org/hello_world_soap_http", "SOAPService");
+
+
+    private Client() {
+    } 
+
+    public static void main(String args[]) throws Exception {
+        
+        if (args.length == 0) { 
+            System.out.println("please specify wsdl");
+            System.exit(1); 
+        }
+
+        URL wsdlURL;
+        File wsdlFile = new File(args[0]);
+        if (wsdlFile.exists()) {
+            wsdlURL = wsdlFile.toURL();
+        } else {
+            wsdlURL = new URL(args[0]);
+        }
+        
+        System.out.println(wsdlURL);
+        SOAPService ss = new SOAPService(wsdlURL, SERVICE_NAME);
+        Greeter port = ss.getSoapPort();
+        String resp; 
+
+        System.out.println("Invoking sayHi...");
+        resp = port.sayHi();
+        System.out.println("Server responded with: " + resp);
+        System.out.println();
+      
+        System.exit(0); 
+    }
+
+}

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/client/Client.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/client/Client.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/interceptor/StreamInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/interceptor/StreamInterceptor.java?view=auto&rev=492421
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/interceptor/StreamInterceptor.java
(added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/interceptor/StreamInterceptor.java
Wed Jan  3 22:18:36 2007
@@ -0,0 +1,101 @@
+/**
+ * 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 demo.stream.interceptor;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.zip.GZIPInputStream;
+import java.util.zip.GZIPOutputStream;
+
+import org.apache.cxf.binding.soap.interceptor.SoapPreProtocolOutInterceptor;
+import org.apache.cxf.io.AbstractCachedOutputStream;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+
+public class StreamInterceptor extends AbstractPhaseInterceptor<Message> {
+
+    public StreamInterceptor() {
+        super();
+        setPhase(Phase.PRE_STREAM);
+        addBefore(SoapPreProtocolOutInterceptor.class.getName());
+    }
+    
+    public void handleMessage(Message message) {
+        //TODO
+
+        boolean isOutbound = false;
+        isOutbound = message == message.getExchange().getOutMessage()
+               || message == message.getExchange().getOutFaultMessage();
+
+        if (isOutbound) {
+            OutputStream os = message.getContent(OutputStream.class);
+            CachedStream cs = new CachedStream();
+            message.setContent(OutputStream.class, cs);
+            
+            message.getInterceptorChain().doInterceptInSubChain(message);
+
+            try {
+                cs.flush();
+                AbstractCachedOutputStream csnew = (AbstractCachedOutputStream) message
+                    .getContent(OutputStream.class);
+                GZIPOutputStream zipOutput = new GZIPOutputStream(os);
+                AbstractCachedOutputStream.copyStream(csnew.getInputStream(), zipOutput,
1024);
+
+                cs.close();
+                zipOutput.close();
+                os.flush();
+
+                message.setContent(OutputStream.class, os);
+            } catch (IOException ioe) {
+                ioe.printStackTrace();
+            }
+        } else {
+            try {
+                InputStream is = message.getContent(InputStream.class);
+                GZIPInputStream zipInput = new GZIPInputStream(is);
+                message.setContent(InputStream.class, zipInput);
+            } catch (IOException ioe) {
+                ioe.printStackTrace();
+            }
+        }
+    }
+
+    public void handleFault(Message message) {
+    }
+    
+
+    private class CachedStream extends AbstractCachedOutputStream {
+        public CachedStream() {
+            super();
+        }
+        
+        protected void doFlush() throws IOException {
+            currentStream.flush();
+        }
+
+        protected void doClose() throws IOException {
+        }
+        
+        protected void onWrite() throws IOException {
+        }
+    }
+}

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/interceptor/StreamInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/interceptor/StreamInterceptor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/server/GreeterImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/server/GreeterImpl.java?view=auto&rev=492421
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/server/GreeterImpl.java
(added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/server/GreeterImpl.java
Wed Jan  3 22:18:36 2007
@@ -0,0 +1,74 @@
+/**
+ * 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 demo.stream.server;
+
+import java.util.logging.Logger;
+import org.apache.hello_world_soap_http.Greeter;
+import org.apache.hello_world_soap_http.PingMeFault;
+import org.apache.hello_world_soap_http.types.FaultDetail;
+
+@javax.jws.WebService(portName = "SoapPort", serviceName = "SOAPService", 
+                      targetNamespace = "http://apache.org/hello_world_soap_http", 
+                      endpointInterface = "org.apache.hello_world_soap_http.Greeter")
+                  
+public class GreeterImpl implements Greeter {
+
+    private static final Logger LOG = 
+        Logger.getLogger(GreeterImpl.class.getPackage().getName());
+    
+    /* (non-Javadoc)
+     * @see org.apache.hello_world_soap_http.Greeter#greetMe(java.lang.String)
+     */
+    public String greetMe(String me) {
+        LOG.info("Executing operation greetMe");
+        System.out.println("Executing operation greetMe");
+        System.out.println("Message received: " + me + "\n");
+        return "Hello " + me;
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.hello_world_soap_http.Greeter#greetMeOneWay(java.lang.String)
+     */
+    public void greetMeOneWay(String me) {
+        LOG.info("Executing operation greetMeOneWay");
+        System.out.println("Executing operation greetMeOneWay\n");
+        System.out.println("Hello there " + me);
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.hello_world_soap_http.Greeter#sayHi()
+     */
+    public String sayHi() {
+        LOG.info("Executing operation sayHi");
+        System.out.println("Executing operation sayHi\n");
+        return "Bonjour";
+    }
+    
+    public void pingMe() throws PingMeFault {
+        FaultDetail faultDetail = new FaultDetail();
+        faultDetail.setMajor((short)2);
+        faultDetail.setMinor((short)1);
+        LOG.info("Executing operation pingMe, throwing PingMeFault exception");
+        System.out.println("Executing operation pingMe, throwing PingMeFault exception\n");
+        throw new PingMeFault("PingMeFault raised by server", faultDetail);
+    }
+
+    
+}

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/server/GreeterImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/server/GreeterImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/server/Server.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/server/Server.java?view=auto&rev=492421
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/server/Server.java
(added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/server/Server.java
Wed Jan  3 22:18:36 2007
@@ -0,0 +1,42 @@
+/**
+ * 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 demo.stream.server;
+
+import javax.xml.ws.Endpoint;
+
+public class Server {
+
+    protected Server() throws Exception {
+        System.out.println("Starting Server");
+
+        Object implementor = new GreeterImpl();
+        String address = "http://localhost:9000/SoapContext/SoapPort";
+        Endpoint.publish(address, implementor);
+    }
+
+    public static void main(String args[]) throws Exception {
+        new Server();
+        System.out.println("Server ready...");
+
+        Thread.sleep(5 * 60 * 1000);
+        System.out.println("Server exiting");
+        System.exit(0);
+    }
+}

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/server/Server.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/src/demo/stream/server/Server.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/wsdl/hello_world.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/wsdl/hello_world.wsdl?view=auto&rev=492421
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/wsdl/hello_world.wsdl
(added)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/wsdl/hello_world.wsdl
Wed Jan  3 22:18:36 2007
@@ -0,0 +1,181 @@
+<?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.
+-->
+<wsdl:definitions name="HelloWorld" targetNamespace="http://apache.org/hello_world_soap_http"

+    xmlns="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
+    xmlns:tns="http://apache.org/hello_world_soap_http"
+    xmlns:x1="http://apache.org/hello_world_soap_http/types"
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+    <wsdl:types>
+        <schema targetNamespace="http://apache.org/hello_world_soap_http/types" 
+            xmlns="http://www.w3.org/2001/XMLSchema"
+	    xmlns:tns="http://apache.org/hello_world_soap_http/types"
+            elementFormDefault="qualified">
+	    <simpleType name="MyStringType">
+		<restriction base="string">
+		    <maxLength value="30" />
+		</restriction>
+	    </simpleType>
+
+            <element name="sayHi">
+                <complexType/>
+            </element>
+            <element name="sayHiResponse">
+                <complexType>
+                    <sequence>
+                        <element name="responseType" type="string"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="greetMe">
+                <complexType>
+                    <sequence>
+                        <element name="requestType" type="tns:MyStringType"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="greetMeResponse">
+                <complexType>
+                    <sequence>
+                        <element name="responseType" type="string"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="greetMeOneWay">
+                <complexType>
+                    <sequence>
+                        <element name="requestType" type="string"/>
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="pingMe">
+                <complexType/>
+            </element>
+            <element name="pingMeResponse">
+                <complexType/>
+            </element>
+            <element name="faultDetail">
+                <complexType>
+                    <sequence>
+                        <element name="minor" type="short"/>
+                        <element name="major" type="short"/>
+                    </sequence>
+                </complexType>
+            </element>
+        </schema>
+    </wsdl:types>
+    <wsdl:message name="sayHiRequest">
+        <wsdl:part element="x1:sayHi" name="in"/>
+    </wsdl:message>
+    <wsdl:message name="sayHiResponse">
+        <wsdl:part element="x1:sayHiResponse" name="out"/>
+    </wsdl:message>
+    <wsdl:message name="greetMeRequest">
+        <wsdl:part element="x1:greetMe" name="in"/>
+    </wsdl:message>
+    <wsdl:message name="greetMeResponse">
+        <wsdl:part element="x1:greetMeResponse" name="out"/>
+    </wsdl:message>
+    <wsdl:message name="greetMeOneWayRequest">
+        <wsdl:part element="x1:greetMeOneWay" name="in"/>
+    </wsdl:message>
+    <wsdl:message name="pingMeRequest">
+        <wsdl:part name="in" element="x1:pingMe"/>
+    </wsdl:message>
+    <wsdl:message name="pingMeResponse">
+        <wsdl:part name="out" element="x1:pingMeResponse"/>
+    </wsdl:message>		
+    <wsdl:message name="pingMeFault">
+        <wsdl:part name="faultDetail" element="x1:faultDetail"/>
+    </wsdl:message>
+    
+    <wsdl:portType name="Greeter">
+        <wsdl:operation name="sayHi">
+            <wsdl:input message="tns:sayHiRequest" name="sayHiRequest"/>
+            <wsdl:output message="tns:sayHiResponse" name="sayHiResponse"/>
+        </wsdl:operation>
+        
+        <wsdl:operation name="greetMe">
+            <wsdl:input message="tns:greetMeRequest" name="greetMeRequest"/>
+            <wsdl:output message="tns:greetMeResponse" name="greetMeResponse"/>
+        </wsdl:operation>
+        
+        <wsdl:operation name="greetMeOneWay">
+            <wsdl:input message="tns:greetMeOneWayRequest" name="greetMeOneWayRequest"/>
+        </wsdl:operation>
+
+        <wsdl:operation name="pingMe">
+            <wsdl:input name="pingMeRequest" message="tns:pingMeRequest"/>
+            <wsdl:output name="pingMeResponse" message="tns:pingMeResponse"/>
+            <wsdl:fault name="pingMeFault" message="tns:pingMeFault"/>
+        </wsdl:operation> 
+    </wsdl:portType>
+    <wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        
+        <wsdl:operation name="sayHi">
+            <soap:operation soapAction="" style="document"/>
+            <wsdl:input name="sayHiRequest">
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output name="sayHiResponse">
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        
+        <wsdl:operation name="greetMe">
+            <soap:operation soapAction="" style="document"/>
+            <wsdl:input name="greetMeRequest">
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output name="greetMeResponse">
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        
+        <wsdl:operation name="greetMeOneWay">
+            <soap:operation soapAction="" style="document"/>
+            <wsdl:input name="greetMeOneWayRequest">
+                <soap:body use="literal"/>
+            </wsdl:input>
+        </wsdl:operation>
+
+        <wsdl:operation name="pingMe">
+            <soap:operation style="document"/>
+            <wsdl:input>
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal"/>
+            </wsdl:output>
+            <wsdl:fault name="pingMeFault">
+                <soap:fault name="pingMeFault" use="literal"/>
+            </wsdl:fault>
+        </wsdl:operation>
+        
+    </wsdl:binding>
+    <wsdl:service name="SOAPService">
+        <wsdl:port binding="tns:Greeter_SOAPBinding" name="SoapPort">
+            <soap:address location="http://localhost:9000/SoapContext/SoapPort"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>
+

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/wsdl/hello_world.wsdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/wsdl/hello_world.wsdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/distribution/src/main/release/samples/streamInterceptor/wsdl/hello_world.wsdl
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message