Web%20Services%20Experiences - PowerPoint PPT Presentation

About This Presentation
Title:

Web%20Services%20Experiences

Description:

Write application and 'publish' it as webservice. Cons: ... public int run(String cmd, Writer out) throws IOException { RunTime r = Runtime.getRuntime ... – PowerPoint PPT presentation

Number of Views:22
Avg rating:3.0/5.0
Slides: 17
Provided by: mgja8
Category:

less

Transcript and Presenter's Notes

Title: Web%20Services%20Experiences


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
Pros and cons- SUN
  • Pros
  • 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.getIn
    putStream( )), 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.BeanDeser
    ializerFactory(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
What we would have liked
Use Resource aware WSs 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_TACT105AGX07S_CMPHP

16
Questions
  • How do we make good use of GT4 the WS enabled
    part?
  • How do we get access to GT4?
  • How are WSs (best) used in PoC infrastructure?
  • Why use WSs at all?
  • Why cant 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.
Write a Comment
User Comments (0)
About PowerShow.com