[ 
http://issues.apache.org/jira/browse/AXIS2-1879?page=comments#action_12459208 ] 
            
Sandeep Bhojwani commented on AXIS2-1879:
-----------------------------------------

Hi David,
I am not using ServiceClient..My code has to handle
lot of requests and the blocking and the pseudo
nonblocking APIs of ServiceClient are not useful to
me. I have written my own ServiceClient, transport
receivers and senders. I am using axis2 kernel for WS
processing.

The issue I am talking of has to do with the kernel
service deployment feature.

The Kernel supports flows for both client and server
and also supports creating service from WSDLs inside a
.aar file. The deployment supports hotupdate,
hotdeployment. These can be useful on the client side
as well. Please note i am not talking of a typical
client that deals with 3-4 services. My client deals
with many services and i want hot deployment and
update.

A good example of a project that uses Axis2 in an
embedded fashion is Apache Synapse.

The kernel supports aar based deployment but during
aar loading the Engine deployment always says
..setServerSide(true)..this will make it create
Operations for use on the server side.ex: A WSDL that
has a request response type of operation will create
an operation of  type In-Out. On client side it needs
to create an operation of type Out-In.

With my small change the kernel can claim to support
aars on the client side. It seems like that the kernel
was written to be not biased towards client or server
but this goal was maybe overlooked for the deployment.


I would really appreciate if the people who wrote the
Kernel can comment on it and maybe let me add the
modification. Axis2 kernel can be used in
intermediaries. Why restrict it!?

-Sandeep


http://issues.apache.org/jira/browse/AXIS2-1879?page=comments#action_12458968
wsdl2AxisServiceBuilder.setServerSide(!isClientSide);
http://issues.apache.org/jira/secure/Administrators.jspa



> 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
>         Attachments: clientside-deployment-axis2-1.1.zip
>
>
> 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