вторник, 19 февраля 2013 г.

Apache CXF integration testing

Sometimes it is necessary to make the test of web-service client and service.
If you have an Apache CXF service and client then you can try to use local transport for your test.
So, here is an example.

The client you define like this:
 <jaxws:client id="client" serviceClass="IIdentificationService"  address="local://test"/>.

And here is how you test the integration:

IIdentificationServiceImpl impl = new IIdentificationServiceImpl();
Endpoint ep = Endpoint.publish("local://test", impl);
IIdentificationService client = (IIdentificationService) context.getBean("client");
Result res = client.call("123");
ep.stop();


What is important here is the address of endpoint and client. Both uses the prefix "local". This means that messages will transport inside the JVM.
For reference see http://cxf.apache.org/docs/local-transport.html.

четверг, 14 февраля 2013 г.

Challenges in WS development


1) Work with large and user base.
Solution:
Audit & monitoring.
Multifactor authentication.

2) Long life cycle.
Solution:
Choose solution based on industry standards.

3) Robustness.
Solution:
Architect the solution that will work even if some of it components will go down.

4) Manageability.
Solution:
Take care at monitoring, backup, upgrade.

 5) Integration with legacy applications.
Solution:
Look for interface of other applications.

WS stack technologies review

Recently I started to invest time in learning of web services.
I have learnt the basics of WSDL 1.1.
Now I'm trying to understand other aspects of WS. Where are a lot of WS-* technologies. Some of them are obsolete, some are not supported. So the aim of this post is to understand the widely adopted specifications and the possible use cases for them.

воскресенье, 10 февраля 2013 г.

Ajax and ActiveMQ

Sometimes you need to notify users (browsers) about some events occurred on the server side. For example someone has added the row into the table and you need to be notified about it.
Also the client could be not just the browser but any program component. And this components can be dynamically connected and disconnected.
The solution could be the message queue and publish subscribe pattern.
 After some research I managed to work the solution based of ActiveMQ 5.7.0 and Apache Tomcat 6.0.35. Here is how I did it.

пятница, 8 февраля 2013 г.

JStree AJAX lazy loading and submitting of selected nodes to server

Sometimes your need to work with trees.
After some time of research I could find 2 implementations of javascript trees: jsTree (http://www.jstree.com/) and Dynatree (http://code.google.com/p/dynatree/).

I could only try jsTree because of limited time.
So, here are my requirements:
1) lazy loading of selected nodes. It's because tree size can be quite big. And store all the tree is unnecessary.
2) one can choose any number of nodes and submit selected nodes of the tree to server.