Why your API needs web services

A few days ago an interesting query was raised by one of our customers.

They queried whether it was possible for us to write our PDF2HTML5 Java api in dot net languages or php (Hypertext Preprocessor).

According to my colleague Suda, as many of you may be aware integrating the Java api into dot net frameworks consumes a considerable amount of time.

In order to answer this query we have decided to provide a PDF to HTML5 Cloud based design solution in our products using web services in order to fulfil our client’s demands.

This encouraged us to move to jax-ws plugins in our online conversion tool.
Now this has resulted in the conversion process becoming much more simpler than we imagined and our tool started helping all the other programming languages and platforms.

//jax-ws subroutine implementation
public byte[] convert
(@WebParam(name = “email”) String email,
@WebParam(name = “password”) String password,
@WebParam(name = “fileName”) String fileName,
@WebParam(name = “dataByteArray”) byte[] byteDataArray,
@WebParam(name = “conversionType”) String conversionType,
@WebParam(name = “conversionParams”) String[] conversionParams,
@WebParam(name = “xmlParamsByteArray”) byte[] xmlParamsByteArray,
@WebParam(name = “isDebugMode”) boolean isDebugMode) {
……………………………………………………….}

Since this method is stateless session we stopped worrying about multiple client request and security threads.

The wsdl for this service can be found at:

http://glassfish.idrsolutions.com:8282/HTML_Page_Extraction/IDRConversionService?wsdl

Feel free to try this out (It is free to use at the moment).

An example of the usage:
email: clouduser
password; pdf
fileName: {your pdf file name eg: myfile.pdf}
byteDataArray: {your pdf file data in bytes}
conversionType: html5
conversionParams: null;(if you like more additional styling you can try our jvm options as string array http://www.idrsolutions.com/html5-jvm-options/).
xmlParamsByteArray: null;
isDebugMode: false (make it true if you find your conversion returns null data and if it is set to true then you will obtain a string bytes of error messages which describes why your conversion was failed);

As an outcome of this method you will be able to obtain bytes array of a zipped file which contains the html converted data and directory hierarchy of the converted data.

This post is part of our “GlassFish Articles Index” series. In these articles, we aim to explore GlassFish in different ways, from useful tutorials, to JaveOne and general.

Ebook Page Link

The following two tabs change content below.

Alex Marshall

Head of Marketing at IDR Solutions
Alex Marshall is a marketeer and enjoys being creative and has a keen interest in technology, loves gadgets and is fascinated by both new hardware and software. He also has a soft spot for retro technology and classic cars. He is familiar with the world of Java, PDF and HTML5 and currently explores other areas in the world of tech.

Related Posts:

Alex

About Alex Marshall

Alex Marshall is a marketeer and enjoys being creative and has a keen interest in technology, loves gadgets and is fascinated by both new hardware and software. He also has a soft spot for retro technology and classic cars. He is familiar with the world of Java, PDF and HTML5 and currently explores other areas in the world of tech.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>