Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 36326 invoked from network); 1 Aug 2005 05:28:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Aug 2005 05:28:58 -0000 Received: (qmail 42129 invoked by uid 500); 1 Aug 2005 05:28:57 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 41854 invoked by uid 500); 1 Aug 2005 05:28:56 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 41841 invoked by uid 99); 1 Aug 2005 05:28:56 -0000 X-ASF-Spam-Status: No, hits=-9.7 required=10.0 tests=ALL_TRUSTED,NORMAL_HTTP_TO_IP,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 31 Jul 2005 22:28:42 -0700 Received: (qmail 36309 invoked by uid 65534); 1 Aug 2005 05:28:40 -0000 Message-ID: <20050801052840.36308.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r226747 - in /webservices/axis/trunk/java/xdocs: migration.htm navigation.xml Date: Mon, 01 Aug 2005 05:28:39 -0000 To: axis-cvs@ws.apache.org From: hemapani@apache.org X-Mailer: svnmailer-1.0.2 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: hemapani Date: Sun Jul 31 22:28:18 2005 New Revision: 226747 URL: http://svn.apache.org/viewcvs?rev=226747&view=rev Log: checked in the doc for migration from Axis 1.x to Axis2, checked in on bahalf of the Saminda Added: webservices/axis/trunk/java/xdocs/migration.htm Modified: webservices/axis/trunk/java/xdocs/navigation.xml Added: webservices/axis/trunk/java/xdocs/migration.htm URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/xdocs/migration.htm?rev=226747&view=auto ============================================================================== --- webservices/axis/trunk/java/xdocs/migration.htm (added) +++ webservices/axis/trunk/java/xdocs/migration.htm Sun Jul 31 22:28:18 2005 @@ -0,0 +1,109 @@ + +Migration.html + + + + + + + +

Migrating from Axis 1.x to Axis 2

+

Compatibility

+

Axis1.x and Axis2 have been evolved +from different architectures.

+

Speed – Axis2 is based on StAX API, +which gives greater speed than SAX event base parsing that has been used in +Axis1.x.

+

Stability – Axis2 has fixed phases +and for extensions an area of user defined phases. This allows far more +stability and flexibility than Axis1.x.

+

Transport framework - Simple +abstraction designing of transports (i.e., senders and listeners for SOAP over +various protocols such as SMTP, etc), allow far more flexibility and the core of +the engine is completely transport-independent.

+

WSDL Support – Axis2 supports +version 1.1 and 2.0, which allow creating stubs and skeletons, to manipulate web +service arena.

+

Component – Oriented Architecture – +This is merely through archives (.mar and .aar) . Easily reusable components +such as Handlers, Modules allow patterns processing for your applications, or to +distribute to partners. Axis2 more concern on the “Module” concept rather +Handler concept. Modules contain handlers that have been ordered through phase +rules. which being ordered to specific service(s).

+


+

Getting Started

+

Lets look at a simple example of echoing at client +API

+
Axis 1.x
import ..
public class TestClient {
public static void main(String [] args) {
try {
String endpoint = ...
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("http://soapinterop.org/", echoString"));
String ret = (String) call.invoke( new Object[] { "Hello!" } );
System.out.println("Sent 'Hello!', got '" + ret + "'");
} catch (Exception e) {
System.err.println(e.toString());
}
}
}

+
Axis 2
import ....
public class EchoBlockingClient {
private static EndpointReference targetEPR = new EndpointReference(
AddressingConstants.WSA_TO,
"http://127.0.0.1:8080/axis2/services/MyService/echo");
public static void main(String[] args) {
try {
OMElement payload = ClientUtil.getEchoOMElement();
Call call = new Call();
call.setTo(targetEPR);
call.setTransportInfo(Constants.TRANSPORT_HTTP,Constants.TRANSPORT_HTTP,false);
//Blocking invocation
OMElement result = (OMElement) call.invokeBlocking("echo",payload);
...
} catch (AxisFault axisFault) {
axisFault.printStackTrace();
} catch (XMLStreamException e) {
e.printStackTrace();
}
}
}
+


+

It has clearly depicted that the +invocation in Axis2 is dealt with SOAP body element itself. Here the invocation +is synchronous, and Axis2 can handle Asynchronous invocation as well. Above +“payload” is the SOAP body element which should go in the Envelop.

+

Once the service is called through +Stub in Axis2, “payload” is according to the data binding framework that will be +using. So the extra work of “payload” will be vanished.

+

Apart from Synchronous invocation, +Axis2 support Asynchronous invocation through invokeNonBlocking(). +Synchronous/Asynchronous invocations can handle both single/double HTTP +connection.

+

With the advance architecture Axis2 +is capable of handling Megabytes of Requests and Responses, which is far form +Axis1.x.


+

Custom Deployment of +Services, Handlers and Modules

+

In Axis 1.x deployment of services +is via WSDD, which is for my opinion highly cumbersome. Service deployment in +Axis2 is straight forward and dynamic. Dynamic behavior is from the +Administrator facility given by development in server side. It's just a matter +of creating a .aar file, and deploying it ,which more detail is given in the +Axis2 user guide.

+

Axis2 is far way from Handler +concept and more into the Module concept, which is abstractly speaking, a +collection of handlers with Rules of governing. Modules created as a .mar file. +It has module.xml, which is the brain behind manipulating handlers.

+

When a service is called through a +handler, it is just a matter of giving reference to the module that includes the +handler in the service.xml. Apart from that a handler can be directly called to +a particular service, via service.xml, no module is needed, and several handlers +can be invoked when the handlers are registered with the proper phases.

+

Well, Services are hot deployable in +Axis2 and dynamic, but Modules. This is one features, which is unique to +Axis2.

+

In addition this JWS services are +handle through archives.

+

+

Transports for HTTP +Connection

+

Axis2 comes with two basic HTTP +transport senders. HTTPTransportSender and CommonsHTTPTransportSender. The +configuration of the transport is as follows,

call.setTransportInfo(Constants.TRANSPORT_HTTP,

Constants.TRANSPORT_HTTP, false);
+

+
This code snippet for HTTPTransportSender. The +alternative transport sender is the CommonsHTTPTransportSender, which is called +through,

call.setTransportInfo(Constants.TRANSPORT_COMMONS_HTTP,

Constants.TRANSPORT_HTTP,false);
+

It should be noted that axis2.xml +should be configured to call the commos transports, with the statement,

...

<transportSender name="commons-http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">

<parameter name="PROTOCOL" locked="xsd:false">HTTP/1.1</parameter>

<parameter name="Transfer-Encoding" locked="xsd:false">chunked</parameter>

</transportSender>

...

+

In above snippet it should be noted +that transport is configured to handle the chunked stream as well. Some web +services, such as .NET web service invocations are done through this transport, +as it handle all possible HTTP request and responses.

+

Data Binding +Support

+

Xml-beans support data binding. In +Axis2, xml is manipulated via AXIOM, which is based on StAX API. XML give full +schema support. Thus, serialization and deserialization of Xml is handle in +Axis2 via xml-data binding framework.

+

Best Usage

+

Axis1.x and Axis2 have different +ways of seen the SOAP stack. So the best way to migrate can be done through +following the User guide and Architecture guide properly in Axis2. Axis2 is +straight forward and friendly.

+


+


Modified: webservices/axis/trunk/java/xdocs/navigation.xml URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/xdocs/navigation.xml?rev=226747&r1=226746&r2=226747&view=diff ============================================================================== --- webservices/axis/trunk/java/xdocs/navigation.xml (original) +++ webservices/axis/trunk/java/xdocs/navigation.xml Sun Jul 31 22:28:18 2005 @@ -29,7 +29,7 @@ - +