You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Bhat B, Niranjan (NSN - IN/Bangalore)" <ni...@nsn.com> on 2011/07/08 12:31:16 UTC

Attaching huge attachments in axis2

Hi All,

Recently I had a use case of attaching a huge attachment file(around 500 MB) in the request to a webservice.
But however, when I tried to do this I see out of memory errors in application logs.
Can you please let me know the efficient way of attaching huge attachment files in the request to a webservice ?
I am using SWA attachment APIs.

regards,
Niranjan

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Attaching huge attachments in axis2

Posted by Jorge Medina <ce...@gmail.com>.
You may want to verify that the attachment is sent as SwA or MTOM and
not as base64binary embedded into the XML.
You may use TCPMon to verify what it is being sent. Try with a small file.


On Fri, Jul 15, 2011 at 10:01 PM, Jorge Medina
<ce...@gmail.com> wrote:
> Never mind, after looking at the Axis2 source code now it is clear  to
> me that the error is coming from the server.
>
> You need to modify the server side.
> There is nothing you can do in the client side to prevent such error
> in the server.
> The server may be reading the whole attachment before processing it.
>
>
>
> On Fri, Jul 15, 2011 at 9:41 PM, Jorge Medina
> <ce...@gmail.com> wrote:
>> I am not clear, Is the message " OutOfMemoryError " coming from the server?
>> Or is it your client code running out of memory?
>>
>> I think it is your client code running out of memory because your
>> stack trace contains:
>>   org.apache.axis2.description.OutInAxisOperationClient.send
>> rather than
>>   org.apache.axis2.description.OutInAxisOperationClient.receive
>>
>> Post the segment of code you use to transfer the file.
>>
>>
>>
>>
>> On Mon, Jul 11, 2011 at 4:56 AM, Bhat B, Niranjan (NSN - IN/Bangalore)
>> <ni...@nsn.com> wrote:
>>> Hi Jorge,
>>>
>>> I am sorry for the misunderstanding here.
>>> Let me put it in other words,
>>> In the client code I am trying to attach huge file and send it to the
>>> server where the webservice is attached.
>>> So I get this stack trace with OutOfMemory error in the client side when
>>> I try to upload this huge file to the webservice:
>>>
>>> --cut--
>>> Sending ReportOperationStatus
>>> ['..\esymacstarter\gmoTemp\osr_13101481196870.xml'] to following
>>> manager: 421506509 (to URL
>>> http://localhost:8081/axis2/services/NE3SOperationNotificationService)
>>> ERROR 08-Jul-2011 23:32:17.734 - AxisFault: ReportOperationStatus
>>> sending failed. (..\esymacstarter\gmoTemp\osr_13101481196870.xml to
>>> following manager: 421506509 to URL
>>> http://localhost:8081/axis2/services/NE3SOperationNotificationService)
>>> org.apache.axis2.AxisFault: java.lang.OutOfMemoryError: Java heap space
>>>        at
>>> org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java
>>> :435)
>>>        at
>>> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(Out
>>> InAxisOperation.java:371)
>>>        at
>>> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOper
>>> ation.java:417)
>>>        at
>>> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInA
>>> xisOperation.java:229)
>>>        at
>>> org.apache.axis2.client.OperationClient.execute(OperationClient.java:165
>>> )
>>>        at
>>> com.nokiasiemens.www.ne3s._1_0.NE3SOperationNotificationServiceStub.repo
>>> rtOperationStatus(NE3SOperationNotificationServiceStub.java:604)
>>>        at
>>> com.nokia.j2ssp.comp.esymac.common.soapAdapter.notification.ReportOperat
>>> ionStatusSender.sendOperationStatusResponse(ReportOperationStatusSender.
>>> java:99)
>>>        at
>>> com.nokia.j2ssp.comp.esymac.common.soapAdapter.notification.Notification
>>> SenderThreader.operationStatusResponse(NotificationSenderThreader.java:1
>>> 094)
>>>        at
>>> com.nokia.j2ssp.comp.esymac.common.soapAdapter.notification.Notification
>>> SenderThreader.access$200(NotificationSenderThreader.java:36)
>>>        at
>>> com.nokia.j2ssp.comp.esymac.common.soapAdapter.notification.Notification
>>> SenderThreader$SenderThread.run(NotificationSenderThreader.java:420)
>>> --cut--
>>>
>>> -----Original Message-----
>>> From: ext Jorge Medina [mailto:cerebrotecnologico@gmail.com]
>>> Sent: Saturday, July 09, 2011 7:26 AM
>>> To: java-user@axis.apache.org
>>> Subject: Re: Attaching huge attachments in axis2
>>>
>>> Make sure you stream the file.
>>>
>>> I use SpringWS on the server side and Axis2 in the client side for
>>> downloading files. In the server side, I spawn a new thread to write
>>> the attachment portion using PipedInputStream/PipedOutputStream.
>>>
>>> To do an upload, I would do the same. Spawn a new thread to read the
>>> attachment using  PipedInputStream/PipedOutputStream from the stream
>>> obtained from the DataHandler, connect the piped streams to the
>>> FileInputStream you use to read the file.
>>>
>>> -Jorge
>>>
>>>
>>>
>>> On Fri, Jul 8, 2011 at 6:31 AM, Bhat B, Niranjan (NSN - IN/Bangalore)
>>> <ni...@nsn.com> wrote:
>>>>
>>>> Hi All,
>>>>
>>>> Recently I had a use case of attaching a huge attachment file(around
>>> 500 MB) in the request to a webservice.
>>>> But however, when I tried to do this I see out of memory errors in
>>> application logs.
>>>> Can you please let me know the efficient way of attaching huge
>>> attachment files in the request to a webservice ?
>>>> I am using SWA attachment APIs.
>>>>
>>>> regards,
>>>> Niranjan
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>>>> For additional commands, e-mail: java-user-help@axis.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>>> For additional commands, e-mail: java-user-help@axis.apache.org
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>>> For additional commands, e-mail: java-user-help@axis.apache.org
>>>
>>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Attaching huge attachments in axis2

Posted by Jorge Medina <ce...@gmail.com>.
Never mind, after looking at the Axis2 source code now it is clear  to
me that the error is coming from the server.

You need to modify the server side.
There is nothing you can do in the client side to prevent such error
in the server.
The server may be reading the whole attachment before processing it.



On Fri, Jul 15, 2011 at 9:41 PM, Jorge Medina
<ce...@gmail.com> wrote:
> I am not clear, Is the message " OutOfMemoryError " coming from the server?
> Or is it your client code running out of memory?
>
> I think it is your client code running out of memory because your
> stack trace contains:
>   org.apache.axis2.description.OutInAxisOperationClient.send
> rather than
>   org.apache.axis2.description.OutInAxisOperationClient.receive
>
> Post the segment of code you use to transfer the file.
>
>
>
>
> On Mon, Jul 11, 2011 at 4:56 AM, Bhat B, Niranjan (NSN - IN/Bangalore)
> <ni...@nsn.com> wrote:
>> Hi Jorge,
>>
>> I am sorry for the misunderstanding here.
>> Let me put it in other words,
>> In the client code I am trying to attach huge file and send it to the
>> server where the webservice is attached.
>> So I get this stack trace with OutOfMemory error in the client side when
>> I try to upload this huge file to the webservice:
>>
>> --cut--
>> Sending ReportOperationStatus
>> ['..\esymacstarter\gmoTemp\osr_13101481196870.xml'] to following
>> manager: 421506509 (to URL
>> http://localhost:8081/axis2/services/NE3SOperationNotificationService)
>> ERROR 08-Jul-2011 23:32:17.734 - AxisFault: ReportOperationStatus
>> sending failed. (..\esymacstarter\gmoTemp\osr_13101481196870.xml to
>> following manager: 421506509 to URL
>> http://localhost:8081/axis2/services/NE3SOperationNotificationService)
>> org.apache.axis2.AxisFault: java.lang.OutOfMemoryError: Java heap space
>>        at
>> org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java
>> :435)
>>        at
>> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(Out
>> InAxisOperation.java:371)
>>        at
>> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOper
>> ation.java:417)
>>        at
>> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInA
>> xisOperation.java:229)
>>        at
>> org.apache.axis2.client.OperationClient.execute(OperationClient.java:165
>> )
>>        at
>> com.nokiasiemens.www.ne3s._1_0.NE3SOperationNotificationServiceStub.repo
>> rtOperationStatus(NE3SOperationNotificationServiceStub.java:604)
>>        at
>> com.nokia.j2ssp.comp.esymac.common.soapAdapter.notification.ReportOperat
>> ionStatusSender.sendOperationStatusResponse(ReportOperationStatusSender.
>> java:99)
>>        at
>> com.nokia.j2ssp.comp.esymac.common.soapAdapter.notification.Notification
>> SenderThreader.operationStatusResponse(NotificationSenderThreader.java:1
>> 094)
>>        at
>> com.nokia.j2ssp.comp.esymac.common.soapAdapter.notification.Notification
>> SenderThreader.access$200(NotificationSenderThreader.java:36)
>>        at
>> com.nokia.j2ssp.comp.esymac.common.soapAdapter.notification.Notification
>> SenderThreader$SenderThread.run(NotificationSenderThreader.java:420)
>> --cut--
>>
>> -----Original Message-----
>> From: ext Jorge Medina [mailto:cerebrotecnologico@gmail.com]
>> Sent: Saturday, July 09, 2011 7:26 AM
>> To: java-user@axis.apache.org
>> Subject: Re: Attaching huge attachments in axis2
>>
>> Make sure you stream the file.
>>
>> I use SpringWS on the server side and Axis2 in the client side for
>> downloading files. In the server side, I spawn a new thread to write
>> the attachment portion using PipedInputStream/PipedOutputStream.
>>
>> To do an upload, I would do the same. Spawn a new thread to read the
>> attachment using  PipedInputStream/PipedOutputStream from the stream
>> obtained from the DataHandler, connect the piped streams to the
>> FileInputStream you use to read the file.
>>
>> -Jorge
>>
>>
>>
>> On Fri, Jul 8, 2011 at 6:31 AM, Bhat B, Niranjan (NSN - IN/Bangalore)
>> <ni...@nsn.com> wrote:
>>>
>>> Hi All,
>>>
>>> Recently I had a use case of attaching a huge attachment file(around
>> 500 MB) in the request to a webservice.
>>> But however, when I tried to do this I see out of memory errors in
>> application logs.
>>> Can you please let me know the efficient way of attaching huge
>> attachment files in the request to a webservice ?
>>> I am using SWA attachment APIs.
>>>
>>> regards,
>>> Niranjan
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>>> For additional commands, e-mail: java-user-help@axis.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Attaching huge attachments in axis2

Posted by Jorge Medina <ce...@gmail.com>.
I am not clear, Is the message " OutOfMemoryError " coming from the server?
Or is it your client code running out of memory?

I think it is your client code running out of memory because your
stack trace contains:
   org.apache.axis2.description.OutInAxisOperationClient.send
rather than
   org.apache.axis2.description.OutInAxisOperationClient.receive

Post the segment of code you use to transfer the file.




On Mon, Jul 11, 2011 at 4:56 AM, Bhat B, Niranjan (NSN - IN/Bangalore)
<ni...@nsn.com> wrote:
> Hi Jorge,
>
> I am sorry for the misunderstanding here.
> Let me put it in other words,
> In the client code I am trying to attach huge file and send it to the
> server where the webservice is attached.
> So I get this stack trace with OutOfMemory error in the client side when
> I try to upload this huge file to the webservice:
>
> --cut--
> Sending ReportOperationStatus
> ['..\esymacstarter\gmoTemp\osr_13101481196870.xml'] to following
> manager: 421506509 (to URL
> http://localhost:8081/axis2/services/NE3SOperationNotificationService)
> ERROR 08-Jul-2011 23:32:17.734 - AxisFault: ReportOperationStatus
> sending failed. (..\esymacstarter\gmoTemp\osr_13101481196870.xml to
> following manager: 421506509 to URL
> http://localhost:8081/axis2/services/NE3SOperationNotificationService)
> org.apache.axis2.AxisFault: java.lang.OutOfMemoryError: Java heap space
>        at
> org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java
> :435)
>        at
> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(Out
> InAxisOperation.java:371)
>        at
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOper
> ation.java:417)
>        at
> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInA
> xisOperation.java:229)
>        at
> org.apache.axis2.client.OperationClient.execute(OperationClient.java:165
> )
>        at
> com.nokiasiemens.www.ne3s._1_0.NE3SOperationNotificationServiceStub.repo
> rtOperationStatus(NE3SOperationNotificationServiceStub.java:604)
>        at
> com.nokia.j2ssp.comp.esymac.common.soapAdapter.notification.ReportOperat
> ionStatusSender.sendOperationStatusResponse(ReportOperationStatusSender.
> java:99)
>        at
> com.nokia.j2ssp.comp.esymac.common.soapAdapter.notification.Notification
> SenderThreader.operationStatusResponse(NotificationSenderThreader.java:1
> 094)
>        at
> com.nokia.j2ssp.comp.esymac.common.soapAdapter.notification.Notification
> SenderThreader.access$200(NotificationSenderThreader.java:36)
>        at
> com.nokia.j2ssp.comp.esymac.common.soapAdapter.notification.Notification
> SenderThreader$SenderThread.run(NotificationSenderThreader.java:420)
> --cut--
>
> -----Original Message-----
> From: ext Jorge Medina [mailto:cerebrotecnologico@gmail.com]
> Sent: Saturday, July 09, 2011 7:26 AM
> To: java-user@axis.apache.org
> Subject: Re: Attaching huge attachments in axis2
>
> Make sure you stream the file.
>
> I use SpringWS on the server side and Axis2 in the client side for
> downloading files. In the server side, I spawn a new thread to write
> the attachment portion using PipedInputStream/PipedOutputStream.
>
> To do an upload, I would do the same. Spawn a new thread to read the
> attachment using  PipedInputStream/PipedOutputStream from the stream
> obtained from the DataHandler, connect the piped streams to the
> FileInputStream you use to read the file.
>
> -Jorge
>
>
>
> On Fri, Jul 8, 2011 at 6:31 AM, Bhat B, Niranjan (NSN - IN/Bangalore)
> <ni...@nsn.com> wrote:
>>
>> Hi All,
>>
>> Recently I had a use case of attaching a huge attachment file(around
> 500 MB) in the request to a webservice.
>> But however, when I tried to do this I see out of memory errors in
> application logs.
>> Can you please let me know the efficient way of attaching huge
> attachment files in the request to a webservice ?
>> I am using SWA attachment APIs.
>>
>> regards,
>> Niranjan
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


RE: How to get username/password on the service side by using rampart

Posted by Dipesh Garg <di...@erevmax.com>.
Is any good e-book for Axis2

 

Dipesh Garg

 

  _____  

From: Thilina Mahesh Buddhika [mailto:thilinamb@gmail.com] 
Sent: Wednesday, August 17, 2011 2:57 PM
To: java-user@axis.apache.org
Subject: Re: How to get username/password on the service side by using
rampart

 

Hi Jing,

 

By looking at the code segments and configurations, I could not identify
anything suspicious. I am not sure whether there is a bug in this particular
version.

 

Is it possible for you to try this with the latest release (Rampart 1.5.1
and Axis2 1.5.5). Also please try to use the policy based configuration,
because that is the model we encourage users to follow. You can find a
similar scenario in the first sample of under the policy section in the
Rampart distribution.

 

Thanks,

Thilina

On Wed, Aug 17, 2011 at 5:15 AM, jing <ta...@nceas.ucsb.edu> wrote:

Hi, everyone:

I am using rampart-1.4 to secure a axis2-1.4 web service.

Here is my setting on client.axis2.xml for rampart:

<module ref="rampart" />
<parameter name="OutflowSecurity">
<action>
<items>UsernameToken Timestamp</items>
<user>wsuser</user>
<passwordCallbackClass>org.kepler.executionWS.client.PWHandlerClient</passwo
rdCallbackClass>
</action>
</parameter>

The PWHandlerClient class will read a property file to set password for
wsuser:
 public class PWHandlerClient implements CallbackHandler {

   private static final String WS_USER_PROPS =
"conf/UserManagement.properties";


   public void handle (Callback[] callbacks) throws IOException,
UnsupportedCallbackException {

       for (int i = 0; i < callbacks.length; i++) {
           WSPasswordCallback pwcb = (WSPasswordCallback) callbacks[i];
           String id = pwcb.getIdentifer();
           if (id == null)
               System.out.println("no users");
           //get user info from configuration file
           try {
               Properties pros = new Properties();
               BufferedInputStream prosFile = new BufferedInputStream(new
FileInputStream(WS_USER_PROPS));
               pros.load(prosFile);
               pwcb.setPassword(pros.getProperty(id));
           } catch (FileNotFoundException e) {
               e.printStackTrace();
           } catch (IOException e) {
               e.printStackTrace();
           } catch (Exception e) {
               e.printStackTrace();
           }
       }
   }
}


Here is my services.xml about the rampart on my service side:
<module ref="rampart" />
<parameter name="InflowSecurity">
<action>
<items>UsernameToken Timestamp</items>
<passwordCallbackClass>org.kepler.executionWS.PWHandlerServer</passwordCallb
ackClass>
</action>
</parameter>

The PWHandlerServer class looks like:
 public void handle (Callback[] callbacks) throws IOException,
UnsupportedCallbackException {
       for (int i = 0; i < callbacks.length; i++) {
           if (callbacks[i] instanceof WSPasswordCallback) {
               WSPasswordCallback pc = (WSPasswordCallback) callbacks[i];
               System.out.println(""+i+"=========== the identifier is
"+pc.getIdentifer());
               System.out.println(""+i+"=========== the usag is
"+pc.getUsage());
               System.out.println(""+i+"=========== the password is
"+pc.getPassword());
               pc.setPassword("wsuserPass");
           }
       }
       System.out.println("reach the end =====!");
   }

The output always is:
0=========== the identifier is wsuser
0=========== the usag is 2
0=========== the password is null
reach the end =====!

You see, the service PWHandlerServer couldn't get the password. The value is
null. I have to manually set the password by:
pc.setPassword("wsuserPass");

By the way, the username/password (they wsuser/wsuserPass) was sent to the
service correctly. If i set a different password by:
pc.setPassword("hello") on the service side,my code will get a
WSSecurityException.


My purpose is:  if i can get the username/password pair on service side, I
can send this pair to a ldap server to authenticate if the username/password
from client is valid. If it is valid, the operation will be continue.
Otherwise, it stops.

I looked an article on this page:
http://wso2.org/library/3190#Step_3._Engaging_Rampart_and_setting_authentica
tion_information
On service side, it has some code like:

 public void handle(Callback[] callbacks) throws IOException,
           UnsupportedCallbackException {

       for (int i = 0; i<  callbacks.length; i++) {

           //When the server side need to authenticate the user
           WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];

           if(pwcb.getIdentifer().equals("apache")&&
pwcb.getPassword().equals("password")) {
               //If authentication successful, simply return
               return;
           } else {
               throw new UnsupportedCallbackException(callbacks[i], "check
failed");
           }

       }
   }

It seems his code can get the password on service's CallbackHandler.

Do you have any idea why i can't get the password on the service side?

Thank you very much!

Regards,

Jing


By the way, my client code is:
   /**
    * Constructor
    */
   public KeplerExeWSClient(String endPoint, boolean loadConfigFromJar)
throws Exception{
       this.loadConfigFromJar = loadConfigFromJar;
       options = new Options();
       options.setProperty(Constants.Configuration.ENABLE_SWA,
               Constants.VALUE_TRUE);
 
options.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
       // Increase the time out when sending large attachments
       options.setTimeOutInMilliSeconds(1000000);
       EndpointReference epr = new EndpointReference(endPoint);
       options.setTo(epr);
       if (loadConfigFromJar) {
           //System.out.println("load config from jar");
           cofigContext =
ConfigurationContextFactory.createDefaultConfigurationContext();

       } else {
           //System.out.println("load config from file system");
           cofigContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(this.ax
is2ModulePath, this.axis2xmlPath);
       }
   }

   /**
    * Get the status of a workflowRun with given id
    * @param workflowRunId
    * @return
    */
   public String getStatus(String workflowRunId) throws Exception
   {
       String action = "getStatus";
       options.setAction("urn:"+action);
       OperationClient keplerWSClient = createOperationClient(options);
       MessageContext mc = createMessageWithoutAttach(action,
workflowRunId);
       keplerWSClient.addMessageContext(mc);
       keplerWSClient.execute(true);

        //Let's get the message context for the response
       OMElement outputs = getResponseOMElement(keplerWSClient, action);
       //get corresponding output
       OMElement outputOME = outputs.getFirstChildWithName(new
QName(KEPLER_NAME_SPACE,"return"));

       return outputOME.getText();
   }

   /*
    * Creates an OperationClient object
    */
   private OperationClient createOperationClient(Options options) throws
Exception
   {
       ServiceClient sender = new ServiceClient(cofigContext, null);
       sender.setOptions(options);
       OperationClient keplerWSClient = sender
               .createClient(ServiceClient.ANON_OUT_IN_OP);
       return keplerWSClient;
   }




---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org





 

-- 
Thilina Mahesh Buddhika
http://blog.thilinamb.com


Re: How to get username/password on the service side by using rampart

Posted by Thilina Mahesh Buddhika <th...@gmail.com>.
Hi Jing,

By looking at the code segments and configurations, I could not identify
anything suspicious. I am not sure whether there is a bug in this particular
version.

Is it possible for you to try this with the latest release (Rampart 1.5.1
and Axis2 1.5.5). Also please try to use the policy based configuration,
because that is the model we encourage users to follow. You can find a
similar scenario in the first sample of under the policy section in the
Rampart distribution.

Thanks,
Thilina

On Wed, Aug 17, 2011 at 5:15 AM, jing <ta...@nceas.ucsb.edu> wrote:

> Hi, everyone:
>
> I am using rampart-1.4 to secure a axis2-1.4 web service.
>
> Here is my setting on client.axis2.xml for rampart:
>
> <module ref="rampart" />
> <parameter name="OutflowSecurity">
> <action>
> <items>UsernameToken Timestamp</items>
> <user>wsuser</user>
> <passwordCallbackClass>org.**kepler.executionWS.client.**PWHandlerClient</
> **passwordCallbackClass>
> </action>
> </parameter>
>
> The PWHandlerClient class will read a property file to set password for
> wsuser:
>  public class PWHandlerClient implements CallbackHandler {
>
>    private static final String WS_USER_PROPS = "conf/UserManagement.**
> properties";
>
>
>    public void handle (Callback[] callbacks) throws IOException,
> UnsupportedCallbackException {
>
>        for (int i = 0; i < callbacks.length; i++) {
>            WSPasswordCallback pwcb = (WSPasswordCallback) callbacks[i];
>            String id = pwcb.getIdentifer();
>            if (id == null)
>                System.out.println("no users");
>            //get user info from configuration file
>            try {
>                Properties pros = new Properties();
>                BufferedInputStream prosFile = new BufferedInputStream(new
> FileInputStream(WS_USER_PROPS)**);
>                pros.load(prosFile);
>                pwcb.setPassword(pros.**getProperty(id));
>            } catch (FileNotFoundException e) {
>                e.printStackTrace();
>            } catch (IOException e) {
>                e.printStackTrace();
>            } catch (Exception e) {
>                e.printStackTrace();
>            }
>        }
>    }
> }
>
>
> Here is my services.xml about the rampart on my service side:
> <module ref="rampart" />
> <parameter name="InflowSecurity">
> <action>
> <items>UsernameToken Timestamp</items>
> <passwordCallbackClass>org.**kepler.executionWS.**PWHandlerServer</**
> passwordCallbackClass>
> </action>
> </parameter>
>
> The PWHandlerServer class looks like:
>  public void handle (Callback[] callbacks) throws IOException,
> UnsupportedCallbackException {
>        for (int i = 0; i < callbacks.length; i++) {
>            if (callbacks[i] instanceof WSPasswordCallback) {
>                WSPasswordCallback pc = (WSPasswordCallback) callbacks[i];
>                System.out.println(""+i+"=====**====== the identifier is
> "+pc.getIdentifer());
>                System.out.println(""+i+"=====**====== the usag is
> "+pc.getUsage());
>                System.out.println(""+i+"=====**====== the password is
> "+pc.getPassword());
>                pc.setPassword("wsuserPass");
>            }
>        }
>        System.out.println("reach the end =====!");
>    }
>
> The output always is:
> 0=========== the identifier is wsuser
> 0=========== the usag is 2
> 0=========== the password is null
> reach the end =====!
>
> You see, the service PWHandlerServer couldn't get the password. The value
> is null. I have to manually set the password by:
> pc.setPassword("wsuserPass");
>
> By the way, the username/password (they wsuser/wsuserPass) was sent to the
> service correctly. If i set a different password by:
> pc.setPassword("hello") on the service side,my code will get a
> WSSecurityException.
>
>
> My purpose is:  if i can get the username/password pair on service side, I
> can send this pair to a ldap server to authenticate if the username/password
> from client is valid. If it is valid, the operation will be continue.
> Otherwise, it stops.
>
> I looked an article on this page:
> http://wso2.org/library/3190#**Step_3._Engaging_Rampart_and_**
> setting_authentication_**information<http://wso2.org/library/3190#Step_3._Engaging_Rampart_and_setting_authentication_information>
> On service side, it has some code like:
>
>  public void handle(Callback[] callbacks) throws IOException,
>            UnsupportedCallbackException {
>
>        for (int i = 0; i<  callbacks.length; i++) {
>
>            //When the server side need to authenticate the user
>            WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[**i];
>
>            if(pwcb.getIdentifer().equals(**"apache")&&
>  pwcb.getPassword().equals("**password")) {
>                //If authentication successful, simply return
>                return;
>            } else {
>                throw new UnsupportedCallbackException(**callbacks[i],
> "check failed");
>            }
>
>        }
>    }
>
> It seems his code can get the password on service's CallbackHandler.
>
> Do you have any idea why i can't get the password on the service side?
>
> Thank you very much!
>
> Regards,
>
> Jing
>
>
> By the way, my client code is:
>    /**
>     * Constructor
>     */
>    public KeplerExeWSClient(String endPoint, boolean loadConfigFromJar)
> throws Exception{
>        this.loadConfigFromJar = loadConfigFromJar;
>        options = new Options();
>        options.setProperty(Constants.**Configuration.ENABLE_SWA,
>                Constants.VALUE_TRUE);
>        options.setSoapVersionURI(**SOAP11Constants.SOAP_ENVELOPE_**
> NAMESPACE_URI);
>        // Increase the time out when sending large attachments
>        options.**setTimeOutInMilliSeconds(**1000000);
>        EndpointReference epr = new EndpointReference(endPoint);
>        options.setTo(epr);
>        if (loadConfigFromJar) {
>            //System.out.println("load config from jar");
>            cofigContext = ConfigurationContextFactory.**
> createDefaultConfigurationCont**ext();
>
>        } else {
>            //System.out.println("load config from file system");
>            cofigContext = ConfigurationContextFactory.**
> createConfigurationContextFrom**FileSystem(this.**axis2ModulePath,
> this.axis2xmlPath);
>        }
>    }
>
>    /**
>     * Get the status of a workflowRun with given id
>     * @param workflowRunId
>     * @return
>     */
>    public String getStatus(String workflowRunId) throws Exception
>    {
>        String action = "getStatus";
>        options.setAction("urn:"+**action);
>        OperationClient keplerWSClient = createOperationClient(options)**;
>        MessageContext mc = createMessageWithoutAttach(**action,
> workflowRunId);
>        keplerWSClient.**addMessageContext(mc);
>        keplerWSClient.execute(true);
>
>         //Let's get the message context for the response
>        OMElement outputs = getResponseOMElement(**keplerWSClient, action);
>        //get corresponding output
>        OMElement outputOME = outputs.getFirstChildWithName(**new
> QName(KEPLER_NAME_SPACE,"**return"));
>
>        return outputOME.getText();
>    }
>
>    /*
>     * Creates an OperationClient object
>     */
>    private OperationClient createOperationClient(Options options) throws
> Exception
>    {
>        ServiceClient sender = new ServiceClient(cofigContext, null);
>        sender.setOptions(options);
>        OperationClient keplerWSClient = sender
>                .createClient(ServiceClient.**ANON_OUT_IN_OP);
>        return keplerWSClient;
>    }
>
>
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.**apache.org<ja...@axis.apache.org>
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>


-- 
Thilina Mahesh Buddhika
http://blog.thilinamb.com

How to get username/password on the service side by using rampart

Posted by jing <ta...@nceas.ucsb.edu>.
Hi, everyone:

I am using rampart-1.4 to secure a axis2-1.4 web service.

Here is my setting on client.axis2.xml for rampart:

<module ref="rampart" />
<parameter name="OutflowSecurity">
<action>
<items>UsernameToken Timestamp</items>
<user>wsuser</user>
<passwordCallbackClass>org.kepler.executionWS.client.PWHandlerClient</passwordCallbackClass>
</action>
</parameter>

The PWHandlerClient class will read a property file to set password for 
wsuser:
  public class PWHandlerClient implements CallbackHandler {

     private static final String WS_USER_PROPS = 
"conf/UserManagement.properties";


     public void handle (Callback[] callbacks) throws IOException, 
UnsupportedCallbackException {

         for (int i = 0; i < callbacks.length; i++) {
             WSPasswordCallback pwcb = (WSPasswordCallback) callbacks[i];
             String id = pwcb.getIdentifer();
             if (id == null)
                 System.out.println("no users");
             //get user info from configuration file
             try {
                 Properties pros = new Properties();
                 BufferedInputStream prosFile = new 
BufferedInputStream(new FileInputStream(WS_USER_PROPS));
                 pros.load(prosFile);
                 pwcb.setPassword(pros.getProperty(id));
             } catch (FileNotFoundException e) {
                 e.printStackTrace();
             } catch (IOException e) {
                 e.printStackTrace();
             } catch (Exception e) {
                 e.printStackTrace();
             }
         }
     }
}


Here is my services.xml about the rampart on my service side:
<module ref="rampart" />
<parameter name="InflowSecurity">
<action>
<items>UsernameToken Timestamp</items>
<passwordCallbackClass>org.kepler.executionWS.PWHandlerServer</passwordCallbackClass>
</action>
</parameter>

The PWHandlerServer class looks like:
  public void handle (Callback[] callbacks) throws IOException, 
UnsupportedCallbackException {
         for (int i = 0; i < callbacks.length; i++) {
             if (callbacks[i] instanceof WSPasswordCallback) {
                 WSPasswordCallback pc = (WSPasswordCallback) callbacks[i];
                 System.out.println(""+i+"=========== the identifier is 
"+pc.getIdentifer());
                 System.out.println(""+i+"=========== the usag is 
"+pc.getUsage());
                 System.out.println(""+i+"=========== the password is 
"+pc.getPassword());
                 pc.setPassword("wsuserPass");
             }
         }
         System.out.println("reach the end =====!");
     }

The output always is:
0=========== the identifier is wsuser
0=========== the usag is 2
0=========== the password is null
reach the end =====!

You see, the service PWHandlerServer couldn't get the password. The 
value is null. I have to manually set the password by:
pc.setPassword("wsuserPass");

By the way, the username/password (they wsuser/wsuserPass) was sent to 
the service correctly. If i set a different password by:
pc.setPassword("hello") on the service side,my code will get a 
WSSecurityException.


My purpose is:  if i can get the username/password pair on service side, 
I can send this pair to a ldap server to authenticate if the 
username/password from client is valid. If it is valid, the operation 
will be continue. Otherwise, it stops.

I looked an article on this page:
http://wso2.org/library/3190#Step_3._Engaging_Rampart_and_setting_authentication_information
On service side, it has some code like:

  public void handle(Callback[] callbacks) throws IOException,
             UnsupportedCallbackException {

         for (int i = 0; i<  callbacks.length; i++) {

             //When the server side need to authenticate the user
             WSPasswordCallback pwcb = (WSPasswordCallback)callbacks[i];

             if(pwcb.getIdentifer().equals("apache")&&  pwcb.getPassword().equals("password")) {
                 //If authentication successful, simply return
                 return;
             } else {
                 throw new UnsupportedCallbackException(callbacks[i], "check failed");
             }

         }
     }

It seems his code can get the password on service's CallbackHandler.

Do you have any idea why i can't get the password on the service side?

Thank you very much!

Regards,

Jing


By the way, my client code is:
     /**
      * Constructor
      */
     public KeplerExeWSClient(String endPoint, boolean 
loadConfigFromJar) throws Exception{
         this.loadConfigFromJar = loadConfigFromJar;
         options = new Options();
         options.setProperty(Constants.Configuration.ENABLE_SWA,
                 Constants.VALUE_TRUE);
         
options.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
         // Increase the time out when sending large attachments
         options.setTimeOutInMilliSeconds(1000000);
         EndpointReference epr = new EndpointReference(endPoint);
         options.setTo(epr);
         if (loadConfigFromJar) {
             //System.out.println("load config from jar");
             cofigContext = 
ConfigurationContextFactory.createDefaultConfigurationContext();

         } else {
             //System.out.println("load config from file system");
             cofigContext = 
ConfigurationContextFactory.createConfigurationContextFromFileSystem(this.axis2ModulePath, 
this.axis2xmlPath);
         }
     }

     /**
      * Get the status of a workflowRun with given id
      * @param workflowRunId
      * @return
      */
     public String getStatus(String workflowRunId) throws Exception
     {
         String action = "getStatus";
         options.setAction("urn:"+action);
         OperationClient keplerWSClient = createOperationClient(options);
         MessageContext mc = createMessageWithoutAttach(action, 
workflowRunId);
         keplerWSClient.addMessageContext(mc);
         keplerWSClient.execute(true);

          //Let's get the message context for the response
         OMElement outputs = getResponseOMElement(keplerWSClient, action);
         //get corresponding output
         OMElement outputOME = outputs.getFirstChildWithName(new 
QName(KEPLER_NAME_SPACE,"return"));

         return outputOME.getText();
     }

     /*
      * Creates an OperationClient object
      */
     private OperationClient createOperationClient(Options options) 
throws Exception
     {
         ServiceClient sender = new ServiceClient(cofigContext, null);
         sender.setOptions(options);
         OperationClient keplerWSClient = sender
                 .createClient(ServiceClient.ANON_OUT_IN_OP);
         return keplerWSClient;
     }




---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


RE: How to get the directory path in the service implementation code

Posted by Tony HEDOUX <he...@hotmail.com>.
Hi,

Try this one :

MessageContext mc = MessageContext.getCurrentMessageContext();
mc.getConfigurationContext().getRealPath("/");

if you just need this information at the instanciation of your service, you can find the information directly in the ServletContext parameter of your init method :

public void init(ServiceContext sc) throws Exception{

        System.out.println(sc.getRootContext().getRealPath("/"));

}

Tony.

> Date: Mon, 11 Jul 2011 11:16:27 -0700
> From: tao@nceas.ucsb.edu
> To: java-user@axis.apache.org
> Subject: How to get the directory path in the service implementation code
> 
> Hi, devs:
> 
> I implemented a axis2 service and deployed it to tomcat.  My tomcat 
> webapps is configured as /var/www/webapps. So the axis context has this 
> file structure:
> 
> /var/www/webapps/axis2/axis2-web
> /var/www/webapps/axis2/META-INF
> /var/www/webapps/axis2/WEB-INF
> 
> In my service implementation, it has code to generate a new directory 
> /var/www/webapps/axis2/mydata and use it to write, read and delete files.
> 
> In order to archive this purpose, I set an environment variable 
> AXSI_HOME= /var/www/webapps/  which let the implementation code aware 
> where the service was deployed. It works fine. But this introduce a 
> extra step in installation, set up an environment variable.
> 
> Now I have got a new task to create a installer for this web service. 
> Ideally I want to create a war file and the installation just needs a 
> user dropping the war file into the tomcat webapps directory. There are 
> no any environment variable setting or script running.
> 
> In order to do this, I want to the implementation code itself can detect 
> where it was deployed.
> 
> I added the following code in my implemenation:
> 
>   MessageContext messageContext = MessageContext.getCurrentMessageContext();
>        if(messageContext != null) {
>          ConfigurationContext configurationContext = 
> messageContext.getConfigurationContext();
>          if(configurationContext != null){
>            System.out.println("context root 
> "+configurationContext.getContextRoot());
>            System.out.println("servcie context path 
> "+configurationContext.getServiceContextPath());
>            System.out.println("servcie path 
> "+configurationContext.getServicePath());
>          }
>        }
> 
> The output is:
> context root /axis2
> servcie context path /axis2/services
> servcie path services
> 
> Those are NOT what I want. I want something which can get 
> /var/www/webapps/axis2.  Do you have any idea? Any suggestion and 
> comment will be highly appreciated.
> 
> 
> Regards,
> 
> Jing
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
> 
 		 	   		  

How to get the directory path in the service implementation code

Posted by jing <ta...@nceas.ucsb.edu>.
Hi, devs:

I implemented a axis2 service and deployed it to tomcat.  My tomcat 
webapps is configured as /var/www/webapps. So the axis context has this 
file structure:

/var/www/webapps/axis2/axis2-web
/var/www/webapps/axis2/META-INF
/var/www/webapps/axis2/WEB-INF

In my service implementation, it has code to generate a new directory 
/var/www/webapps/axis2/mydata and use it to write, read and delete files.

In order to archive this purpose, I set an environment variable 
AXSI_HOME= /var/www/webapps/  which let the implementation code aware 
where the service was deployed. It works fine. But this introduce a 
extra step in installation, set up an environment variable.

Now I have got a new task to create a installer for this web service. 
Ideally I want to create a war file and the installation just needs a 
user dropping the war file into the tomcat webapps directory. There are 
no any environment variable setting or script running.

In order to do this, I want to the implementation code itself can detect 
where it was deployed.

I added the following code in my implemenation:

  MessageContext messageContext = MessageContext.getCurrentMessageContext();
       if(messageContext != null) {
         ConfigurationContext configurationContext = 
messageContext.getConfigurationContext();
         if(configurationContext != null){
           System.out.println("context root 
"+configurationContext.getContextRoot());
           System.out.println("servcie context path 
"+configurationContext.getServiceContextPath());
           System.out.println("servcie path 
"+configurationContext.getServicePath());
         }
       }

The output is:
context root /axis2
servcie context path /axis2/services
servcie path services

Those are NOT what I want. I want something which can get 
/var/www/webapps/axis2.  Do you have any idea? Any suggestion and 
comment will be highly appreciated.


Regards,

Jing



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


RE: Attaching huge attachments in axis2

Posted by "Bhat B, Niranjan (NSN - IN/Bangalore)" <ni...@nsn.com>.
Hi Jorge,

I am sorry for the misunderstanding here.
Let me put it in other words,
In the client code I am trying to attach huge file and send it to the
server where the webservice is attached.
So I get this stack trace with OutOfMemory error in the client side when
I try to upload this huge file to the webservice:

--cut--
Sending ReportOperationStatus
['..\esymacstarter\gmoTemp\osr_13101481196870.xml'] to following
manager: 421506509 (to URL
http://localhost:8081/axis2/services/NE3SOperationNotificationService)
ERROR 08-Jul-2011 23:32:17.734 - AxisFault: ReportOperationStatus
sending failed. (..\esymacstarter\gmoTemp\osr_13101481196870.xml to
following manager: 421506509 to URL
http://localhost:8081/axis2/services/NE3SOperationNotificationService)
org.apache.axis2.AxisFault: java.lang.OutOfMemoryError: Java heap space
	at
org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java
:435)
	at
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(Out
InAxisOperation.java:371)
	at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOper
ation.java:417)
	at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInA
xisOperation.java:229)
	at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:165
)
	at
com.nokiasiemens.www.ne3s._1_0.NE3SOperationNotificationServiceStub.repo
rtOperationStatus(NE3SOperationNotificationServiceStub.java:604)
	at
com.nokia.j2ssp.comp.esymac.common.soapAdapter.notification.ReportOperat
ionStatusSender.sendOperationStatusResponse(ReportOperationStatusSender.
java:99)
	at
com.nokia.j2ssp.comp.esymac.common.soapAdapter.notification.Notification
SenderThreader.operationStatusResponse(NotificationSenderThreader.java:1
094)
	at
com.nokia.j2ssp.comp.esymac.common.soapAdapter.notification.Notification
SenderThreader.access$200(NotificationSenderThreader.java:36)
	at
com.nokia.j2ssp.comp.esymac.common.soapAdapter.notification.Notification
SenderThreader$SenderThread.run(NotificationSenderThreader.java:420)
--cut--

-----Original Message-----
From: ext Jorge Medina [mailto:cerebrotecnologico@gmail.com] 
Sent: Saturday, July 09, 2011 7:26 AM
To: java-user@axis.apache.org
Subject: Re: Attaching huge attachments in axis2

Make sure you stream the file.

I use SpringWS on the server side and Axis2 in the client side for
downloading files. In the server side, I spawn a new thread to write
the attachment portion using PipedInputStream/PipedOutputStream.

To do an upload, I would do the same. Spawn a new thread to read the
attachment using  PipedInputStream/PipedOutputStream from the stream
obtained from the DataHandler, connect the piped streams to the
FileInputStream you use to read the file.

-Jorge



On Fri, Jul 8, 2011 at 6:31 AM, Bhat B, Niranjan (NSN - IN/Bangalore)
<ni...@nsn.com> wrote:
>
> Hi All,
>
> Recently I had a use case of attaching a huge attachment file(around
500 MB) in the request to a webservice.
> But however, when I tried to do this I see out of memory errors in
application logs.
> Can you please let me know the efficient way of attaching huge
attachment files in the request to a webservice ?
> I am using SWA attachment APIs.
>
> regards,
> Niranjan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Attaching huge attachments in axis2

Posted by Jorge Medina <ce...@gmail.com>.
Make sure you stream the file.

I use SpringWS on the server side and Axis2 in the client side for
downloading files. In the server side, I spawn a new thread to write
the attachment portion using PipedInputStream/PipedOutputStream.

To do an upload, I would do the same. Spawn a new thread to read the
attachment using  PipedInputStream/PipedOutputStream from the stream
obtained from the DataHandler, connect the piped streams to the
FileInputStream you use to read the file.

-Jorge



On Fri, Jul 8, 2011 at 6:31 AM, Bhat B, Niranjan (NSN - IN/Bangalore)
<ni...@nsn.com> wrote:
>
> Hi All,
>
> Recently I had a use case of attaching a huge attachment file(around 500 MB) in the request to a webservice.
> But however, when I tried to do this I see out of memory errors in application logs.
> Can you please let me know the efficient way of attaching huge attachment files in the request to a webservice ?
> I am using SWA attachment APIs.
>
> regards,
> Niranjan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Attaching huge attachments in axis2

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
Have you tried with MTOM? Axis2 should be default stream it out to disk and
hence should not go OOM.

Sanjiva.

On Fri, Jul 8, 2011 at 10:31 AM, Bhat B, Niranjan (NSN - IN/Bangalore) <
niranjan.bhat_b@nsn.com> wrote:

>
> Hi All,
>
> Recently I had a use case of attaching a huge attachment file(around 500
> MB) in the request to a webservice.
> But however, when I tried to do this I see out of memory errors in
> application logs.
> Can you please let me know the efficient way of attaching huge attachment
> files in the request to a webservice ?
> I am using SWA attachment APIs.
>
> regards,
> Niranjan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>


-- 
Sanjiva Weerawarana, Ph.D.
Founder, Director & Chief Scientist; Lanka Software Foundation;
http://www.opensource.lk/
Founder, Chairman & CEO; WSO2; http://wso2.com/
Founder & Director; Thinkcube Systems; http://www.thinkcube.com/
Member; Apache Software Foundation; http://www.apache.org/
Visiting Lecturer; University of Moratuwa; http://www.cse.mrt.ac.lk/

Blog: http://sanjiva.weerawarana.org/