Monday, December 26, 2011


Oct 27, 2011 5:04 AM

Just wanted to share this.

Yesterday I bought a Jabra EasyGo bluetooth headset. Unfortunately, it could not bluetooth mp3 songs from my iPhone 4 iOS5. It can only be used for making/answering calls. However, today I found out that the headset can also play Voice Memos. This gave me an idea on how to bluetooth the mp3 songs from the iPhone to the headset:

  • Step 1 - Convert the mp3 file from Stereo to Mono (I used Audacity to accomplish this).
  • Step 2 - Add the Mono mp3 file to the iTunes library in the PC (my iTunes version is 10.5.0.142).
  • Step 3 - Sync the iPhone with iTunes.
  • Step 4 - In iPhone, open the Voice Memos. The imported mp3 file will appear in the list.
  • Step 5 - Turn the headset on (already paired with iPhone), then a 'speaker & bluetooth' icon will appear on top-left corner of the iPhone (see photos below).
  • Step 6 - In the Voice Memos, click on the play button next to the name of the the mp3 file.

photo (1).PNG photo.PNG

Cheerio!

iPhone 4, iOS 5

Thursday, December 15, 2011

Apache Axis2, CXF and Sun JAX-WS RI in comparison

Axis2, CXF, the JAX-WS Reference Implementation and JBossWS are all Web Services toolkits for the Java platform. This article describes the differences and provides decision guidance for developers and architects.

Apache Axis2

Axis2 is the follow-up of the popular Axis1 framework. Axis2 is based on a completely new architecture and has been rewritten from scratch. That makes Axis2 very flexible. For instance the databinding that is responsible for the serialization of Java objects into XML is not limited to one technology. For instance the following databindings are available:

Data Binding Description
ADB The Axis2 Databinding Framework is leightweight and simple but doesn't cover all XML Schema functions.
JiBX Allows the use of pojos without any modifications. A mapping defines how the pojos are serialized to XML.
XMLBeans Offers the most comprehensive XML Schema support.

Table 1: Axis2 Databindings

Asynchronous Web Services are well supported by Axis2. An Axis2 service accepts also asynchronous requests without any changes to the service. The service can use an endpoint reference delivered in the request to address a callback after finishing an asynchronous request.

Asynchronous Web Service Invocation
Figure 1: Asynchronous Web Service Invocation

The deployment of services for Axis1 has often been criticized. Therefore Axis2 has a completely new deployment model. An Axis2 runtime is a Web application and can be installed on every JEE compliant Application Server. The Axis2 web application itself is a container for Web Services. Web Services are packed into an own file format with the file extension aar. Due to these archives, Web Services can be installed and configured by a simple user interface at run time. A Web Service is regarded as an independent package which can be installed into the Axis2 runtime environment. Services are configured using the service.xml configuration file.

Axis2 Deployment
Figure 2: Axis2 Deployment

Axis2 offers modules providing additional functionality, for example WS-* standard support, which can also be installed during runtime.

Apache CXF

CXF is also a project of the Apache software foundation. CXF came up from a fusion of XFire and Ionas Celtix project.

CXF was developed with the intention to integrate it into other systems. This is reflected in the CXF API and the use of the Spring framework. Therefore it is simple to integrate CXF into existing systems. For instance CXF respectively its predecessor XFire was integrated into numerous open and closed source projects like ServiceMix or Mule.

A proprietary API as well as the standardized JAX-WS interface are available for the development and use of Web Services.

The JAX-WS Standard

The Java API for XML based Web Services is the successor of the JAX-RPC specification. JAX-WS respectively its predecessor is message based and supports asynchronous communication. The Configuration is managed by annotations therefore Java 5 or higher is required. JAX-WS isn't downwardly compatible to its predecessor JAX-RPC. With JAX-WS it is pretty easy to write and consume Web Services. The default values of numerous parameters are comfortable for the programmer, so that simple Pojos declared with a @WebService annotation can be used as a Service. Listing 1 shows a simple implementation of a Web Service using the @WebService annotation.

01.import javax.jws.WebService;
02.import javax.jws.WebMethod;
03.
04.@WebService
05.public class HelloWorldService {
06.
07.public String helloWorld() {
08.return "Hello World!";
09.}
10.}
Listing 1: HelloWorld Web Service using JAX-WS

A WSDL document can also be generated from the class. Annotations can influence the content of the generated WSDL document. For example a different namespace or other element names can be used. If JAXB is already known to the programmer, its annotations can be used to define the serialization in every detail. With the contract first approach a Service Interface, JAXB annotated classes for serialization and a skeleton for the implementation can be generated out of WSDL. According to the WSDL document the generated classes can have numerous annotations. Annotations are also the main point of criticism of JAX-WS. Despite this criticism the JAX-WS specification came out well. It is well attuned and combinable with other Java and Java EE specifications. For example, Listing 2 shows a stateless EJB 3.0 Bean which acts as a Web Service at the same time.

1.@WebService
2.@Stateless
3.public class MyService{
4.public String hello(String name) {
5.return "Hallo"+name;
6.}
7.}
Listing 2: Stateless SessionBean acting as Web Service

JAX-WS Reference Implementation

The JAX-WS Reference Implementation represents the core component of the Web Services protocol stack Metro. The Metro Stack provides support for the following Web Services standards:

  • WS-Addressing
  • WS-Policy
  • Web Services Security aka WS-Security
  • WS-Transaction
  • WS-Reliable Messaging
  • WS-Trust
  • WS-SecureConversation

JAX-WS and Metro are documented in detail. Apart from the JAX-WS, JAXB and JWS specifications there are numerous tutorials und samples. The Netbeans IDE as well as the tutorials of the enterprise pack makes it particularly easy to get started. Of course, Eclipse can also be used for the development with Metro.

Web applications containing Web Services which have been realized with JAX-WS are executable in Glassfish and many other application servers. To make services also executable in Tomcat, two libraries (JAX-WS and JAXB) have to be installed.

JBossWS

JBossWS is the Web Services Framework for the JBoss application server. By providing an integration layer it is possible to choose from three stack options:

  • Native Stack:
  • Apache CXF Stack:
  • Metro Stack:

Performance

Due to the modern streaming StAX parser, the performance of all three SOAP engines is very well. The ping time for a locale roundtrip is less than 1 millisecond (message size about 3KB, Dual Core Notebook). Therefore the time delay by the SOAP communication is negligible in many projects.

WS-* Standards

The support of the WS-Standard family can also be decisive for the selection of a SOAP engine. For example, messages sent to services can be secured with signatures as described in the Web Service Security standard (in short WSS). Table 1 lists the supported WS-* standards for each toolkit.

Standards Axis2 CXF JAX-WS/Metro
WS-Addressing X X X
WS-Coordination X(2)
X
WS-MetadataExchange

X
WS-Policy X X X
WS-ReliableMessaging X(3) X X
Web Services Security X(1) X(4) X
WS-SecureConversation X(1) X(4) X
WS-SecurityPolicy X X X
WS-Transaction X(2)
X
WS-Trust X X X
WS-Federation


Table 2: Support for WS-* Standards ( as of August 2010)

(1) Supported by the additional module Apache Rampart
(2) Supported by the additional module Apache Kandula2
(3) Supported by the additional module Apache Sandesha2
(4) By Apache WSS4J

Conclusion

None of the Web Services frameworks is in general superior to the others. Axis2 is structured modularly, has many features and can be used as an application server for Web Services. A special feature of Axis2 is the support of exchangeable binding frameworks, for example XMLBeans. Axis2 together with the XMLBeans framework is well suited for Web Services which are using very complex schema definitions. The disadvantages of Axis2 are its complexity as well as the insufficient JAX-WS support. Therefore anyone who wants to work with JAX-WS should choose Apache CXF or the reference implementation.

Those who prefer a seamless integration with the Spring framework are well advised with Apache CXF. Furthermore CXF is slim and easy to use. CXF is the tool of choice if a SOAP engine has to be embedded into an existing software.

Who wants to code against the standard is well advised with the JAX-WS implementation. The enterprise pack of the Netbeans development environment supports JAX-WS RI very well. Only a few clicks are needed to build a server or to call a Web Service. The Metro stack that includes JAX-WS RI offers the most comprehensive support for the WS-* standards. A major advantage of Metro 2.0 is its compatibility with Microsofts Windows Communication Foundation.

I hope this article could help you with the decision for a WS toolkit.


Axis2

JAX-WS RI

Apache
CXF

Spring-
WS

Framework maturity

Quite mature

Open standard and mature

Mature

1.0 is the latest release available

Binding support

ABD,JIBX,XMLBeans (is part of
distribution and has flag to generate javacode out
of xsd’s)

Only JAXB?

JAXB 2.0, Aegis, XMLBeans. (xmlbeans are not
supported out of the box like axis2)

JAXB, Castor, XMLBeans, JiBX, and XStream (similiarly no out of
the box support, not part of distribution or tool)

Core

Axiom

Java Annotations

Xfire+..

Spring

Top down support

Very good

Not so good

Not so good

Very good

Bottom up support

Very Good

Very Good (annotations)

Very Good (Spring)

Very good

XMLBeans support

Out of the box support

NA

It says it supports, but no easy documentation or flags to
generate java classes from xsd.

NA

Number of frustrated people met

Axis1 was bad in terms of performance and Many ppl are not happu because of
.net interoperability issue.

Less number of frustrated people.



Number of happy people

moderate

Many as sun spec is Jax-ws

moderate

NA J

Actual interoperability support (.net and java)

good

Metro (joint project by sun with Microsoft)

WS-I full support but not sure

NA

Monday, December 12, 2011

Amazon bests Microsoft, all other contenders in cloud storage test

Amazon bests Microsoft, all other contenders in cloud storage test

Amazon's S3 Simple Storage Service has outperformed Microsoft's Windows Azure Storage and all other major providers in an extensive study testing the feasibility of businesses using cloud services for primary storage, data protection, and disaster recovery.

Nasuni, which sells data protection services that work across any type of cloud storage, says it has been testing the 16 largest cloud storage providers (CSPs) since April 2009 to determine the best services for its customers. Ultimately, only six of the 16 providers passed Nasuni's testing—in addition to Amazon and Microsoft, the other winners were Nirvanix, Rackspace, AT&T Synaptic, and Peer1 Hosting. Both AT&T and Peer1 use EMC's Atmos platform on the back end, although EMC itself discontinued its own public cloud based on Atmos.

While these six are, apparently, ready for real-world use, Nasuni politely declined to say which ten services failed its test, so we can't warn you away from those vendors. But Nasuni does say the difference between the ones who passed the tests and those that didn't is in some cases quite large. When Nasuni tested the providers for scalability by continuously writing small files of 1KB for weeks on end to determine error rates and performance, two of the eight providers that made it through this stage of testing failed, and others couldn't complete the test.

"Without proper testing, it is impossible to differentiate between an industrial-strength CSP and a lesser operation," Nasuni said. "In fact, some providers have asked Nasuni to cease testing at this stage because they said it was negatively impacting their customers, which is a truly frightening statement. True cloud storage should be able to accommodate billions of files without any visible strain. Those CSPs that faced performance issues under Nasuni’s test are simply not equipped to deliver an appropriate level of service to customers."

As in most cases, Amazon S3 and Microsoft's Azure were the top two performers in the scalability test, with Amazon's error rate at "effectively zero" and Microsoft close to it.

The tests were divided into five categories. Nasuni began by looking at API integration, "to ensure that it is possible to test the service at all." More categories included unit testing to determine whether each CSP can handle basic functions like writing and reading different file sizes; performance testing to measure response time across multiple simultaneous threads and a range of object sizes and workload types; stability testing to determine long-term reliability by continuously writing and reading files to ensure all data is preserved; and the scalability testing we mentioned earlier in this article.

Nasuni tried to make the tests fair, for example by testing stability from numerous locations. In the case of stability testing, providers "had to perform with no data loss and have no significant unplanned outages" in order to pass.

"Two CSPs emerged as top performers in the Nasuni study: Amazon S3 and Microsoft Windows Azure, with Amazon S3 being the standout across all evaluation areas," Nasuni said. Other vendors performed well in specific areas. "Though Nirvanix was 17 percent faster than Amazon S3 for reading large files, and Microsoft Azure was 12 percent faster when it comes to writing files, no other vendor posted the kind of consistently fast service across all file types as did Amazon S3."

"Amazon S3 had the fewest outages and best uptime, and was the only CSP to post a 0.0 percent error rate in both writing and reading objects during scalability testing," Nasuni continued. "And though Microsoft Azure had a slightly faster average ping time than Amazon S3 (likely because Amazon S3 is much more heavily used than Microsoft Azure), Amazon nevertheless had the lowest variability."

Amazon customers suffered a severe outage during April in the separate Elastic Block Store service, which provides mountable disk volumes to virtual machines hosted in Amazon's Elastic Compute Cloud. However, the S3 storage service tested by Nasuni posted excellent uptime. Amazon had the fewest outages at 1.4 per month, but they were so small that S3's availability was essentially 100 percent, according to Nasuni.

Azure had 11.1 outages per month, with availability at 99.9 percent, while Rackspace and Peer1 achieved almost identical numbers. Nirvanix had 332 outages per month, but the outages must have been small ones as Nirvanix's overall availability was still 99.8 percent. AT&T, with 10.4 outages per month, posted the worst uptime because of their duration. AT&T's availability was 99.5 percent.

The full Nasuni benchmark report is here if you want to dive into it a bit more. Coincidentally, Microsoft today released an update to Azure that may be interesting to developers, which is detailed on the Azure blog. We also noted a couple months ago that in a more limited test conducted by the vendor Compuware, Azure came out ahead of Amazon in terms of speed.

Because cloud services are publicly available, they provide a good opportunity for organizations interested in benchmarking. The Nasuni test does appear to be among the most comprehensive on the subject, Enterprise Strategy Group founder and senior analyst Steve Duplessie tells Ars. "We happen to know that Nasuni has been collecting a lot of data on all these guys for a long time, so we're confident with the results being accurate," Duplessie says. "The cloud is a fuzzy thing, no pun intended. It's good that someone has been tracking reality."

In conclusion, the Nasuni report states, "It is not difficult to create something that looks like cloud storage. It is very difficult, however, to create a cloud that is truly scalable, reliable and always available."

Mapping a Windows Drive to a WebDAV Server

Mapping a Windows Drive to a WebDAV Server

This tutorial shows you how to connect a Folder or a Windows Drive Letter to any WebDAV server, what to do if the command fails, what not to do, and security. This tutorial is for Windows XP/Vista/W7 client users.

The Two WebDAV Windows Clients

Microsoft Windows provides two WebDAV clients: Web Folders and WebDAV Mini Redirector. The clients are integrated and come preinstalled with your Windows.

Web Folders (XP only)

The first generation WebDAV client provided by Microsoft is called Web Folders and allows one to drag and drop between a remote WebDAV server and your local computer. The Web Folders client provides functionality similar to (secure) FTP.

How to connect (XP only):
  1. Go to My Network Places, and click on Add Network Place at the top of the left sidebar.
  2. The window that pops up is the Add Network Place Wizard. Click Next.
  3. On the next page, enter the URL of the WebDAV folder in the box named Internet or network address and click Next.
  4. A window asking for your username and password will pop up at this point. Enter your username and password, and click OK.
  5. On the next page, enter a name for this share -- this is the name that will show up in the My Network Places listing.
  6. Click Finish on the next page.

WebDAV Mini Redirector (XP, Vista, and Win7)

If you found us by searching on the internet, you should know that you may have a problem with your WebDAV server.

This tutorial gives you a few tips when it comes to using the Windows WebDAV clients with any server, but please consider switching to the BarracudaDrive WebDAV server -- you may just find that your problems go away. BarracudaDrive's integrated WebDAV server circumvents many of the problems typically associated with the native Windows WebDAV clients.

The BarracudaDrive WebDAV server can be installed on a wide variety of business/home computers, including online cloud servers.

The second generation Microsoft WebDAV client is called WebDAV Mini Redirector and allows one to map a WebDAV location to a Drive letter the same way as if you were using a Windows File Sharing/SMB/CIFSshare.

WebDAV Mini Redirector limitations:
  • No support for secure connections (HTTPS) on Windows XP. There is support on Windows 7, but it does not always work. It is inconsistent.
  • Your WebDAV server must be using port 80, the default port.
  • Typically fails when transfering larger files.
  • Gets confused if the user does not have access to read and/or write to a file or directory.
How to connect:
  1. Right click on My Computer and select Map Network Drive.
  2. In the Folder "entry field", enter the URL, and click Finish.
  3. Enter your username and password in the authentication box that appears.

Be sure to enter the correct username and password. WebDAV Mini Redirector may not take no for an answer and may continue attempting to login until the hacker prevention logic in BarracudaDrive bans your client's IP address. You will get an obscure error message in the console. You can see if you are banned by attempting to login using a browser.

The video to the right shows how to map a drive to the BarracudaDrive server by using a session URL. The session URL eliminates the login problem found in many Windows WebDAV implementations. Note: you do not have to use a session URL in BarracudaDrive. Simply use the same URL as you use in the browser when mapping the drive.

You can use the network drive like you use your C:\ hard drive as soon as the command completes successfully. This means that you can directly work with documents without first copying them, start computer programs, and more over the Internet.

The following image shows a Windows Explorer window listing the content of a WebDAV server.

windows mapped drive

Windows WebDAV Mini Redirector Authentication Bug:

Many Windows computers have a bug in the digest authentication process and thus authenticating using the above procedure will fail. You have the bug in your computer if the "Windows credentials dialogue" reappears after you have entered the correct username and password. It is possible to circumvent this bug by mapping the drive from the command line. Note, if the "Windows credentials dialogue" reappears, you must reboot your Windows computer before using the command line. Windows will continue to fail if you do not reboot. This is also true if you accidently enter the wrong credentials.

Do the following to map a drive and authenticate from the command line:

  1. Open a command window (DOS Window) by clicking the Windows start button and typing in the command "cmd" in the "run" or "search programs ..." box.
  2. Type the following command in the command window:
    NET USE * http://servername/fs/ password /USER:username

Note: the BarracudaDrive server includes functionality that circumvents the Windows authentication bug. The BarracudaDrive Web-File-Manager includes a WebDAV button that creates a session URL which uses the browser's login session. The session URL solves two problems: it eliminates the login problem and makes the connection more secure since you may terminate the session by logging out in the browser. If you do not use the session URL, the only way to logout is to reboot your Windows computer.


Security

One cannot use a secure connection when using the WebDAV Mini Redirector, i.e. the following command will typically fail:

NET USE * https://barracudaserver.com/dav/

When using WebDAV Mini Redirector, all data exchanged with the BarracudaDrive server is sent unencrypted and might be eavesdropped. Use one of the alternative clients mentioned above if you need secure communication.


What to do if the command fails

Error messages such as "The network name cannot be found" can be related to a number of problems. The first thing to do is to check if your Windows WebDAV client is disabled.

You can download and run the following command file, which will attempt to start the Windows WebDAV client.

You can alternatively enable the client manually:

Start the WebClient Service

Go to:
Control Panel -> Performance And Maintanance -> Administrative Tools -> Services
Scroll down until you see WebClient.

Enabling WebClient service

Set WebClient to automatic and start the service. Try to connect from a command window and restart Windows if it fails.

Things get a bit complicated if you have the same problem after enabling the WebClient service and after rebooting Windows. You may have to upgrade your WebDAV Mini Redirector Windows client.

You can do a search on Google and you will find many articles related to the WebDAV Mini Redirector problems. You can also see Wikipedia: WebDAV and Microsoft Windows.

Upgrading Windows Vista WebDAV client:

Microsoft has ackowledged there are Web Folder issues in Vista, but unless your system is 64-bit, you should be able to get Web Folders working by installing an update from Microsoft and using the instructions and "workarounds" in the following steps:

If you have a 32-bit Vista apply this Software Update for Web Folders (Microsoft.com).


What not to do when using the BarracudaDrive server

You might come up with the idea and connect to localhost, i.e. have the WebDAV Mini Redirector and BarracudaDrive on the same computer. There are no reasons to do this, except for testing.

Never do the following on a Windows computer if BarracudaDrive is running in console mode or if using the free BarracudaDrive version:

net use * http://localhost/dav/

The above command will lead to an endless loop between Windows and BarracudaDrive as BarracudaDrive will try to access the new WebDAV network drive, which loops back into BarracudaDrive. This command will crash your Windows computer.

However, the following command is OK:

net use * http://localhost/dav/C/

Turn Your Dropbox Account Into a WebDAV Server With DropDAV

DropDAV is a nifty service that enables you to use Dropbox with WebDAV clients. It was developed to work with the iWork suite for the iPad, but it will work with any WebDAV client, so you could also use it to sync OmniFocus through your Dropbox account, for example.

It’s simple to set up, although you do need to provide it with your Dropbox username and password to get going. Once set up, you connect to https://dav.dropdav.com with your WebDAV client and log in using your Dropbox credentials.

DropDAV costs 30 percent of your Dropbox plan price, so it’s free for users with the free 2GB Dropbox plan, while users with a 50 GB account will be charged $3 per month. A 14-day free trial is available.

I’m surprised that Dropbox hasn’t added WebDAV support to the service it provides; it’s something that many thousands of its users have asked for. But until Dropbox adds built-in WebDAV support, DropDAV is a good workaround.