Deploying services on the client side
-------------------------------------

                 Key: AXIS2-1879
                 URL: http://issues.apache.org/jira/browse/AXIS2-1879
             Project: Apache Axis 2.0 (Axis2)
          Issue Type: New Feature
          Components: kernel
    Affects Versions: 1.1
         Environment: All
            Reporter: Sandeep Bhojwani


Purpose of the modification
--------------------------------
Axis2 provides a nice way of deploying services on the server side but no good 
way of doing the same on the client side. All the service deployment features 
provided by Axis2 on the server side can be very easily extended to client 
side. Currently on the server side you can package a service as a .aar file and 
deploy it. On the client side, however, you need to pass the wsdl url to the 
ServiceClient to send a message to a service.  

The proposed modification uses the same deployment features that are available 
on the server side for application on the client side. So with the proposed 
modification you can deploy a .aar file for use on the client side. Infact you 
can take the same .aar file from your server and put it on your client. This is 
very useful in the case where you are writing intermediaries and you are not 
using ServiceClient but instead calling the AxisEngine directly. 

The change is very minimal and has no impact on existing code. 


Details of the Modification
--------------------------------
When a service is loaded by Axis2 it makes an assumption that it needs to be 
loaded as server side. The idea is to not make that assumption and let the user 
specify via a parameter in the axis config file how the Engine should use the 
service. 
Deployment Engine will look for this config parameter("isclientside") and set 
server side to true or false based on that.

Here's the config parameter..

<!-- Added by Sandeep Bhojwani([EMAIL PROTECTED]), Trailside Systems.
    isclientside is used to indicate whether the services/wsdls deployed are to 
be
    used on the client side. If client side is set to true then a wsdl that 
declares a service
    of type in-out will be interpreted as out-in because that's how the client 
will have to treat it.
    The core axis Engine supports both client and server message flows. The 
Engine only needs to know
    whether the service is to be treated as client side or server side.
    -->
    <parameter name="isclientside" locked="false">false</parameter>       


Here's the code snippet that demonstrates the change that can be made to  
DeploymentEngine code..
...
...  

AxisService axisService = null;
InputStream wsdlStream = serviceClassLoader.getResourceAsStream(metainf + 
"/service.wsdl");
if (wsdlStream == null) 
{
wsdlStream = serviceClassLoader.getResourceAsStream(metainf + "/" + serviceName 
+ ".wsdl");
}
if (wsdlStream != null)
{
WSDL11ToAxisServiceBuilder wsdl2AxisServiceBuilder = new 
WSDL11ToAxisServiceBuilder(wsdlStream, null, null);

/* TODO: Added by Sandeep Bhojwani([EMAIL PROTECTED]), Trailside Systems.
* check if service is to be loaded for use on client side or server side
*/
wsdl2AxisServiceBuilder.setServerSide(!isClientSide);
axisService = wsdl2AxisServiceBuilder.populateService();
...
...

The big difference in treating a service on the client as opposed to server is 
in the MEP(Message Exchange Pattern). A wsdl with an in-out service when loaded 
on the server will create an In-OUT Operation whereas on the client side it 
will create a OUT-IN operation. A rversal of MEP. IN becomes OUT and OUT 
becomes IN.

I have all the required modifications to 1.1 in a zip file.   

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to