[kepler-dev] Error in Importing WS with array data type and one solution

Zhiming Zhao zhiming at science.uva.nl
Fri May 26 12:21:21 PDT 2006


Hi Ikaly and all,

Some days ago, I submitted an error in the kepler-user mailing list about
importing Web Service methods which have input/output parameters in array
data type. I have not seen reactions to that error, and I am not sure if
this has been fixed in the coming Beta release. I did some investigation
on the issue and found something; I hope it will be useful for you.

The original error I met was:
When I import and configure a WebService (In AXIS 1.3) via a WebService
Actor, the method which has array typed input/output can not be correctly
imported. The error message says: “Null,There is an error in configuring
actor: Web service”.

By locating this error in the code, I found the existing code (in
ConfigureActor() and CreatePorts()) can not correctly obtain array data
type from the WSDL file. The code uses the following three steps to
generate an Actor port for a WS port:
1) Node arrTypeNode = ( (org.apache.axis.wsdl.symbolTable.Parameter)      
                           parameters.returnParam).getType().getNode();
2) String baseTypeStr = _getArrayBaseType(arrTypeNode);
3) _createPort( (
        (org.apache.axis.wsdl.symbolTable.Parameter)
               parameters.returnParam).getMode(), baseTypeStr,
                        (String) returnQName.getLocalPart());

When importing the Axis WSDL I am using, arrTypeNode is null and
baseTypeStr can not be correctly set. That is why an exception is
generated.

Two optional changes can at least make the code work in both
ConfigureActor() and CreatePorts() for my case:
Option A) String baseTypeStr
=(String)((org.apache.axis.wsdl.symbolTable.Parameter)parameters.returnParam).
                                  getType().getRefType().getQName().getLocalPart()+"[]";

or Option B) String baseTypeStr =(String)(
(org.apache.axis.wsdl.symbolTable.Parameter)parameters.returnParam).
   getType().getQName().getLocalPart();
   and add new conditions in the _setPortType() function for “ArrayOfint”,
“ArrayOfdouble”
.

A modified WebService.java is attached. I have tested with the “echo”
service in the AXIS 1.3 release. I hope this experiment is useful for you.

Another thing I found in this actor is that a float is mapped as a double
when creating a port (see SetPortType()). In that case the WS actor will
send a float data as a double in the SOAP when invoking a service which
only recognizes float; a runtime error will then occur. How was the
original idea for mapping float as double? Is it because Potemy only
supports double token?

Regards

Zhiming Zhao
--
Faculty of Science, Uinversity of Amsterdam
Virtual Laboratory for e-Science
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WebService.java
Type: application/octet-stream
Size: 65363 bytes
Desc: not available
Url : http://mercury.nceas.ucsb.edu/ecoinformatics/pipermail/kepler-dev/attachments/20060526/19e3b63b/WebService-0001.obj


More information about the Kepler-dev mailing list