getComplexData problem

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

getComplexData problem

fran
Hi all,

I am trying to execute getComplexData against a returned collection of features (from http://geoprocessing.demo.52north.org:8080/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=topp:tasmania_water_bodies&outputformat=gml3) in the following line of code:

IData data = (IData) analyser.getComplexData("result", GenericFileDataBinding.class);

But I keep getting an error as follows:

java.lang.RuntimeException: Could not find suitable parser
        at wps.client.ExecuteResponseAnalyser.parseProcessOutput(ExecuteResponseAnalyser.java:250)
        at wps.client.ExecuteResponseAnalyser.getComplexData(ExecuteResponseAnalyser.java:89)
        at wps.client.PositionQualityClient.executeProcess(PositionQualityClient.java:267)
        at wps.client.PositionQualityClient.testExecute(PositionQualityClient.java:106)
        at wps.client.PositionQualityClient.main(PositionQualityClient.java:291)


I have set all the mime types, encoding, and the schema to be relevant to http://schemas.opengis.net/gml/3.1.1/base/gml.xsd, and also added these in a addComplexDataReference call:

  executeBuilder.addComplexDataReference( inputName,
                                                                        (String) inputValue,
                                                                     "http://schemas.opengis.net/gml/3.1.1/base/gml.xsd",
                                                                        null, "text/xml; subtype=gml/3.1.1");


Can anyone help me please?

Thanks,
Fran
Reply | Threaded
Open this post in threaded view
|

Re: getComplexData problem

BenjaminPross
Hello Fran,

Can you please attach the process description and, if possible, the execute request?

Cheers,

Benjamin
Reply | Threaded
Open this post in threaded view
|

Re: getComplexData problem

fran
Hi Benjamin,

please find enclosed the process description and the execute request:

DistanceTokthNeighbourFeature.xmlexecuteprocess.txt

Thanks,
Fran
Reply | Threaded
Open this post in threaded view
|

Re: getComplexData problem

BenjaminPross
Alright,

The code you attached differs from what you wrote in your first post, so I am not sure I can help with your original problem.

In order to get the attached setup to work you will need to:

1. Change the following format of the GML3BasicParser and -Generator in the wps_config_geotools file of your deployed WPS:
                               
                                <Format mimetype="text/xml; subtype=gml/3.1.1"
                                        schema="http://schemas.opengis.net/gml/3.1.1/base/feature.xsd" />
                                       
                                        to
                                       
                                                                        <Format mimetype="text/xml; subtype=gml/3.1.1"
                                        schema="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd" />
                                       
Alternatively you could change the schema that on the client side.
       
2. Remove the wps_config (NOT wps_config_geotools) from the config directory of your deployed WPS.

3. Request the right output, i.e:

Either:

   executeBuilder.setMimeTypeForOutput("text/xml; subtype=gml/3.1.1", "result");
   
   executeBuilder.setSchemaForOutput(
                    "http://schemas.opengis.net/gml/3.1.1/base/gml.xsd",
                   "result");
        ...
               
    IData data = (IData) analyser.getComplexData("result", GTVectorDataBinding.class);
       
       
        or

   executeBuilder.setMimeTypeForOutput("text/xml; subtype=gml/3.1.1", "qual_result");
   
   executeBuilder.setSchemaForOutput(
                    "http://schemas.opengis.net/gml/3.1.1/base/gml.xsd",
                   "qual_result");
       ...
               
    IData data = (IData) analyser.getComplexData("qual_result", GTVectorDataBinding.class);

4. Replace the ExecuteResponseAnalyser with the attached one ExecuteResponseAnalyser.java.

Hope this helps.

Cheers,

Benjamin
Reply | Threaded
Open this post in threaded view
|

Re: getComplexData problem

fran
Hi Benjamin,

Thanks for this, removing the wps_config.xml file from the config folder has resolved the issue.

Thanks,
Fran