[Zoo-discuss] java service example 2

Fenoy Gerald gerald.fenoy at geolabs.fr
Mon Nov 17 00:35:46 PST 2014


Hi Andrea,
sorry for answering your email lately.
First of all I thank you for publishing the service source code and to propose to maintain it on github.

I confirm that the initial issue was correct. In this file [1] we can see on line 11 and 12 that you are expecting to access the value of an input directly by accessing it using its name. Nevertheless, it is the same structure as the one used in other languages, so in Java it will be HashMap of HashMap of String rather than simply HashMap of String. So when you use the following,it will return a HashMap:

inputs.get(« inPath »);

In fact, the way to access values is illustrated in the commented lines on line 19 and 20 and should be transformed to the following in your case:

HashMap inPathM=(HashMap) inputs.get("inPath");
String inPath = (String) inPathM.get(« value »);
HashMap outPathM=(HashMap) inputs.get(« outPath");
String outPath = (String) outPathM.get("outPath »);

As I used the same variable names, I guess this should work after applying this correction to the source code.

I hope this solve the issue and you can confirm that this fix work for the service.

Hope to hear back from you,
Best regards,

[1] https://github.com/moovida/zoo-java-example-service/blob/master/ZooJavaMain/src/org/jgrasstools/ZooJavaWps.java

> Le 14 nov. 2014 à 10:43, andrea antonello <andrea.antonello at gmail.com> a écrit :
> 
> Hi Gerald,
> I am starting a new thread on this, in order to not pollute the old one.
> 
> I have created a github project with the example java service:
> https://github.com/moovida/zoo-java-example-service
> 
> I also put there all the documentation (readme) of what is inside and
> how to create the necessary jars and dependencies.
> 
> I tried to make this work directly in zoo, but there are errors that
> don't seem to be pertinent and I have no idea about how to get
> something more precise out of it.
> 
> It would be great if you could find the time to run this and we can
> then fix the project to make it properly work on zoo.
> 
> Let me know what you think.
> 
> Thanks,
> Andrea
> _______________________________________________
> Zoo-discuss mailing list
> Zoo-discuss at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/zoo-discuss



Gérald Fenoy
http://wiki.osgeo.org/wiki/User:Djay



More information about the Zoo-discuss mailing list