[kepler-dev] Questions on web service integration

Ilkay Altintas altintas at sdsc.edu
Tue Nov 6 13:51:35 PST 2007


Eric,

We currently have two different Web Service actors. For this  
particular service, you need to use the WSWithComplexTypes actor as  
it has defined complex types in the description. The simple  
WebService actor is only for simple xsd types and arrays of them. I  
pasted a past post by Dan Crawl on how to use the complex typed web  
service actor.

Apologies for the delay in responding. Hope this helps.
-ilkay

The previous post:

Hi,

I've created a new actor that can invoke web service operations with
complex types. It's called WSWithComplexTypes. To see it in action,
look at these workflows in $KEPLER/workflows/test/spa/:

NewWebServiceArrayReturnTest.xml
NewWebServiceDecodeOutputTest.xml
NewWebServiceNestedTypesTest.xml


WSWithComplexTypes invokes web services defined by WSDLs. Similar
to WebService, given a web service WSDL URL and an operation name,
WSWithComplexTypes specializes its input and output ports to reflect
the input and output parameters of the operation. For simple web
service types, e.g., string, int, double, etc., the ports are set to
the matching Ptolemy types. For complex web service types, the ports
are set to XMLTOKEN. When the actor fires, it reads each input port,
invokes the web service operation with the input data, and outputs the
response to the output ports.

WSWithComplexTypes also has two parameters, inputMechanism and
outputMechanism, that aid in working with complex web service types.  
Their
default setting is 'simple', which causes WSWithComplexTypes to  
specialize
its ports as already described. By setting to 'composite', a composite
actor is additionally created for each (web service operation) parameter
that is a complex type. Each composite actor contains the  
XMLAssembler or
XMLDisassembler actors needed to build the complex web service type, and
the external ports are all simple Ptolemy types. Changing the mechanism
back to 'simple' deletes the connected composite actors. (If you have
made changes to the composite actors and don't want them lost,  
disconnect
them from WSWithComplexTypes before changing the mechanism to 'simple').

If you have any questions, let me know.

   --dan
_______________________________________________
Kepler-dev mailing list


On Oct 24, 2007, at 9:01 AM, Eric Whitley wrote:

> Hello -
>
> I'm new to Kepler and the list, so "hello, everyone." :)  We're just
> getting started with the tool, but are really impressed with how
> approachable it makes what would otherwise be complex programming
> exercises.
>
> Wondering if anyone might be able to point me in the right direction
> for an issue I'm having invoking a remote web service.
>
> Short Version of Question:
> ----------
> When you incorporate a web service how do you deal with data types
> for inputs and outputs?  Seems that when I attach the output of a web
> service to a display actor I get exceptions like "could not find
> deserializer for type."
>
>
> Long Version of Question:
> ----------
> The tutorial on hitting (http://xml.nig.ac.jp/wsdl/DDBJ.wsdl ->
> getXMLEntr) worked well, so I figured I'd move on a bit by
> incorporating a different service.  I'm trying to replicate the basic
> setup of that tutorial, but instead I'm invoking some of the more
> common sample services I've used in the past.  EX:
>
> http://ws.intalio.com/TimeService/TimeService.wsdl   (getUTCTime)
> http://ws.strikeiron.com/HouseofDev/CurrencyRates160?WSDL
> (getCurrenciesList)
>
> A bit on my setup
> -----------
> OS: Mac OS X 10.4.10 (intel)
> Kepler: beta 3
>
> What I'm attempting
> (verbose, but I don't know if the devil is in the details)
> -----------
> * Read as many of the tutorials, help files, sample files, etc. that
> I can find
> * Started kepler from the shell so I can see more logging output
> * Dropped in an SDF director
> * Dropped in a web service
>       - added wsdl reference (http://ws.intalio.com/TimeService/
> TimeService.wsdl)
>       - named actor "Get UTC Time WS"
>       - closed web service and re-opened it
>       - selected "getUTCTime" method
> * Dropped in two displays
>       - one for general output
>       - one for error output
>       - named actors "WS Display" and "WS Error"
> * Dropped in a string constant for the input
>       - named it "My Input"
>       - Set value to "0" (no quotes in the value)
> * Connected ports
>       - String -> Web Service input
>       - Web Service Error -> WS Error
>       - Web Service Display -> WS Display
>
> ** When I hit start I see the process executes (lower left side of
> main window), but no data shows up in either of the display outputs
> ** Terminal window shows the following:
> ----------------------------------
> PORT TYPE in PTOLEMY ACTOR: string
> ERROR (org.apache.axis.client.Call:invoke:2469) Exception:
> org.xml.sax.SAXException: Deserializing parameter
> 'getUTCTimeResult':  could not find deserializer for type {http://
> ws.intalio.com/TimeService/}>getUTCTimeResponse
>          at org.apache.axis.message.RPCHandler.onStartChild
> (RPCHandler.java:277)
>          at
> org.apache.axis.encoding.DeserializationContext.startElement
> (DeserializationContext.java:1035)
>          at org.apache.axis.message.SAX2EventRecorder.replay
> (SAX2EventRecorder.java:165)
>          at org.apache.axis.message.MessageElement.publishToHandler
> (MessageElement.java:1141)
>          at org.apache.axis.message.RPCElement.deserialize
> (RPCElement.java:236)
>          at org.apache.axis.message.RPCElement.getParams
> (RPCElement.java:384)
>          at org.apache.axis.client.Call.invoke(Call.java:2467)
>          at org.apache.axis.client.Call.invoke(Call.java:2366)
>          at org.apache.axis.client.Call.invoke(Call.java:1812)
>          at org.sdm.spa.WebService.fire(WebService.java:865)
>          at ptolemy.actor.AtomicActor.iterate(AtomicActor.java:337)
>          at ptolemy.actor.sched.StaticSchedulingDirector.fire
> (StaticSchedulingDirector.java:170)
>          at ptolemy.actor.CompositeActor.fire(CompositeActor.java:331)
>          at ptolemy.actor.Manager.iterate(Manager.java:668)
>          at ptolemy.actor.Manager.execute(Manager.java:327)
>          at ptolemy.actor.Manager.run(Manager.java:1044)
>          at ptolemy.actor.Manager$3.run(Manager.java:1085)
>
> ; nested exception is:
>          org.xml.sax.SAXException: Deserializing parameter
> 'getUTCTimeResult':  could not find deserializer for type {http://
> ws.intalio.com/TimeService/}>getUTCTimeResponse
> The remote exception error occured in the actor: Get UTC Time WS
> ----------------------------------
>
> I see that the Display actor takes type:general and the web service
> _thinks_ (at least according to the designer) that it's typing the
> output as string, but... I'm not entirely sure, then, what I've
> failed to do to get things wired up correctly.  Is there something I
> need to do between the web service output and display input ports?
>
> Any direction would be very much appreciated.
>
> Thanks in advance,
> Eric
> _______________________________________________
> Kepler-dev mailing list
> Kepler-dev at ecoinformatics.org
> http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/ 
> kepler-dev




More information about the Kepler-dev mailing list