cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: svn commit: r531412 - in /incubator/cxf/trunk/distribution/src/main/release/samples/colocated: ./ src/ src/demo/ src/demo/colocated/ src/demo/colocated/client/ src/demo/colocated/common/ src/demo/colocated/server/ wsdl/
Date Mon, 23 Apr 2007 14:21:35 GMT

Ajay,

Just FYI:   I'm not going to completely -1 this commit, but I AM going to
exclude this demo from the release we're trying to cut today (if Dan and
I can get the servlet stuff working).

My reasons are:

1) I'm uncomfortable with the last minute addition that no-one else has
had time to look at.

2) The coloc discussion is still going kind of going on.   Due to trying
to get the release ready and tck stuff, I haven't even had time to read
most of the thread.   Thus, the coloc stuff is completely subject to
change and I'd prefer users not assuming that since there is a sample,
that's how it will work.   The exception would be if point #3 below is 
taken care of which would hide much of this.

3) I DON'T like the way the demo is configured.   To me, the coloc stuff
is a policy/feature and should be configured that way.   The fact that it
involves handlers and stuff is an implementation detail that the user
should not know about.    (Yes, other things like RM, security, and such
should be changed over to the same thing.   But they were implemented 
and added to the codebase before we had the policy/feature stuff 
working.)   Likewise, if it used the OB/LT stuff, that is also an 
implementation detail that the user shouldn't care about.

Dan
 

On Monday 23 April 2007 06:21, ajaypaibir@apache.org wrote:
> Author: ajaypaibir
> Date: Mon Apr 23 03:20:58 2007
> New Revision: 531412
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=531412
> Log:
> Adding colocated demo.
>
> Added:
>    
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/RE
>ADME.txt   (with props)
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/bu
>ild.xml   (with props)
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/co
>loc.xml   (with props)
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/lo
>gging.properties   (with props)
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/client/
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/client/Client.java   (with props)
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/common/
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/common/ThrowFaultInterceptor.java   (with props)
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/server/
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/server/GreeterImpl.java   (with props)
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/server/Server.java   (with props)
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/ws
>dl/
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/ws
>dl/hello_world.wsdl   (with props)
>
> Added:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/RE
>ADME.txt URL:
> http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main
>/release/samples/colocated/README.txt?view=auto&rev=531412
> ======================================================================
>======== ---
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/RE
>ADME.txt (added) +++
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/RE
>ADME.txt Mon Apr 23 03:20:58 2007 @@ -0,0 +1,94 @@
> +Colocated Demo using Document/Literal Style
> +=============================================
> +
> +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/colocated directory, the ant build script
> +can be used to build and run the demo.
> +
> +Using either UNIX or Windows:
> +
> +  ant build
> +  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/colocated 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/colocated/server/*.java
> +  javac -d build/classes src/demo/colocated/client/*.java
> +
> +For Windows:
> +  set
> classpath=%classpath%;%CXF_HOME%\lib\cxf-incubator.jar;.\build\classes
> +  javac -d build\classes src\demo\colocated\server\*.java
> +  javac -d build\classes src\demo\colocated\client\*.java
> +
> +
> +
> +Running the demo using java
> +---------------------------
> +
> +From the samples/colocated directory run the commands, entered on a
> +single command line:
> +
> +For UNIX (must use forward slashes):
> +    java
> -Djava.util.logging.config.file=$CXF_HOME/etc/logging.properties +    
>     -Dcxf.config.file=./coloc.xml
> +         demo.colocated.client.Client ./wsdl/hello_world.wsdl
> +
> +For Windows (may use either forward or back slashes):
> +  start
> +    java
> -Djava.util.logging.config.file=%CXF_HOME%\etc\logging.properties +   
>      -Dcxf.config.file=.\coloc.xml
> +         demo.colocated.client.Client .\wsdl\hello_world.wsdl
> +
> +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/colocated/RE
>ADME.txt
> ----------------------------------------------------------------------
>-------- svn:eol-style = native
>
> Propchange:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/RE
>ADME.txt
> ----------------------------------------------------------------------
>-------- svn:mime-type = text/plain
>
> Added:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/bu
>ild.xml URL:
> http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main
>/release/samples/colocated/build.xml?view=auto&rev=531412
> ======================================================================
>======== ---
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/bu
>ild.xml (added) +++
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/bu
>ild.xml Mon Apr 23 03:20:58 2007 @@ -0,0 +1,36 @@
> +<?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.
> +-->
> +<project name="hello world demo" default="build" basedir=".">
> +
> +    <import file="../common_build.xml"/>
> +
> +    <target name="client" description="run demo client"
> depends="build"> +        <cxfrun
> classname="demo.colocated.client.Client"
> +            param1="${basedir}/wsdl/hello_world.wsdl"
> +            jvmarg1="-Dcxf.config.file=coloc.xml"
> +            logging-properties-file="./logging.properties"/>
> +    </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/colocated/bu
>ild.xml
> ----------------------------------------------------------------------
>-------- svn:eol-style = native
>
> Propchange:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/bu
>ild.xml
> ----------------------------------------------------------------------
>-------- svn:keywords = Rev Date
>
> Propchange:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/bu
>ild.xml
> ----------------------------------------------------------------------
>-------- svn:mime-type = text/xml
>
> Added:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/co
>loc.xml URL:
> http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main
>/release/samples/colocated/coloc.xml?view=auto&rev=531412
> ======================================================================
>======== ---
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/co
>loc.xml (added) +++
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/co
>loc.xml Mon Apr 23 03:20:58 2007 @@ -0,0 +1,69 @@
> +<?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="http://cxf.apache.org/transports/http/configuration" +    
>   xmlns:jaxws="http://cxf.apache.org/jaxws"
> +      
> xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd"> +
> +
> +    <!--Coloc Interceptors-->
> +    <bean id="colocInbound"
> class="org.apache.cxf.binding.coloc.ColocInInterceptor"/> +    <bean
> id="colocOutbound"
> class="org.apache.cxf.binding.coloc.ColocOutInterceptor"/> +    <bean
> id="faultOutbound"
> class="demo.colocated.common.ThrowFaultInterceptor"/> +
> +    <!--Message Logging Interceptors-->
> +    <bean id="logInbound"
> class="org.apache.cxf.interceptor.LoggingInInterceptor"/> +    <bean
> id="logOutbound"
> class="org.apache.cxf.interceptor.LoggingOutInterceptor"/> +
> +    <bean id="cxf" class="org.apache.cxf.bus.CXFBusImpl">
> +        <property name="inInterceptors">
> +            <list>
> +                <ref bean="colocInbound"/>
> +                <ref bean="logInbound"/>
> +            </list>
> +        </property>
> +        <property name="inFaultInterceptors">
> +            <list>
> +                <ref bean="logInbound"/>
> +            </list>
> +        </property>
> +        <property name="outInterceptors">
> +            <list>
> +                <ref bean="colocOutbound"/>
> +                <ref bean="faultOutbound"/>
> +                <ref bean="logOutbound"/>
> +            </list>
> +        </property>
> +        <property name="outFaultInterceptors">
> +            <list>
> +                <ref bean="logOutbound"/>
> +            </list>
> +        </property>
> +    </bean>
> +    <!-- Avoid upfront Conduit creation, as client-side transport
> resources +         are not required in the coloc case -->
> +    <jaxws:client
> id="{http://apache.org/hello_world_soap_http}SoapPort" +              
>    abstract="true">
> +        <jaxws:conduitSelector>
> +            <bean
> class="org.apache.cxf.endpoint.DeferredConduitSelector"/> +       
> </jaxws:conduitSelector>
> +    </jaxws:client>
> +</beans>
>
> Propchange:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/co
>loc.xml
> ----------------------------------------------------------------------
>-------- svn:eol-style = native
>
> Propchange:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/co
>loc.xml
> ----------------------------------------------------------------------
>-------- svn:keywords = Rev Date
>
> Propchange:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/co
>loc.xml
> ----------------------------------------------------------------------
>-------- svn:mime-type = text/xml
>
> Added:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/lo
>gging.properties URL:
> http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main
>/release/samples/colocated/logging.properties?view=auto&rev=531412
> ======================================================================
>======== ---
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/lo
>gging.properties (added) +++
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/lo
>gging.properties Mon Apr 23 03:20:58 2007 @@ -0,0 +1,77 @@
> +#    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.
> +
> +############################################################
> +#  	Default Logging Configuration File
> +#
> +# You can use a different file by specifying a filename
> +# with the java.util.logging.config.file system property.
> +# For example java -Djava.util.logging.config.file=myfile
> +############################################################
> +
> +############################################################
> +#  	Global properties
> +############################################################
> +
> +# "handlers" specifies a comma separated list of log Handler
> +# classes.  These handlers will be installed during VM startup.
> +# Note that these classes must be on the system classpath.
> +# By default we only configure a ConsoleHandler, which will only
> +# show messages at the WARNING and above levels.
> +handlers= java.util.logging.ConsoleHandler
> +
> +# To also add the FileHandler, use the following line instead.
> +#handlers= java.util.logging.FileHandler,
> java.util.logging.ConsoleHandler +
> +# Default global logging level.
> +# This specifies which kinds of events are logged across
> +# all loggers.  For any given facility this global level
> +# can be overriden by a facility specific level
> +# Note that the ConsoleHandler also has a separate level
> +# setting to limit messages printed to the console.
> +.level= WARNING
> +
> +############################################################
> +# Handler specific properties.
> +# Describes specific configuration info for Handlers.
> +############################################################
> +
> +# default file output is in user's home directory.
> +java.util.logging.FileHandler.pattern = colocated.log
> +java.util.logging.FileHandler.limit = 50000
> +java.util.logging.FileHandler.count = 1
> +java.util.logging.FileHandler.formatter =
> java.util.logging.XMLFormatter +
> +# Limit the message that are printed on the console to WARNING and
> above. +java.util.logging.ConsoleHandler.level = INFO
> +java.util.logging.ConsoleHandler.formatter =
> java.util.logging.SimpleFormatter +
> +
> +############################################################
> +# Facility specific properties.
> +# Provides extra control for each logger.
> +############################################################
> +
> +# For example, set the com.xyz.foo logger to only log SEVERE
> +# messages:
> +#com.xyz.foo.level = SEVERE
> +
> +# Set log levels so that we can ob server the exchange of RM protocol
> messgaes +# and the retransmission of application messages
> +org.apache.cxf.configuration.spring.level = SEVERE
> +org.apache.cxf.interceptor.LoggingInInterceptor.level=INFO
> +org.apache.cxf.interceptor.LoggingOutInterceptor.level=INFO
>
> Propchange:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/lo
>gging.properties
> ----------------------------------------------------------------------
>-------- svn:eol-style = native
>
> Propchange:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/lo
>gging.properties
> ----------------------------------------------------------------------
>-------- svn:keywords = Rev Date
>
> Propchange:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/lo
>gging.properties
> ----------------------------------------------------------------------
>-------- svn:mime-type = text/plain
>
> Added:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/client/Client.java URL:
> http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main
>/release/samples/colocated/src/demo/colocated/client/Client.java?view=a
>uto&rev=531412
> ======================================================================
>======== ---
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/client/Client.java (added) +++
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/client/Client.java Mon Apr 23 03:20:58 2007 @@ -0,0
> +1,84 @@
> +/**
> + * 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.colocated.client;
> +
> +import java.io.File;
> +import java.net.URL;
> +import javax.xml.namespace.QName;
> +import demo.colocated.server.Server;
> +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);
> +        }
> +
> +        Server.main(new String[]{"inProcess"});
> +
> +        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.out.println("Invoking greetMe...");
> +        resp = port.greetMe(System.getProperty("user.name"));
> +        System.out.println("Server responded with: " + resp);
> +        System.out.println();
> +
> +        try {
> +            System.out.println("Invoking pingMe, expecting
> exception..."); +            port.pingMe();
> +        } catch (PingMeFault ex) {
> +            System.out.println("Expected exception: PingMeFault has
> occurred: " + ex.getMessage()); +            FaultDetail detail =
> ex.getFaultInfo();
> +            System.out.println("FaultDetail major:" +
> detail.getMajor()); +            System.out.println("FaultDetail
> minor:" + detail.getMinor()); +        }
> +        System.exit(0);
> +    }
> +
> +}
>
> Propchange:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/client/Client.java
> ----------------------------------------------------------------------
>-------- svn:eol-style = native
>
> Propchange:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/client/Client.java
> ----------------------------------------------------------------------
>-------- svn:keywords = Rev Date
>
> Added:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/common/ThrowFaultInterceptor.java URL:
> http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main
>/release/samples/colocated/src/demo/colocated/common/ThrowFaultIntercep
>tor.java?view=auto&rev=531412
> ======================================================================
>======== ---
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/common/ThrowFaultInterceptor.java (added) +++
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/common/ThrowFaultInterceptor.java Mon Apr 23 03:20:58
> 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.colocated.common;
> +
> +import javax.xml.ws.ProtocolException;
> +
> +import org.apache.cxf.interceptor.Fault;
> +import org.apache.cxf.message.Message;
> +import org.apache.cxf.phase.AbstractPhaseInterceptor;
> +import org.apache.cxf.phase.Phase;
> +
> +public class ThrowFaultInterceptor extends
> AbstractPhaseInterceptor<Message> { +    public
> ThrowFaultInterceptor() {
> +        super();
> +        setPhase(Phase.PREPARE_SEND);
> +    }
> +
> +    public void handleMessage(Message message) throws Fault {
> +        Boolean isColoc =
> (Boolean)message.get("org.apache.cxf.message.Message.COLOCATED"); +   
>     if (isColoc == null || isColoc == Boolean.FALSE) {
> +            String str = new String("Collocated Invocation should
> have been detected."); +            throw new ProtocolException(str);
> +        }
> +    }
> +}
>
> Propchange:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/common/ThrowFaultInterceptor.java
> ----------------------------------------------------------------------
>-------- svn:eol-style = native
>
> Propchange:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/common/ThrowFaultInterceptor.java
> ----------------------------------------------------------------------
>-------- svn:keywords = Rev Date
>
> Added:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/server/GreeterImpl.java URL:
> http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main
>/release/samples/colocated/src/demo/colocated/server/GreeterImpl.java?v
>iew=auto&rev=531412
> ======================================================================
>======== ---
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/server/GreeterImpl.java (added) +++
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/server/GreeterImpl.java Mon Apr 23 03:20:58 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.colocated.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.Strin
>g) +     */
> +    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/colocated/sr
>c/demo/colocated/server/GreeterImpl.java
> ----------------------------------------------------------------------
>-------- svn:eol-style = native
>
> Propchange:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/server/GreeterImpl.java
> ----------------------------------------------------------------------
>-------- svn:keywords = Rev Date
>
> Added:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/server/Server.java URL:
> http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main
>/release/samples/colocated/src/demo/colocated/server/Server.java?view=a
>uto&rev=531412
> ======================================================================
>======== ---
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/server/Server.java (added) +++
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/server/Server.java Mon Apr 23 03:20:58 2007 @@ -0,0
> +1,44 @@
> +/**
> + * 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.colocated.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...");
> +
> +        if (!"inProcess".equals(args[0])) {
> +            Thread.sleep(5 * 60 * 1000);
> +            System.out.println("Server exiting");
> +            System.exit(0);
> +        }
> +    }
> +}
>
> Propchange:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/server/Server.java
> ----------------------------------------------------------------------
>-------- svn:eol-style = native
>
> Propchange:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/sr
>c/demo/colocated/server/Server.java
> ----------------------------------------------------------------------
>-------- svn:keywords = Rev Date
>
> Added:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/ws
>dl/hello_world.wsdl URL:
> http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main
>/release/samples/colocated/wsdl/hello_world.wsdl?view=auto&rev=531412
> ======================================================================
>======== ---
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/ws
>dl/hello_world.wsdl (added) +++
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/ws
>dl/hello_world.wsdl Mon Apr 23 03:20:58 2007 @@ -0,0 +1,175 @@
> +<?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">
> +            <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="string"/>
> +                    </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/colocated/ws
>dl/hello_world.wsdl
> ----------------------------------------------------------------------
>-------- svn:eol-style = native
>
> Propchange:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/ws
>dl/hello_world.wsdl
> ----------------------------------------------------------------------
>-------- svn:keywords = Rev Date
>
> Propchange:
> incubator/cxf/trunk/distribution/src/main/release/samples/colocated/ws
>dl/hello_world.wsdl
> ----------------------------------------------------------------------
>-------- svn:mime-type = text/xml

-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

Mime
View raw message