1 / 16

Web Services Experiences

Web Services Experiences. Machiel Jansen Vrije Universiteit (VU) Amsterdam. Building web services in Java. Prior Experience: none. Using NetBeans IDE: Making Webservives on the fly IDE generates stubs and hooks Provides container and servlets. Pro’s and cons- SUN. Pro’s:

bina
Download Presentation

Web Services Experiences

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Web ServicesExperiences Machiel Jansen Vrije Universiteit (VU) Amsterdam

  2. Building web services in Java Prior Experience: none. Using NetBeans IDE: Making Webservives on the fly IDE generates stubs and hooks Provides container and servlets

  3. Pro’s and cons- SUN Pro’s: No need to write WSDL Write application and ”publish” it as webservice. Cons: Sun webservices want the Sun Application Server – not in GT4.

  4. Apache Axis Axis can be easy. Deploy your webservice rapidly (jws): All public methods are available But: Not configurable Keep to global return datatypes

  5. Apache Axis Two approaches: Start building application, or class library. Let Axis generate WSDL (?wsdl) Write WSDL Use WSDL2Java to generate stubs (clients) and hooks (services)

  6. Axis server side

  7. More difficult side of WS Serialize your datastructures: Easy when you stick to: Global types (int, double, String, array etc.) Java beans (set and get methods) Otherwise: write custom serializers.

  8. Wrapping existing application Execute application from Java. (use runTime) Redirect the output. Deploy as webservice.

  9. Wrapping existing application public int run(String cmd, Writer out) throws IOException { RunTime r = Runtime.getRuntime(); Process p = r.exec(cmd); FileIO.copyFile(new InputStreamReader(p.getInputStream( )), out, true); try { p.waitFor( ); // wait for process to complete } catch (InterruptedException e) { return -1; } return p.exitValue( ); }

  10. WS Clients – 3 types Stub based (easy: use WSDL2Java) Service endpoint is static Dynamic proxy Service endpoint dynamically at runtime Dynamic Invocation Interface (DII) Discover services at runtime then invoke methods

  11. Clients - DII Axis user guide uses Call object (DII) in examples. WSRF and GT4 examples uses stubs.

  12. I used a DII client – should you? DYNAMIC BUT HARDER THAN STUBS // Register your (un)serializer call.registerTypeMapping(Result.class, qm, new org.apache.axis.encoding.ser.BeanSerializerFactory(Result.class, qm), new org.apache.axis.encoding.ser.BeanDeserializerFactory(Result.class, qm)); call.registerTypeMapping(Result[].class, ar, new org.apache.axis.encoding.ser.ArraySerializerFactory(), new org.apache.axis.encoding.ser.ArrayDeserializerFactory());

  13. WSRF and GT4 Working on it. You can work with GT4: use the WSCore library. http://www-128.ibm.com/developerworks/edu/gr-dw-gr-eclipseide-i.html Note: GT4 WSRF is a little different from Apache WSRF GT4 uses GAR files and JNDI deployment. Eclipse has a GT4 plugin…

  14. INDEXER/ SEARCHER CLIENT NODE NODE NODE What we would have liked… Use Resource aware WS’s on different nodes to process indexes and search queries WS on some nodes. Use SRB or local storage. user and system resources.

  15. What we would like – part 2 Scenario taken from: Building a grid using Web services standards. http://www-128.ibm.com/developerworks/edu/gr-dw-gr-movie1-i.html?S_TACT=105AGX07&S_CMP=HP

  16. Questions How do we make good use of GT4 – the WS enabled part? How do we get access to GT4? How are WS’s (best) used in PoC infrastructure? Why use WS’s at all? Why can’t we use a WS outside the PoC? Does it matter? Technical hurdles still to take: More experience in WSRF Writing (de)serializers for custom datatypes.

More Related