[jboss-cvs] JBossAS SVN: r92829 - projects/docs/enterprise/5.0/Administration_And_Configuration_Guide/en-US.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Aug 26 07:18:35 EDT 2009
Author: richard.opalka at jboss.com
Date: 2009-08-26 07:18:35 -0400 (Wed, 26 Aug 2009)
New Revision: 92829
Modified:
projects/docs/enterprise/5.0/Administration_And_Configuration_Guide/en-US/Web_Services.xml
Log:
[JBPAPP-2620] finished documentation review
Modified: projects/docs/enterprise/5.0/Administration_And_Configuration_Guide/en-US/Web_Services.xml
===================================================================
--- projects/docs/enterprise/5.0/Administration_And_Configuration_Guide/en-US/Web_Services.xml 2009-08-26 11:17:08 UTC (rev 92828)
+++ projects/docs/enterprise/5.0/Administration_And_Configuration_Guide/en-US/Web_Services.xml 2009-08-26 11:18:35 UTC (rev 92829)
@@ -1451,8 +1451,7 @@
<para>The following endpoint implementation has a set of operation for a typical stateful shopping chart application.</para>
<programlisting role="JAVA">
@WebService(name = "StatefulEndpoint", targetNamespace = "http://org.jboss.ws/samples/wsaddressing", serviceName = "TestService")
- at EndpointConfig(configName = "Standard WSAddressing Endpoint")
- at HandlerChain(file = "WEB-INF/jaxws-handlers.xml")
+ at Addressing(enabled=true, required=true)
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class StatefulEndpointImpl implements StatefulEndpoint, ServiceLifecycle
{
@@ -1468,63 +1467,39 @@
public String getItems()
{ ... }
}</programlisting>
- <para>It uses the <ulink url="http://www.jboss.org/community/wiki/JBossWS-NativeUserGuide#Addressing_Endpoint">JAX-WS Endpoint Configuration# Standard WSAddressing Endpoint</ulink> to enable the server side addressing handler. It processes the incomming WS-Addressing header elements and provides access to them through the JSR-261 API.</para>
- <para>The endpoint handler chain</para>
-<programlisting role="XML">
-<handler-chains xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-xsi:schemaLocation="http://java.sun.com/xml/ns/javaee javaee_web_services_1_2.xsd">
-
-<handler-chain>
-<protocol-bindings>##SOAP11_HTTP</protocol-bindings>
-<handler>
-<handler-name>Application Server Handler</handler-name>
-<handler-class>org.jboss.test.ws.jaxws.samples.wsaddressing.ServerHandler</handler-class>
-</handler>
-</handler-chain>
-
-</handler-chains>
-</programlisting>
- <para>Defines an application specific hander that assignes and processes stateful client IDs.</para>
+ <para>It uses the JAX-WS 2.1 defined <literal>javax.xml.ws.soap.Addressing</literal> annotation to enable the server side addressing handler.</para>
</section>
<section>
<title>Addressing Client</title>
- <para>On the client side there are simmilar handlers that does the reverse. It uses the JSR-261 API to add WS-Addressing header elements including the clientid association.</para>
- <para> The client sets a custom handler chain in the binding</para>
+ <para>The client code uses <literal>javax.xml.ws.soap.AddressingFeature</literal> feature from JAX-WS 2.1 API to enable the WS-Addressing.</para>
<programlisting role="JAVA">
Service service = Service.create(wsdlURL, serviceName);
-port1 = (StatefulEndpoint)service.getPort(StatefulEndpoint.class);
-BindingProvider bindingProvider = (BindingProvider)port1;
-
-List<Handler> customHandlerChain = new ArrayList<Handler>();
-customHandlerChain.add(new ClientHandler());
-customHandlerChain.add(new WSAddressingClientHandler());
-bindingProvider.getBinding().setHandlerChain(customHandlerChain);
+port1 = (StatefulEndpoint)service.getPort(StatefulEndpoint.class, new AddressingFeature());
</programlisting>
-
-<para>The WSAddressingClientHandler is provided by JBossWS and reads/writes the addressing properties and puts then into the message context.</para>
<para>
<emphasis role="bold">A client connecting to the stateful endpoint</emphasis>
</para>
<programlisting role="JAVA">
public class AddressingStatefulTestCase extends JBossWSTest
{
-public void testAddItem() throws Exception
-{
-port1.addItem("Ice Cream");
-port1.addItem("Ferrari");
+ ...
+ public void testAddItem() throws Exception
+ {
+ port1.addItem("Ice Cream");
+ port1.addItem("Ferrari");
-port2.addItem("Mars Bar");
-port2.addItem("Porsche");
-}
+ port2.addItem("Mars Bar");
+ port2.addItem("Porsche");
+ }
-public void testGetItems() throws Exception
-{
-String items1 = port1.getItems();
-assertEquals("[Ice Cream, Ferrari]", items1);
+ public void testGetItems() throws Exception
+ {
+ String items1 = port1.getItems();
+ assertEquals("[Ice Cream, Ferrari]", items1);
-String items2 = port2.getItems();
-assertEquals("[Mars Bar, Porsche]", items2);
-}
+ String items2 = port2.getItems();
+ assertEquals("[Mars Bar, Porsche]", items2);
+ }
}</programlisting>
<para>
<emphasis role="bold">SOAP message exchange</emphasis>
More information about the jboss-cvs-commits
mailing list