Monday, July 23, 2012

Building a Firefox Add-on

I have just built a Firefox add-on using the Add-on builder.

Add-on builder is a web based tool that is easy to use to develop the add on. There is also the SDK which can be used to develop the add-on from the command line. I have not used the command line options.

https://addons.mozilla.org/en-US/developers/builder

Once there, select Try Builder. This takes you to a new page. At the top, select Sign-in. Once signed in, select Account to see the add-ons you have already created.

View the addon dashboard at
https://addons.mozilla.org/en-US/developers/addons

To publish at the dashboard, zip the contents of the extension folder (do not include the folder) and change the extension to .xpi.

I am using add-on builder, so I do not have the folder for the extension, but the .xpi file can be downloaded from add-on builder and then uploaded through the dashboard. Unfortunately, the link in add-on builder for uploading a new version does not work.

It seems that the add-on builder upload did work. When I did the manual upload, I received an error message that it was already uploaded.



Available Web Services

I am approaching web services from the stand point of a user.

I want to find useful web services and access them from a web application.

I do not care about all the different ways that web services can be implemented
or the history and development of web services over time. I want to be able
to consume a web service from a web application with as little coding as possible.
Link
My first thought is to be able to access a web service for a shipping company. I
will see if there are web services for UPS, FedEx and DHL.

I found a site for developers that want to incorporate FedEx services: http://fedex.com/us/developer/index.html. A similar site for UPS is https://www.ups.com/upsdeveloperkit. DHL offers this site: http://www.dhl.com/en/express/resource_center/integrated_shipping_solutions.html.

I had difficulty finding the WSDL address for FedEx. I found the following for UPS: https://www.ups.com/e_comm_access/laServ?CURRENT_PAGE=INTRO&OPTION=ACCESS_LICENSE&loc=en_US

There is a comment on the WSDL "Access to UPS shipping, tracking and payments. Free for use but you to apply, your company must already have an account with UPS and send a minimum of 50 packages per day." I will see if I am able to access it.

Created UpsWebService web application in NetBeans 7.0

Downloaded the Address Validation Developer's Guide, but it cannot be read.

Went back to FedEx and downloaded the Rate example.
  1. Using axis2-1.5.4.
  2. The classpath variables point to the wrong JAR files.
  3. Renamed obvious ones. Removed the others.
  4. Will try a compile to see what errors I get.
  5. Failure. The code is tied to axis2-1.4. Many changes for axis2-1.5.4.
I will try to find a Google WSDL to access.

I am using FedEx again and the Rate service. I will download axis-1.4
  1. I am reading the README file from the Rate example.
  2. I will add activation.jar and mailapi.jar to the classpath as well as the axis files.
  3. Added the .project file to Eclipse Helios. No compilation errors. I had to download activation.jar from oracle and add it to the axis lib folder. Same for mailapi.jar. Alternatively, I could have edited the variables that were created for the class path.
  4. Had to add -cp "\lib\*" to java command in order to get WSDL2java to run.
  5. All stubs are created and placed in workspace.
  6. Had to request access to test environment for FedEx. Only certified apps can run on production servers. Account number, meter number, key were in confirmation on web site. Password was only sent in email (that took 10 minutes to arrive).
Trying FedEx examples from NetBeans.
  1. Must use Axis 1.4 for library, not 1.6.
  2. mailapi.jar and activation.jar are there from Eclipse example.
  3. Success.
I will not try a different application using the NetBeans Services->Web Services.
  1. I have added a new Web Service in the Services tab for FedEx.
  2. I have linked to the wsdl that was sent in the samples from FedEx. The wsdl does not appear to be accessible from the web.
  3. Drag-drop getRates to example main program. There is not enough information to make a request that runs.
I will try creating a web service from a WSDL in NetBeans.
  1. New -> Web Service Client
  2. Local reference to WSDL from FedEx
  3. Same result as using Services.


I am now trying to use Amazon Web Services (AWS) to send bulk email.

I am following the instructions at http://docs.amazonwebservices.com/ses/latest/GettingStartedGuide/.
  1. The only glitch so far is that Perl needs to be installed in order to verify the email address.
  2. Next glitch, library LibXML.pm is missing.
  3. Could not find 64 bit XML/LibXML.pm. Am uninstalling 64 and installing 32 bit Perl.
  4. Still not luck. Trying to use cpan from perl install. Need C and make. Installing now.
  5. Installed cpanm and am installing XML::LibXML.
  6. Error about uninitialized value in Makefile.
  7. I am probably missing libxml2. This is a C library that implements GNOME functionality. I am trying to do the install in Linux. It may be better to rewrite the script using XPATH.
  8. Using Windows, I was able to run the email verify address by using XPATH. Listed after this list. Still didn't show results, I had to just view the plain text of the response.
my $xpath = XML::XPath->new( xml => $response_content);
$xpath->set_namespace('ns', $SES::aws_email_ns);

my @nodes = $xpath->findnodes('/ns:ListVerifiedEmailAddressesResponse' .
'/ns:ListVerifiedEmailAddressesResult' .
'/ns:VerifiedEmailAddresses' .
'/ns:member');

print "node count: @nodes";
foreach my $node (@nodes) {
my $text = $node->to_literal();
print "$text\n";
}

Have downloaded the SDK for AWS for Java.
  1. I have been able to send an email.
  2. I used ant. Now I am creating a project in NetBeans to run the samples.
  3. I created a library for AWS jar files in the lib and third-party folders of SDK.
  4. Updated my credentials and sent an email.
It only took a few hours to get moved to production mode.
  1. Created a utility class for adding recipients, reading recipients, etc.
  2. Sent bulk mail to mailing list with 50 addresses.
  3. Messages were received quickly.








Followers