<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FWeb_Services_SOA%2FWS_ReliableMessaging</id>
		<title>Java/Web Services SOA/WS ReliableMessaging - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FWeb_Services_SOA%2FWS_ReliableMessaging"/>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java/Web_Services_SOA/WS_ReliableMessaging&amp;action=history"/>
		<updated>2026-04-06T04:15:53Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://jexp.ru/index.php?title=Java/Web_Services_SOA/WS_ReliableMessaging&amp;diff=9215&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java/Web_Services_SOA/WS_ReliableMessaging&amp;diff=9215&amp;oldid=prev"/>
				<updated>2010-06-01T07:27:41Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 07:27, 1 июня 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://jexp.ru/index.php?title=Java/Web_Services_SOA/WS_ReliableMessaging&amp;diff=9214&amp;oldid=prev</id>
		<title> в 18:01, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java/Web_Services_SOA/WS_ReliableMessaging&amp;diff=9214&amp;oldid=prev"/>
				<updated>2010-05-31T18:01:50Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== This demo shows how WS-ReliableMessaging support in Apache CXF may be enabled ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
WS-RM Demo&lt;br /&gt;
==========&lt;br /&gt;
This demo shows how WS-ReliableMessaging support in Apache CXF may be enabled.  &lt;br /&gt;
The client and server both use interceptor configuration to install the&lt;br /&gt;
WS-RM interceptors, comprising logical interceptors (RMInInterceptor/RMOutInterceptor)&lt;br /&gt;
responsible for managing the reliability properties of the current message, and a&lt;br /&gt;
protocol interceptor (RMSoapInterceptor) responsible for encoding/decoding&lt;br /&gt;
these properties as SOAP Headers.&lt;br /&gt;
As WS-RM is dependent on WS-Addressing, the configuration uses &lt;br /&gt;
the same approach as the ws_addressing sample to enable this&lt;br /&gt;
functionality. However, you may notice that the WS-Addressing&lt;br /&gt;
namespace URI is different in this case (i.e.&lt;br /&gt;
http://schemas.xmlsoap.org/ws/2004/08/addressing as opposed to&lt;br /&gt;
http://www.w3.org/2005/08/addressing). This is because the WS-RM&lt;br /&gt;
specification is still based on an older version of WS-Addressing.&lt;br /&gt;
Three additional interceptors are configured: &lt;br /&gt;
- LoggingInInterceptor used on both the client- and server-side to log the &lt;br /&gt;
inbound SOAP messages and display these to the console. Notice the usage of &lt;br /&gt;
out-of-band RM protocol messages (CreateSequence and CreateSequenceResponse)&lt;br /&gt;
and the WS-RM headers in application-level messages (Sequence,&lt;br /&gt;
SequenceAcknowledgement, AckRequested etc.)  &lt;br /&gt;
- LoggingOutInterceptor used on both the client- and server-side to log the &lt;br /&gt;
outbound SOAP messages and display these to the console.&lt;br /&gt;
- MessageLossSimulator used only on the client-side to simulate message &lt;br /&gt;
loss by discarding every second application level message. This simulated &lt;br /&gt;
unreliability allows the retransmission of unacknowledged messages to be &lt;br /&gt;
observed.&lt;br /&gt;
This demo also illustrates usage of the decoupled HTTP transport, whereby&lt;br /&gt;
a separate server-&amp;gt;client HTTP connection is used to deliver responses&lt;br /&gt;
to (application or RM protocol) requests and server side originated &lt;br /&gt;
standalone acknowlegments.&lt;br /&gt;
The &amp;quot;partial response&amp;quot; referred to in the log output is the payload of&lt;br /&gt;
the HTTP 202 Accepted response sent on the back-channel of the original &lt;br /&gt;
client-&amp;gt;server connection. &lt;br /&gt;
In all other respects this demo is based on the basic hello_world sample,&lt;br /&gt;
illustrating that WS-Addressing usage is independent of the application.&lt;br /&gt;
One notable addition to the familiar hello_world WSDL is the usage&lt;br /&gt;
of the &amp;lt;wsaw:UsingAddressing&amp;gt; extension element to indicate the&lt;br /&gt;
WS-Addressing support is enabled for the service endpoint.&lt;br /&gt;
Please review the README in the samples directory before continuing.&lt;br /&gt;
&lt;br /&gt;
Prerequisite&lt;br /&gt;
------------&lt;br /&gt;
If your environment already includes cxf-manifest-incubator.jar on the CLASSPATH,&lt;br /&gt;
and the JDK and ant bin directories on the PATH, it is not necessary to&lt;br /&gt;
run the environment script described in the samples directory README.&lt;br /&gt;
If your environment is not properly configured, or if you are planning&lt;br /&gt;
on using wsdl2java, javac, and java to build and run the demos, you must&lt;br /&gt;
set the environment by running the script.&lt;br /&gt;
Building and running the demo using ant&lt;br /&gt;
---------------------------------------&lt;br /&gt;
From the samples/ws_rm directory, the ant build script can be used to&lt;br /&gt;
build and run the demo.  The server and client targets automatically build&lt;br /&gt;
the demo.&lt;br /&gt;
Using either UNIX or Windows:&lt;br /&gt;
  ant server&lt;br /&gt;
  ant client&lt;br /&gt;
On startup, the client makes a sequence of 4 oneway invocations.&lt;br /&gt;
The output of the logging interceptors will show that only the 1st and 3rd&lt;br /&gt;
reach their destination. Notice how after approximately 2 seconds the&lt;br /&gt;
messages that actually have arrived at the server will be acknowledged,&lt;br /&gt;
and how after approximately 4 seconds the client will resend the 2nd and 4th&lt;br /&gt;
application message. These will be acknowledged another 2 seconds&lt;br /&gt;
later so that there will be no further retransmissions from the client.&lt;br /&gt;
To remove the code generated from the WSDL file and the .class&lt;br /&gt;
files, run:&lt;br /&gt;
  ant clean&lt;br /&gt;
&lt;br /&gt;
Building the demo using wsdl2java and javac&lt;br /&gt;
-------------------------------------------&lt;br /&gt;
From the samples/ws_rm directory, first create the target directory&lt;br /&gt;
build/classes and then generate code from the WSDL file.&lt;br /&gt;
For UNIX:&lt;br /&gt;
  mkdir -p build/classes&lt;br /&gt;
  wsdl2java -d build/classes -compile ./wsdl/hello_world_rm.wsdl&lt;br /&gt;
For Windows:&lt;br /&gt;
  mkdir build\classes&lt;br /&gt;
    Must use back slashes.&lt;br /&gt;
  wsdl2java -d build\classes -compile .\wsdl\hello_world_rm.wsdl&lt;br /&gt;
    May use either forward or back slashes.&lt;br /&gt;
Now compile the provided client and server applications with the commands:&lt;br /&gt;
For UNIX:  &lt;br /&gt;
  &lt;br /&gt;
  export CLASSPATH=$CLASSPATH:$CXF_HOME/lib/celtix.jar:./build/classes&lt;br /&gt;
  javac -d build/classes src/demo/ws_rm/common/*.java&lt;br /&gt;
  javac -d build/classes src/demo/ws_rm/client/*.java&lt;br /&gt;
  javac -d build/classes src/demo/ws_rm/server/*.java&lt;br /&gt;
For Windows:&lt;br /&gt;
  set classpath=%classpath%;%CXF_HOME%\lib\celtix.jar;.\build\classes&lt;br /&gt;
  javac -d build\classes src\demo\ws_rm\common\*.java&lt;br /&gt;
  javac -d build\classes src\demo\ws_rm\client\*.java&lt;br /&gt;
  javac -d build\classes src\demo\ws_rm\server\*.java&lt;br /&gt;
Running the demo using java&lt;br /&gt;
---------------------------&lt;br /&gt;
From the samples/ws_rm directory run the commands (entered on a single command line):&lt;br /&gt;
For UNIX (must use forward slashes):&lt;br /&gt;
    java -Djava.util.logging.config.file=./logging.properties&lt;br /&gt;
         demo.ws_rm.server.Server &amp;amp;&lt;br /&gt;
    java -Djava.util.logging.config.file=./logging.properties&lt;br /&gt;
         demo.ws_rm.client.Client ./wsdl/hello_world_rm.wsdl&lt;br /&gt;
The server process starts in the background.&lt;br /&gt;
For Windows (may use either forward or back slashes):&lt;br /&gt;
  start &lt;br /&gt;
    java -Djava.util.logging.config.file=.\logging.properties&lt;br /&gt;
         demo.ws_rm.server.Server&lt;br /&gt;
    java -Djava.util.logging.config.file=.\logging.properties&lt;br /&gt;
         demo.ws_rm.client.Client .\wsdl\hello_world_rm.wsdl&lt;br /&gt;
The server process starts in a new command window.&lt;br /&gt;
After running the client, terminate the server process.&lt;br /&gt;
To remove the code generated from the WSDL file and the .class&lt;br /&gt;
files, either delete the build directory and its contents or run:&lt;br /&gt;
  ant clean&lt;br /&gt;
&lt;br /&gt;
//////////////////////////////////////////////////////////////////////////////////&lt;br /&gt;
/**&lt;br /&gt;
 * Licensed to the Apache Software Foundation (ASF) under one&lt;br /&gt;
 * or more contributor license agreements. See the NOTICE file&lt;br /&gt;
 * distributed with this work for additional information&lt;br /&gt;
 * regarding copyright ownership. The ASF licenses this file&lt;br /&gt;
 * to you under the Apache License, Version 2.0 (the&lt;br /&gt;
 * &amp;quot;License&amp;quot;); you may not use this file except in compliance&lt;br /&gt;
 * with the License. You may obtain a copy of the License at&lt;br /&gt;
 *&lt;br /&gt;
 * http://www.apache.org/licenses/LICENSE-2.0&lt;br /&gt;
 *&lt;br /&gt;
 * Unless required by applicable law or agreed to in writing,&lt;br /&gt;
 * software distributed under the License is distributed on an&lt;br /&gt;
 * &amp;quot;AS IS&amp;quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY&lt;br /&gt;
 * KIND, either express or implied. See the License for the&lt;br /&gt;
 * specific language governing permissions and limitations&lt;br /&gt;
 * under the License.&lt;br /&gt;
 */&lt;br /&gt;
package demo.ws_rm.client;&lt;br /&gt;
import java.lang.reflect.UndeclaredThrowableException;&lt;br /&gt;
import demo.ws_rm.rumon.MessageLossSimulator;&lt;br /&gt;
import org.apache.cxf.Bus;&lt;br /&gt;
import org.apache.cxf.bus.spring.SpringBusFactory;&lt;br /&gt;
import org.apache.cxf.hello_world_soap_http.Greeter;&lt;br /&gt;
import org.apache.cxf.hello_world_soap_http.GreeterService;&lt;br /&gt;
&lt;br /&gt;
public final class Client {&lt;br /&gt;
    &lt;br /&gt;
    private static final String USER_NAME = System.getProperty(&amp;quot;user.name&amp;quot;);&lt;br /&gt;
    private Client() {&lt;br /&gt;
    } &lt;br /&gt;
    public static void main(String args[]) throws Exception {&lt;br /&gt;
        try { &lt;br /&gt;
       &lt;br /&gt;
            SpringBusFactory bf = new SpringBusFactory();&lt;br /&gt;
            Bus bus = bf.createBus(&amp;quot;ws_rm.xml&amp;quot;);&lt;br /&gt;
            bf.setDefaultBus(bus);&lt;br /&gt;
            bus.getOutInterceptors().add(new MessageLossSimulator());&lt;br /&gt;
 &lt;br /&gt;
            GreeterService service = new GreeterService();&lt;br /&gt;
            Greeter port = service.getGreeterPort();&lt;br /&gt;
            String[] names = new String[] {&amp;quot;Anne&amp;quot;, &amp;quot;Bill&amp;quot;, &amp;quot;Chris&amp;quot;, &amp;quot;Daisy&amp;quot;};&lt;br /&gt;
            // make a sequence of 4 invocations&lt;br /&gt;
            for (int i = 0; i &amp;lt; 4; i++) {&lt;br /&gt;
                System.out.println(&amp;quot;Invoking greetMeOneWay...&amp;quot;);&lt;br /&gt;
                port.greetMeOneWay(names[i]);&lt;br /&gt;
                System.out.println(&amp;quot;No response as method is OneWay\n&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            // allow aynchronous resends to occur&lt;br /&gt;
            Thread.sleep(30 * 1000);&lt;br /&gt;
            bus.shutdown(true);&lt;br /&gt;
        } catch (UndeclaredThrowableException ex) { &lt;br /&gt;
            ex.getUndeclaredThrowable().printStackTrace();&lt;br /&gt;
        } catch (Exception ex) { &lt;br /&gt;
            ex.printStackTrace();&lt;br /&gt;
        } finally { &lt;br /&gt;
            System.exit(0); &lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//////////////////////////////////////////////////////////////////////////////////&lt;br /&gt;
/**&lt;br /&gt;
 * Licensed to the Apache Software Foundation (ASF) under one&lt;br /&gt;
 * or more contributor license agreements. See the NOTICE file&lt;br /&gt;
 * distributed with this work for additional information&lt;br /&gt;
 * regarding copyright ownership. The ASF licenses this file&lt;br /&gt;
 * to you under the Apache License, Version 2.0 (the&lt;br /&gt;
 * &amp;quot;License&amp;quot;); you may not use this file except in compliance&lt;br /&gt;
 * with the License. You may obtain a copy of the License at&lt;br /&gt;
 *&lt;br /&gt;
 * http://www.apache.org/licenses/LICENSE-2.0&lt;br /&gt;
 *&lt;br /&gt;
 * Unless required by applicable law or agreed to in writing,&lt;br /&gt;
 * software distributed under the License is distributed on an&lt;br /&gt;
 * &amp;quot;AS IS&amp;quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY&lt;br /&gt;
 * KIND, either express or implied. See the License for the&lt;br /&gt;
 * specific language governing permissions and limitations&lt;br /&gt;
 * under the License.&lt;br /&gt;
 */&lt;br /&gt;
package demos.ws_rm.rumon;&lt;br /&gt;
import java.util.logging.LogRecord;&lt;br /&gt;
import java.util.logging.SimpleFormatter;&lt;br /&gt;
public class ConciseFormatter extends SimpleFormatter {&lt;br /&gt;
    public synchronized String format(LogRecord record) {&lt;br /&gt;
        String longForm = super.format(record);&lt;br /&gt;
        String shortForm = longForm.indexOf(&amp;quot;INFO: &amp;quot;) &amp;gt; 0&lt;br /&gt;
                           ? longForm.substring(longForm.indexOf(&amp;quot;INFO: &amp;quot;) + 6)&lt;br /&gt;
                           : longForm;&lt;br /&gt;
        return shortForm;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
//////////////////////////////////////////////////////////////////////////////////&lt;br /&gt;
/**&lt;br /&gt;
 * Licensed to the Apache Software Foundation (ASF) under one&lt;br /&gt;
 * or more contributor license agreements. See the NOTICE file&lt;br /&gt;
 * distributed with this work for additional information&lt;br /&gt;
 * regarding copyright ownership. The ASF licenses this file&lt;br /&gt;
 * to you under the Apache License, Version 2.0 (the&lt;br /&gt;
 * &amp;quot;License&amp;quot;); you may not use this file except in compliance&lt;br /&gt;
 * with the License. You may obtain a copy of the License at&lt;br /&gt;
 *&lt;br /&gt;
 * http://www.apache.org/licenses/LICENSE-2.0&lt;br /&gt;
 *&lt;br /&gt;
 * Unless required by applicable law or agreed to in writing,&lt;br /&gt;
 * software distributed under the License is distributed on an&lt;br /&gt;
 * &amp;quot;AS IS&amp;quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY&lt;br /&gt;
 * KIND, either express or implied. See the License for the&lt;br /&gt;
 * specific language governing permissions and limitations&lt;br /&gt;
 * under the License.&lt;br /&gt;
 */&lt;br /&gt;
package demo.ws_rm.rumon;&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import java.io.OutputStream;&lt;br /&gt;
import java.math.BigInteger;&lt;br /&gt;
import java.util.ListIterator;&lt;br /&gt;
import java.util.logging.Level;&lt;br /&gt;
import java.util.logging.Logger;&lt;br /&gt;
import org.apache.cxf.interceptor.Fault;&lt;br /&gt;
import org.apache.cxf.interceptor.InterceptorChain;&lt;br /&gt;
import org.apache.cxf.interceptor.MessageSenderInterceptor;&lt;br /&gt;
import org.apache.cxf.io.AbstractWrappedOutputStream;&lt;br /&gt;
import org.apache.cxf.message.Message;&lt;br /&gt;
import org.apache.cxf.phase.AbstractPhaseInterceptor;&lt;br /&gt;
import org.apache.cxf.phase.Phase;&lt;br /&gt;
import org.apache.cxf.phase.PhaseInterceptor;&lt;br /&gt;
import org.apache.cxf.ws.addressing.AddressingProperties;&lt;br /&gt;
import org.apache.cxf.ws.rm.RMContextUtils;&lt;br /&gt;
/**&lt;br /&gt;
 * &lt;br /&gt;
 */&lt;br /&gt;
public class MessageLossSimulator extends AbstractPhaseInterceptor&amp;lt;Message&amp;gt; {&lt;br /&gt;
    private static final Logger LOG = Logger.getLogger(MessageLossSimulator.class.getName());&lt;br /&gt;
    private int appMessageCount; &lt;br /&gt;
    &lt;br /&gt;
    public MessageLossSimulator() {&lt;br /&gt;
        super(Phase.PREPARE_SEND);&lt;br /&gt;
        addBefore(MessageSenderInterceptor.class.getName());&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
      * Simulate loss of every second application message by replacing the stream normally &lt;br /&gt;
      * provided by the transport (in the MessageSenderInterceptor)/ &lt;br /&gt;
     */ &lt;br /&gt;
    public void handleMessage(Message message) throws Fault {&lt;br /&gt;
        AddressingProperties maps =&lt;br /&gt;
            RMContextUtils.retrieveMAPs(message, false, true);&lt;br /&gt;
        RMContextUtils.ensureExposedVersion(maps);&lt;br /&gt;
        String action = null;&lt;br /&gt;
        if (maps != null &amp;amp;&amp;amp; null != maps.getAction()) {&lt;br /&gt;
            action = maps.getAction().getValue();&lt;br /&gt;
        }&lt;br /&gt;
        if (RMContextUtils.isRMProtocolMessage(action)) { &lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        appMessageCount++;&lt;br /&gt;
        if (0 != (appMessageCount % 2)) {&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        InterceptorChain chain = message.getInterceptorChain();&lt;br /&gt;
        ListIterator it = chain.getIterator();&lt;br /&gt;
        while (it.hasNext()) {&lt;br /&gt;
            PhaseInterceptor pi = (PhaseInterceptor)it.next();&lt;br /&gt;
            if (MessageSenderInterceptor.class.getName().equals(pi.getId())) {&lt;br /&gt;
                chain.remove(pi);&lt;br /&gt;
                LOG.fine(&amp;quot;Removed MessageSenderInterceptor from interceptor chain.&amp;quot;);&lt;br /&gt;
                break;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        message.setContent(OutputStream.class, new WrappedOutputStream(message));     &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    private class WrappedOutputStream extends AbstractWrappedOutputStream {&lt;br /&gt;
        private Message outMessage;&lt;br /&gt;
        public WrappedOutputStream(Message m) {&lt;br /&gt;
            this.outMessage = m;&lt;br /&gt;
        }&lt;br /&gt;
        @Override&lt;br /&gt;
        protected void onFirstWrite() throws IOException {&lt;br /&gt;
            if (LOG.isLoggable(Level.FINE)) {&lt;br /&gt;
                BigInteger nr = RMContextUtils.retrieveRMProperties(outMessage, true)&lt;br /&gt;
                    .getSequence().getMessageNumber();&lt;br /&gt;
                LOG.fine(&amp;quot;Losing message &amp;quot; + nr);&lt;br /&gt;
            }&lt;br /&gt;
            wrappedStream = new DummyOutputStream();&lt;br /&gt;
        }&lt;br /&gt;
    }    &lt;br /&gt;
            &lt;br /&gt;
    &lt;br /&gt;
    private class DummyOutputStream extends OutputStream {&lt;br /&gt;
        @Override&lt;br /&gt;
        public void write(int b) throws IOException {&lt;br /&gt;
            // TODO Auto-generated method stub&lt;br /&gt;
            &lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//////////////////////////////////////////////////////////////////////////////////&lt;br /&gt;
/**&lt;br /&gt;
 * Licensed to the Apache Software Foundation (ASF) under one&lt;br /&gt;
 * or more contributor license agreements. See the NOTICE file&lt;br /&gt;
 * distributed with this work for additional information&lt;br /&gt;
 * regarding copyright ownership. The ASF licenses this file&lt;br /&gt;
 * to you under the Apache License, Version 2.0 (the&lt;br /&gt;
 * &amp;quot;License&amp;quot;); you may not use this file except in compliance&lt;br /&gt;
 * with the License. You may obtain a copy of the License at&lt;br /&gt;
 *&lt;br /&gt;
 * http://www.apache.org/licenses/LICENSE-2.0&lt;br /&gt;
 *&lt;br /&gt;
 * Unless required by applicable law or agreed to in writing,&lt;br /&gt;
 * software distributed under the License is distributed on an&lt;br /&gt;
 * &amp;quot;AS IS&amp;quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY&lt;br /&gt;
 * KIND, either express or implied. See the License for the&lt;br /&gt;
 * specific language governing permissions and limitations&lt;br /&gt;
 * under the License.&lt;br /&gt;
 */&lt;br /&gt;
package demo.ws_rm.server;&lt;br /&gt;
import java.util.logging.Logger;&lt;br /&gt;
import org.apache.cxf.hello_world_soap_http.Greeter;&lt;br /&gt;
@javax.jws.WebService(serviceName = &amp;quot;GreeterService&amp;quot;,&lt;br /&gt;
            portName = &amp;quot;GreeterPort&amp;quot;,&lt;br /&gt;
            endpointInterface = &amp;quot;org.apache.cxf.hello_world_soap_http.Greeter&amp;quot;,&lt;br /&gt;
            wsdlLocation = &amp;quot;file:./wsdl/hello_world_rm.wsdl&amp;quot;,&lt;br /&gt;
            targetNamespace = &amp;quot;http://cxf.apache.org/hello_world_soap_http&amp;quot;)&lt;br /&gt;
                  &lt;br /&gt;
public class GreeterImpl implements Greeter {&lt;br /&gt;
    private static final Logger LOG = &lt;br /&gt;
        Logger.getLogger(GreeterImpl.class.getPackage().getName());&lt;br /&gt;
    &lt;br /&gt;
    /* (non-Javadoc)&lt;br /&gt;
     * @see org.apache.cxf.hello_world_soap_http.Greeter#greetMe(java.lang.String)&lt;br /&gt;
     */&lt;br /&gt;
    public String greetMe(String me) {&lt;br /&gt;
        LOG.info(&amp;quot;Executing operation greetMe&amp;quot;);&lt;br /&gt;
        System.out.println(&amp;quot;Executing operation greetMe&amp;quot;);&lt;br /&gt;
        System.out.println(&amp;quot;Message received: &amp;quot; + me + &amp;quot;\n&amp;quot;);&lt;br /&gt;
        return &amp;quot;Hello &amp;quot; + me;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /* (non-Javadoc)&lt;br /&gt;
     * @see org.apache.cxf.hello_world_soap_http.Greeter#greetMeOneWay(java.lang.String)&lt;br /&gt;
     */&lt;br /&gt;
    public void greetMeOneWay(String me) {&lt;br /&gt;
        LOG.info(&amp;quot;Executing operation greetMeOneWay&amp;quot;);&lt;br /&gt;
        System.out.println(&amp;quot;Executing operation greetMeOneWay\n&amp;quot;);&lt;br /&gt;
        System.out.println(&amp;quot;Hello there &amp;quot; + me);&lt;br /&gt;
    }&lt;br /&gt;
    /* (non-Javadoc)&lt;br /&gt;
     * @see org.apache.cxf.hello_world_soap_http.Greeter#sayHi()&lt;br /&gt;
     */&lt;br /&gt;
    public String sayHi() {&lt;br /&gt;
        LOG.info(&amp;quot;Executing operation sayHi&amp;quot;);&lt;br /&gt;
        System.out.println(&amp;quot;Executing operation sayHi\n&amp;quot;);&lt;br /&gt;
        return &amp;quot;Bonjour&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
//////////////////////////////////////////////////////////////////////////////////&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Licensed to the Apache Software Foundation (ASF) under one&lt;br /&gt;
 * or more contributor license agreements. See the NOTICE file&lt;br /&gt;
 * distributed with this work for additional information&lt;br /&gt;
 * regarding copyright ownership. The ASF licenses this file&lt;br /&gt;
 * to you under the Apache License, Version 2.0 (the&lt;br /&gt;
 * &amp;quot;License&amp;quot;); you may not use this file except in compliance&lt;br /&gt;
 * with the License. You may obtain a copy of the License at&lt;br /&gt;
 *&lt;br /&gt;
 * http://www.apache.org/licenses/LICENSE-2.0&lt;br /&gt;
 *&lt;br /&gt;
 * Unless required by applicable law or agreed to in writing,&lt;br /&gt;
 * software distributed under the License is distributed on an&lt;br /&gt;
 * &amp;quot;AS IS&amp;quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY&lt;br /&gt;
 * KIND, either express or implied. See the License for the&lt;br /&gt;
 * specific language governing permissions and limitations&lt;br /&gt;
 * under the License.&lt;br /&gt;
 */&lt;br /&gt;
package demo.ws_rm.server;&lt;br /&gt;
import javax.xml.ws.Endpoint;&lt;br /&gt;
import org.apache.cxf.Bus;&lt;br /&gt;
import org.apache.cxf.bus.spring.SpringBusFactory;&lt;br /&gt;
public class Server {&lt;br /&gt;
    protected Server() throws Exception {&lt;br /&gt;
        System.out.println(&amp;quot;Starting Server&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        Object implementor = new GreeterImpl();&lt;br /&gt;
        String address = &amp;quot;http://localhost:9000/SoapContext/GreeterPort&amp;quot;;&lt;br /&gt;
        Endpoint e = Endpoint.publish(address, implementor);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public static void main(String args[]) throws Exception {&lt;br /&gt;
        SpringBusFactory bf = new SpringBusFactory();&lt;br /&gt;
        Bus bus = bf.createBus(&amp;quot;ws_rm.xml&amp;quot;);&lt;br /&gt;
        bf.setDefaultBus(bus);&lt;br /&gt;
        new Server();&lt;br /&gt;
        System.out.println(&amp;quot;Server ready...&amp;quot;); &lt;br /&gt;
        &lt;br /&gt;
        Thread.sleep(5 * 60 * 1000); &lt;br /&gt;
      &lt;br /&gt;
        bus.shutdown(true);&lt;br /&gt;
        System.out.println(&amp;quot;Server exiting&amp;quot;);&lt;br /&gt;
        System.exit(0);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/////////////////////////////////////////////////////////////////////////////&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
  Licensed to the Apache Software Foundation (ASF) under one&lt;br /&gt;
  or more contributor license agreements. See the NOTICE file&lt;br /&gt;
  distributed with this work for additional information&lt;br /&gt;
  regarding copyright ownership. The ASF licenses this file&lt;br /&gt;
  to you under the Apache License, Version 2.0 (the&lt;br /&gt;
  &amp;quot;License&amp;quot;); you may not use this file except in compliance&lt;br /&gt;
  with the License. You may obtain a copy of the License at&lt;br /&gt;
 &lt;br /&gt;
  http://www.apache.org/licenses/LICENSE-2.0&lt;br /&gt;
 &lt;br /&gt;
  Unless required by applicable law or agreed to in writing,&lt;br /&gt;
  software distributed under the License is distributed on an&lt;br /&gt;
  &amp;quot;AS IS&amp;quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY&lt;br /&gt;
  KIND, either express or implied. See the License for the&lt;br /&gt;
  specific language governing permissions and limitations&lt;br /&gt;
  under the License.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;wsdl:definitions name=&amp;quot;HelloWorld&amp;quot; targetNamespace=&amp;quot;http://cxf.apache.org/hello_world_soap_http&amp;quot; &lt;br /&gt;
    xmlns=&amp;quot;http://schemas.xmlsoap.org/wsdl/&amp;quot; &lt;br /&gt;
    xmlns:soap=&amp;quot;http://schemas.xmlsoap.org/wsdl/soap/&amp;quot; &lt;br /&gt;
    xmlns:tns=&amp;quot;http://cxf.apache.org/hello_world_soap_http&amp;quot;&lt;br /&gt;
    xmlns:x1=&amp;quot;http://cxf.apache.org/hello_world_soap_http/types&amp;quot;&lt;br /&gt;
    xmlns:wsdl=&amp;quot;http://schemas.xmlsoap.org/wsdl/&amp;quot; &lt;br /&gt;
    xmlns:xsd=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;wsdl:types&amp;gt;&lt;br /&gt;
        &amp;lt;schema targetNamespace=&amp;quot;http://cxf.apache.org/hello_world_soap_http/types&amp;quot; &lt;br /&gt;
            xmlns=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; elementFormDefault=&amp;quot;qualified&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;element name=&amp;quot;sayHi&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;complexType/&amp;gt;&lt;br /&gt;
            &amp;lt;/element&amp;gt;&lt;br /&gt;
            &amp;lt;element name=&amp;quot;sayHiResponse&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;complexType&amp;gt;&lt;br /&gt;
                    &amp;lt;sequence&amp;gt;&lt;br /&gt;
                        &amp;lt;element name=&amp;quot;responseType&amp;quot; type=&amp;quot;xsd:string&amp;quot;/&amp;gt;&lt;br /&gt;
                    &amp;lt;/sequence&amp;gt;&lt;br /&gt;
                &amp;lt;/complexType&amp;gt;&lt;br /&gt;
            &amp;lt;/element&amp;gt;&lt;br /&gt;
            &amp;lt;element name=&amp;quot;greetMe&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;complexType&amp;gt;&lt;br /&gt;
                    &amp;lt;sequence&amp;gt;&lt;br /&gt;
                        &amp;lt;element name=&amp;quot;requestType&amp;quot; type=&amp;quot;xsd:string&amp;quot;/&amp;gt;&lt;br /&gt;
                    &amp;lt;/sequence&amp;gt;&lt;br /&gt;
                &amp;lt;/complexType&amp;gt;&lt;br /&gt;
            &amp;lt;/element&amp;gt;&lt;br /&gt;
            &amp;lt;element name=&amp;quot;greetMeResponse&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;complexType&amp;gt;&lt;br /&gt;
                    &amp;lt;sequence&amp;gt;&lt;br /&gt;
                        &amp;lt;element name=&amp;quot;responseType&amp;quot; type=&amp;quot;xsd:string&amp;quot;/&amp;gt;&lt;br /&gt;
                    &amp;lt;/sequence&amp;gt;&lt;br /&gt;
                &amp;lt;/complexType&amp;gt;&lt;br /&gt;
            &amp;lt;/element&amp;gt;&lt;br /&gt;
            &amp;lt;element name=&amp;quot;greetMeOneWay&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;complexType&amp;gt;&lt;br /&gt;
                    &amp;lt;sequence&amp;gt;&lt;br /&gt;
                        &amp;lt;element name=&amp;quot;requestType&amp;quot; type=&amp;quot;xsd:string&amp;quot;/&amp;gt;&lt;br /&gt;
                    &amp;lt;/sequence&amp;gt;&lt;br /&gt;
                &amp;lt;/complexType&amp;gt;&lt;br /&gt;
            &amp;lt;/element&amp;gt;&lt;br /&gt;
        &amp;lt;/schema&amp;gt;&lt;br /&gt;
    &amp;lt;/wsdl:types&amp;gt;&lt;br /&gt;
    &amp;lt;wsdl:message name=&amp;quot;sayHiRequest&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;wsdl:part element=&amp;quot;x1:sayHi&amp;quot; name=&amp;quot;in&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/wsdl:message&amp;gt;&lt;br /&gt;
    &amp;lt;wsdl:message name=&amp;quot;sayHiResponse&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;wsdl:part element=&amp;quot;x1:sayHiResponse&amp;quot; name=&amp;quot;out&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/wsdl:message&amp;gt;&lt;br /&gt;
    &amp;lt;wsdl:message name=&amp;quot;greetMeRequest&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;wsdl:part element=&amp;quot;x1:greetMe&amp;quot; name=&amp;quot;in&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/wsdl:message&amp;gt;&lt;br /&gt;
    &amp;lt;wsdl:message name=&amp;quot;greetMeResponse&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;wsdl:part element=&amp;quot;x1:greetMeResponse&amp;quot; name=&amp;quot;out&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/wsdl:message&amp;gt;&lt;br /&gt;
    &amp;lt;wsdl:message name=&amp;quot;greetMeOneWayRequest&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;wsdl:part element=&amp;quot;x1:greetMeOneWay&amp;quot; name=&amp;quot;in&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/wsdl:message&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;wsdl:portType name=&amp;quot;Greeter&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;wsdl:operation name=&amp;quot;sayHi&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;wsdl:input message=&amp;quot;tns:sayHiRequest&amp;quot; name=&amp;quot;sayHiRequest&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;wsdl:output message=&amp;quot;tns:sayHiResponse&amp;quot; name=&amp;quot;sayHiResponse&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/wsdl:operation&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
        &amp;lt;wsdl:operation name=&amp;quot;greetMe&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;wsdl:input message=&amp;quot;tns:greetMeRequest&amp;quot; name=&amp;quot;greetMeRequest&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;wsdl:output message=&amp;quot;tns:greetMeResponse&amp;quot; name=&amp;quot;greetMeResponse&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/wsdl:operation&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
        &amp;lt;wsdl:operation name=&amp;quot;greetMeOneWay&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;wsdl:input message=&amp;quot;tns:greetMeOneWayRequest&amp;quot; name=&amp;quot;greetMeOneWayRequest&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/wsdl:operation&amp;gt;&lt;br /&gt;
    &amp;lt;/wsdl:portType&amp;gt;&lt;br /&gt;
    &amp;lt;wsdl:binding name=&amp;quot;Greeter_SOAPBinding&amp;quot; type=&amp;quot;tns:Greeter&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;soap:binding style=&amp;quot;document&amp;quot; transport=&amp;quot;http://schemas.xmlsoap.org/soap/http&amp;quot;/&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
        &amp;lt;wsdl:operation name=&amp;quot;sayHi&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;soap:operation soapAction=&amp;quot;&amp;quot; style=&amp;quot;document&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;wsdl:input name=&amp;quot;sayHiRequest&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;soap:body use=&amp;quot;literal&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;/wsdl:input&amp;gt;&lt;br /&gt;
            &amp;lt;wsdl:output name=&amp;quot;sayHiResponse&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;soap:body use=&amp;quot;literal&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;/wsdl:output&amp;gt;&lt;br /&gt;
        &amp;lt;/wsdl:operation&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
        &amp;lt;wsdl:operation name=&amp;quot;greetMe&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;soap:operation soapAction=&amp;quot;&amp;quot; style=&amp;quot;document&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;wsdl:input name=&amp;quot;greetMeRequest&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;soap:body use=&amp;quot;literal&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;/wsdl:input&amp;gt;&lt;br /&gt;
            &amp;lt;wsdl:output name=&amp;quot;greetMeResponse&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;soap:body use=&amp;quot;literal&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;/wsdl:output&amp;gt;&lt;br /&gt;
        &amp;lt;/wsdl:operation&amp;gt;&lt;br /&gt;
        &lt;br /&gt;
        &amp;lt;wsdl:operation name=&amp;quot;greetMeOneWay&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;soap:operation soapAction=&amp;quot;&amp;quot; style=&amp;quot;document&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;wsdl:input name=&amp;quot;greetMeOneWayRequest&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;soap:body use=&amp;quot;literal&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;/wsdl:input&amp;gt;&lt;br /&gt;
        &amp;lt;/wsdl:operation&amp;gt;&lt;br /&gt;
    &amp;lt;/wsdl:binding&amp;gt;&lt;br /&gt;
    &amp;lt;wsdl:service name=&amp;quot;GreeterService&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;wsdl:port binding=&amp;quot;tns:Greeter_SOAPBinding&amp;quot; name=&amp;quot;GreeterPort&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;soap:address location=&amp;quot;http://localhost:9000/SoapContext/GreeterPort&amp;quot;/&amp;gt;&lt;br /&gt;
            &amp;lt;wswa:UsingAddressing xmlns:wswa=&amp;quot;http://www.w3.org/2005/02/addressing/wsdl&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/wsdl:port&amp;gt;&lt;br /&gt;
    &amp;lt;/wsdl:service&amp;gt;&lt;br /&gt;
&amp;lt;/wsdl:definitions&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;/div&gt;</summary>
			</entry>

	</feed>