Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 952DDCA68 for ; Mon, 24 Jun 2013 17:12:08 +0000 (UTC) Received: (qmail 52896 invoked by uid 500); 24 Jun 2013 17:12:07 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 52795 invoked by uid 500); 24 Jun 2013 17:12:07 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 52697 invoked by uid 99); 24 Jun 2013 17:12:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Jun 2013 17:12:06 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Jun 2013 17:12:02 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 843462388C2A for ; Mon, 24 Jun 2013 17:11:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r867253 [9/46] - in /websites/production/cxf/content: ./ 2008/04/28/ 2008/06/20/ 2009/02/10/ 2009/08/04/ cache/ docs/ docs/cxf-architecture.thumbs/ docs/cxf-dependency-graphs.thumbs/ docs/logbrowser-configuration.thumbs/ docs/logbrowser-sof... Date: Mon, 24 Jun 2013 17:10:57 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130624171118.843462388C2A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: websites/production/cxf/content/docs/a-simple-jax-ws-service.html ============================================================================== --- websites/production/cxf/content/docs/a-simple-jax-ws-service.html (original) +++ websites/production/cxf/content/docs/a-simple-jax-ws-service.html Mon Jun 24 17:10:51 2013 @@ -25,6 +25,17 @@ + + + + + + + + Apache CXF -- A simple JAX-WS service @@ -42,19 +53,15 @@ Apache CXF -- A simple JAX-WS service     -
- +

+
@@ -94,7 +101,7 @@ Apache CXF -- A simple JAX-WS service
-
  • Search +
    • Search
      @@ -139,18 +146,19 @@ Apache CXF -- A simple JAX-WS service

      Writing your Service

      First we'll write our service interface. It will have one operation called sayHi which says "Hello" to whoever submits their name.

      -
      +
       

      To make sure your parameter is named correctly in the xml you should use:

      -
      +
       

      The @WebParam annotation is necessary as java interfaces do not store the Parameter name in the .class file. So if you leave out the annotation your parameter will be named arg0.

      Our implementation will then look like this:

      -
      package demo.hw.server;
      +
       

      The @WebService annotation on the implementation class lets CXF know which interface we want to create our WSDL with. In this case its simply our HelloWorld interface.

      Publishing your service

      -
      System.out.println("Starting Server");
      -HelloWorldImpl implementor = new HelloWorldImpl();
      -String address = "http://localhost:9000/helloWorld";
      -Endpoint.publish(address, implementor);
      -
      +

      whole code at @@ -229,16 +239,16 @@ HelloWorldImpl implementor = Alternatively you can use the following code. This gives you more control over the behaviour. For example you can add a logging interceptor:

      -
      -HelloWorldImpl implementor = new HelloWorldImpl();
      -JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
      +
       

      You could leave out the ServiceClass. But it is better to use it so the server and the client are created from the same interface. If you instead only use the implementation class subtle problems may occur.

      @@ -253,18 +263,18 @@ svrFactory.create();

      For the client there is also the alternative approach that gives you more flexibility. Of course like above the logging interceptors are optional but they help a lot when starting:

      -
      -JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
      -factory.getInInterceptors().add(new LoggingInInterceptor());
      -factory.getOutInterceptors().add(new LoggingOutInterceptor());
      +
       
      Modified: websites/production/cxf/content/docs/advanced-integration.html ============================================================================== --- websites/production/cxf/content/docs/advanced-integration.html (original) +++ websites/production/cxf/content/docs/advanced-integration.html Mon Jun 24 17:10:51 2013 @@ -25,6 +25,8 @@ + + Apache CXF -- Advanced Integration @@ -42,19 +44,15 @@ Apache CXF -- Advanced Integration
    -
- +

+
@@ -94,7 +92,7 @@ Apache CXF -- Advanced Integration
-
  • Search +
    • Search
      Modified: websites/production/cxf/content/docs/aegis-21.html ============================================================================== --- websites/production/cxf/content/docs/aegis-21.html (original) +++ websites/production/cxf/content/docs/aegis-21.html Mon Jun 24 17:10:51 2013 @@ -25,6 +25,18 @@ + + + + + + + + + Apache CXF -- Aegis (2.1) @@ -42,19 +54,15 @@ Apache CXF -- Aegis (2.1)
    -
- +

+
@@ -94,7 +102,7 @@ Apache CXF -- Aegis (2.1)
-
  • Search +
    • Search
      @@ -146,17 +154,17 @@ Apache CXF -- Aegis (2.1)

      For example, here is a Simple front-end service using Aegis as a data binding.

      -
      -<simple:server id="pojoservice" serviceClass="demo.hw.server.HelloWorld" 
      -  address="/hello_world">
      -  <simple:serviceBean>
      -    <bean class="demo.hw.server.HelloWorldImpl" />
      -  </simple:serviceBean>
      -  <simple:dataBinding>
      -    <bean class="org.apache.cxf.aegis.databinding.AegisDatabinding" />
      -  </simple:dataBinding>
      -</simple:server>
      -
      +

      AegisDatabinding is the class that integrates Aegis into CXF as a databinding.

      @@ -183,19 +191,19 @@ Apache CXF -- Aegis (2.1)

      As of CXF 2.3, the Aegis databinding can leverage the Schema Validation capabilities built into the Woodstox 4.x Stax parser to validate incoming requests. To enable this, you must do the following:

      1. Make sure you are using the Woodstox 4.x Stax parser and not a 3.x or other parser. By default, CXF 2.3 ships with an appropriate version of Woodstox.
      2. If not using the CXF bundle jar, (example, if using maven), you'll need to add the cxf-wstx-msv-validation-2.3.0.jar to the classpath
      3. If not using maven or similar to obtain the cxf-wstx-msv-validation jar, you'll also need to add the msv validation jars as CXF does not ship them by default. You will need:
        -
        +
         
      4. If not using a default bus (such as configuring your own spring context), you'll need to add:
        -
        -<import resource="classpath:META-INF/cxf/cxf-extension-wstx-msv-validation.xml" />
        -
        +

        to load the validator utilities that Aegis will use.

      5. Turn on schema validation like you would for JAXB by using the @SchemaValidation annotation or setting the "schema-validation-enabled" property on the endpoint to "true".
      @@ -253,14 +261,14 @@ These type attributes allow Aegis to ide

      Here's a quick example of Java code setting these options. In Spring you would do something analogous with properties.

      -
      -TypeCreationOptions tOpts = new TypeCreationOptions();
      +
       

      Detailed Control of Bean Type Mapping

      @@ -286,13 +294,13 @@ sFactory.getServiceFactory().setDataBind

      Here is a very simple mapping. It takes a property named 'horse', renames it to 'feathers', and makes it an attribute instead of an element.

      -
      -<mappings>
      -  <mapping name="">
      -    <property name="horse" mappedName="Feathers" style="attribute"/>
      -  </mapping>
      -</mappings>
      -
      +

      Names and Namespaces

      @@ -300,12 +308,12 @@ sFactory.getServiceFactory().setDataBind

      You can also specify the full QName of the bean itself. The following mapping causes a class to have the QName {urn:north-pole:operations}Employee.

      -
      -<mappings xmlns:np="urn:north-pole:operations">
      -  <mapping name="np:Employee">
      -  </mapping>
      -</mappings>
      -
      +

      Notice that the namespace was declared on the mappings element and then the prefix was used to specify the element QNames for the name/title properties.

      @@ -313,12 +321,12 @@ sFactory.getServiceFactory().setDataBind

      This will result in a mapping like so:

      -
      -<np:Employee xmlns:np="urn:north-pole:operations">
      -  <np:Name>Santa Claus</np:Name>
      -  <np:Title>Chief Present Officer (CPO)</np:Title>
      -</np:Employee>
      -
      +

      Ignoring properties

      @@ -326,13 +334,13 @@ sFactory.getServiceFactory().setDataBind

      If you don't want to serialize a certain property it is easy to ignore it:

      -
      -<mappings>
      -  <mapping>
      -    <property name="propertyName" ignore="true"/>
      -  </mapping>
      -</mappings>
      -
      +

      MinOccurs and Nillable

      @@ -340,13 +348,13 @@ sFactory.getServiceFactory().setDataBind

      The default Aegis mapping is to assume that, since any Java object can be null, that the corresponding schema elements should have minOccurs of 0 and nillable of true. There are properties on the mappings for to control this.

      -
      -<mappings>
      -  <mapping>
      -    <property name='everpresentProperty' minOccurs='1' nillable='false'/>
      - </mapping>
      -<mappings>
      -
      +

      Alternative Type Binding

      @@ -356,16 +364,16 @@ sFactory.getServiceFactory().setDataBind

      By default, for example, if Aegis maps a property as a Date, it uses the XML schema type xsd:dateTime. Here is an example that uses xsd:date, instead.

      -
      -<mappings xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      -	<mapping>
      -		<property name="birthDate" 
      -			type="org.apache.cxf.aegis.type.basic.DateType" 
      -			typeName="xsd:date"
      +
       

      Collections

      @@ -383,19 +391,19 @@ sFactory.getServiceFactory().setDataBind

      This example specifies that getUnannotatedStrings returns an element named UnannotatedStringCollection which is a raw collection of String values. It then specifies the first parameter of getValues is also a raw collection of String values.

      -
      -<mappings>
      -   <mapping>
      -      <method name="getUnannotatedStrings">
      -         <return-type name="UnannotatedStringCollection" 
      -             componentType="java.lang.String"/>
      -      </method>
      -      <method name="getValues">
      -         <parameter index="0" componentType="java.lang.String"/>
      -      </method>
      -   </mapping>
      -</mappings>
      -
      +

      Annotations

      Modified: websites/production/cxf/content/docs/aegis-databinding-20x.html ============================================================================== --- websites/production/cxf/content/docs/aegis-databinding-20x.html (original) +++ websites/production/cxf/content/docs/aegis-databinding-20x.html Mon Jun 24 17:10:51 2013 @@ -25,6 +25,18 @@ + + + + + + + + + Apache CXF -- Aegis Databinding (2.0.x) @@ -42,19 +54,15 @@ Apache CXF -- Aegis Databinding (2.0.x)
    -
- +

+
@@ -94,7 +102,7 @@ Apache CXF -- Aegis Databinding (2.0.x)
-
  • Search +
    • Search
      @@ -145,62 +153,62 @@ Apache CXF -- Aegis Databinding (2.0.x)

      Most people who use Aegis use the 'Simple' front end.

      -
      -<simple:server id="pojoservice" serviceClass="demo.hw.server.HelloWorld" address="/hello_world">
      -  <simple:serviceBean>
      -    <bean class="demo.hw.server.HelloWorldImpl" />
      -  </simple:serviceBean>
      -  <simple:dataBinding>
      -    <bean class="org.apache.cxf.aegis.databinding.AegisDatabinding" />
      -  </simple:dataBinding>
      +
       

      You can also use Aegis with JAX-WS. Here's a Spring configuration example for that.

      -
      -<bean id="aegisBean" class="org.apache.cxf.aegis.databinding.AegisDatabinding" scope="prototype"/> 
      -<bean id="jaxws-and-aegis-service-factory"
      -  class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean"
      -  scope="prototype"> 
      -  <property name="dataBinding" ref="aegisBean"/>
      +
       

      Java configuration

      @@ -208,33 +216,33 @@ Apache CXF -- Aegis Databinding (2.0.x)

      Here's a Java configuration using the Simple front end.

      -
      -import org.apache.cxf.aegis.databinding.AegisDatabinding;
      -import org.apache.cxf.frontend.ServerFactoryBean;
      +
       

      Similarly, here is a client side using the simple front end. Note the use of the WSDL. Without the WSDL, the simple front end will try to learn
      parameters names from Java reflection. As always, Java interfaces don't carry parameter names, and this results in names like 'arg0', 'arg1', etc, which don't match the service.

      -
      -import org.apache.cxf.aegis.databinding.AegisDatabinding;
      -import org.apache.cxf.frontend.ClientProxyFactoryBean;
      +
       

      XFire Compatibility

      @@ -244,14 +252,14 @@ If you need to interoperate with XFire, an additional service configuration class to your service configuration: XFireCompatibilityServiceConfiguration (in 2.0.x, AegisServiceConfiguration).
      The spring example above shows the necessary configuration in a comment. For the client side in Java, you need to add the service configuration to the service factory as follows:

      -
      -import org.apache.cxf.aegis.databinding.AegisServiceConfiguration;
      -// for 2.0.x
      -sf.getServiceFactory().getServiceConfigurations().add(0, new AegisServiceConfiguration());
      -// for 2.1
      -sf.getServiceFactory().getServiceConfigurations().add(0, new XFireCompatibilityServiceConfiguration());
      +
       

      This will the change the namespaces that CXF generates by default so that they are the same as XFire would generate.

      @@ -262,42 +270,42 @@ The spring example above shows the neces

      Fore example, the java class:

      -
      -public class Employee
      +
       

      In XML this translates to:

      -
      -<Employee xmlns="http://xfire.codehaus.org">
      -  <name>Santa Claus</name>
      -  <title>Chief Present Officer (CPO)</title>
      -</Employee>
      -
      +

      In XML Schema this would become a complex type:

      -
      -<xsd:complexType name="Employee">
      -  <xsd:sequence>
      -    <xsd:element name="name" type="xsd:string" minOccurs="0" maxOccurs="1/>
      -    <xsd:element name="title" type="xsd:string" minOccurs="0" maxOccurs="1/>
      -  </xsd:sequence>
      -</xsd:complexType>
      -
      +
      -
Validate your mapping!
You can find an XML Schema for Aegis mapping files here.
+
Validate your mapping!
You can find an XML Schema for Aegis mapping files here.
This version of the XML schema has comments to explain the bits and pieces.

Supported Types

@@ -312,22 +320,22 @@ The spring example above shows the neces

If you have many properties, and you want most, or all of them, to have a minOccurs other than 0 or a nillable other than false, you can change the defaults for Aegis from Java code (amongst other places).
Here is an example: it extracts the binding provider from the service factory, and changes the configuration parameters.

-
-ServerFactoryBean sf = new ServerFactoryBean();
+
 

More Information....

Modified: websites/production/cxf/content/docs/aegis-default-mappings.html ============================================================================== --- websites/production/cxf/content/docs/aegis-default-mappings.html (original) +++ websites/production/cxf/content/docs/aegis-default-mappings.html Mon Jun 24 17:10:51 2013 @@ -25,6 +25,8 @@ + + Apache CXF -- Aegis Default Mappings @@ -42,19 +44,15 @@ Apache CXF -- Aegis Default Mappings
    -
- +

+
@@ -94,7 +92,7 @@ Apache CXF -- Aegis Default Mappings
-
  • Search +
    • Search
      Modified: websites/production/cxf/content/docs/aegis-mapping-files.html ============================================================================== --- websites/production/cxf/content/docs/aegis-mapping-files.html (original) +++ websites/production/cxf/content/docs/aegis-mapping-files.html Mon Jun 24 17:10:51 2013 @@ -25,6 +25,18 @@ + + + + + + + + + Apache CXF -- Aegis Mapping Files @@ -42,19 +54,15 @@ Apache CXF -- Aegis Mapping Files
    -
- +

+
@@ -94,7 +102,7 @@ Apache CXF -- Aegis Mapping Files
-
  • Search +
    • Search
      @@ -127,17 +135,17 @@ Apache CXF -- Aegis Mapping Files

      Mapping files must exist in the same package as your bean or service class on the class path. In the above example the mapping file would be named "/org/codehaus/xfire/Employee.aegis.xml", with the following format:

      -
      -<mappings>
      -  <mapping uri="" name="">
      -    <method name="methodName">
      -      <return-type mappedName="" componentType=""/>
      -      <parameter index="" mappedName=""/>
      -    </method>
      -    <property name="" mappedName="" style="attribute|element" componentType=""/>
      -  </mapping>
      -</mappings>
      -
      +

      When you are creating ClassName.aegis.xml files to control type mapping, you will have only one mapping element, and you don't need any attributes on the mapping element. You use property elements to specify how to map your properties. You must supply name= to select the property. There are more examples of specific cases below.

      @@ -148,51 +156,51 @@ Apache CXF -- Aegis Mapping Files

      Lets pretend that in the above example you would like the elements names to be capatilized and in the namespace "urn:north-pole:operations". You could achieve this through a mapping file like so:

      -
      -<mappings xmlns:np="urn:north-pole:operations">
      -  <mapping name="np:Employee">
      -    <property name="name" mappedName="Name"/>
      -    <property name="title" mappedName="Title"/>
      -  </mapping>
      -</mappings>
      -
      +

      Notice that the namespace was declared on the mappings element and then the prefix was used to specify the element QNames for the name/title properties.

      This will result in a mapping like so:

      -
      -<np:Employee xmlns:np="urn:north-pole:operations">
      -  <np:Name>Santa Claus</np:Name>
      -  <np:Title>Chief Present Officer (CPO)</np:Title>
      -</np:Employee>
      -
      +

      Ignoring properties

      If you don't want to serialize a certain property it is easy to ignore it:

      -
      -<mappings>
      -  <mapping>
      -    <property name="propertyName" ignore="true"/>
      -  </mapping>
      -</mappings>
      -
      +

      Controlling minOccurs and nillable

      The default Aegis mapping is to assume that, since any Java object can be null, that the corresponding schema elements should have minOccurs of 0 and nillable of true. There are properties on the mappings for to control this.

      -
      +
       

      Using the Aegis basic types

      @@ -200,16 +208,16 @@ Apache CXF -- Aegis Mapping Files

      In order to make use of the various types that Aegis provides in the "org.apache.cxf.aegis.type.basic" package, follow this example which allows the wsdl to use the "xsd:date" instead of the "xsd:dateTime".

      -
      -<mappings xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      -	<mapping>
      -		<property name="birthDate" 
      -			type="org.codehaus.xfire.aegis.type.basic.DateType" 
      -			typeName="xsd:date"
      +
       
      Modified: websites/production/cxf/content/docs/aegis-theory-of-operation-20x.html ============================================================================== --- websites/production/cxf/content/docs/aegis-theory-of-operation-20x.html (original) +++ websites/production/cxf/content/docs/aegis-theory-of-operation-20x.html Mon Jun 24 17:10:51 2013 @@ -25,6 +25,8 @@ + + Apache CXF -- Aegis Theory of Operation (2.0.x) @@ -42,19 +44,15 @@ Apache CXF -- Aegis Theory of Operation
    -
- +

+
@@ -94,7 +92,7 @@ Apache CXF -- Aegis Theory of Operation
-
  • Search +
    • Search
      Modified: websites/production/cxf/content/docs/annotated-aegis-file-schema.html ============================================================================== --- websites/production/cxf/content/docs/annotated-aegis-file-schema.html (original) +++ websites/production/cxf/content/docs/annotated-aegis-file-schema.html Mon Jun 24 17:10:51 2013 @@ -25,6 +25,18 @@ + + + + + + + + + Apache CXF -- Annotated Aegis File Schema @@ -42,19 +54,15 @@ Apache CXF -- Annotated Aegis File Schem
    -
- +

+
@@ -94,7 +102,7 @@ Apache CXF -- Annotated Aegis File Schem
-
  • Search +
    • Search
      @@ -122,111 +130,111 @@ Apache CXF -- Annotated Aegis File Schem
      -
      -<?xml version="1.0" encoding="UTF-8"?>
      +