[Zoo-discuss] java service example 2

andrea antonello andrea.antonello at gmail.com
Thu Nov 20 05:27:59 PST 2014


Hi Gerald,

[...]
>> Ok, so the inputs are always string. This means that each module has
>> to do the conversion to its own datatype? I was expecting to have the
>> declared type. Is that the same for the other languages or is it due
>> to missing java support?
>
> Indeed the inputs are always « string » (I quote the string cause it can contains binary content also which is not really a string, in such a case you will have the optional size attribute accessible for being able to read binary data). You are right, the service implementer have the responsibility  to define their own methods to convert those « strings » to  whatever is of use in their language. For the C language there are an API to read and write the output using OGR directly but this was never generalized to other languages and I have to admit that I do not see how the implementation can handle this on its own, as some may need to use OGR and other may prefer to use another library to parse the input.
>
> I’m not sure about the declared type you speak about, if you search for mimeType, so yes you have access to this kind of information from the HashMap corresponding to your input. In other case I don’t know what do you expect here ?

No it is fine as it is. I was assuming that this might be the reason.
It is ok. The hashmap contains the datatype I declare, so I will be
able to implement the transformer needed.

[...]
> I am interested a lot in having more informations about the messages you have when it crashed. Nevertheless, you should use the following syntaxe (based on your example request and  if I understood it well):
>
> http://127.0.0.1/cgi-bin/zoo_loader.cgi?metapath=zoojavatest&Service=WPS&request=Execute&Version=1.0.0&Identifier=ZooJavaBuilder&DataInputs=inParameter=3.0;inPath=/mypath/dtm.asc

I tried that before, but it crashes. The debug apache log gives me:

Addr:127.0.0.1
RequestMethod: (GET) -1 0
Request: metapath=zoojavatest&Service=WPS&request=Execute&Version=1.0.0&Identifier=ZooJavaBuilder&DataInputs=inParameter=3.0;inPath=/mypath/dtm.asc
ContentType:
ContentLength: 138
((
 metapath
 zoojavatest
 ))((
 Service
 WPS
 ))((
 request
 Execute
 ))((
 Version
 1.0.0
 ))((
 Identifier
 ZooJavaBuilder
 ))((
 DataInputs
 inParameter=3.0;inPath=/mypath/dtm.asc
 ))

and the java core dump just tells me that it starts from the main cgi
binary but nothing more:

Dynamic libraries:
08048000-08083000 r-xp 00000000 08:01 677982     /usr/lib/cgi-bin/zoo_loader.cgi
08083000-08084000 r--p 0003a000 08:01 677982     /usr/lib/cgi-bin/zoo_loader.cgi
08084000-08085000 rw-p 0003b000 08:01 677982     /usr/lib/cgi-bin/zoo_loader.cgi
08085000-08092000 rw-p 00000000 00:00 0
097fe000-09868000 rw-p 00000000 00:00 0          [heap]
b1ba9000-b1dc5000 rw-p 00000000 00:00 0
b1dc5000-b1dcd000 rw-s 00000000 08:01 782763     /tmp/hsperfdata_www-data/29744
b1dcd000-b1df0000 r-xp 00000000 08:01 1053820
/usr/lib/jvm/jdk1.7.0_71/jre/lib/i386/libjava.so
...

I committed everything to github. Can you have another check on the
code. I first want to make sure that I have everything right in that
spot.

>
> So as you noticed, when you have more than one DataInputs, you should separate each input name by using semicolon (« ; »).
>
> side-note: As explained in a different thread today, you can also use the prefixed service name: zoojavatest. ZooJavaBuilder as Identifier value in your request.

I tried that, but it doesn't load the main.cfg that is inside zoojavatest.
Also how to handle this in the case of a getCapabilities request? In
that case you need the metapath to make sure you pick the right spot.

Andrea


More information about the Zoo-discuss mailing list