No - that's not true :-)

I see then I am confused ... let me check - adding a test method to ParserTest with the following "naked" configuration.

    public void testNakedXMLParse() throws Exception {
        // set up a parser that only has the the xml schema bindings
        Parser parser = new Parser( new XMLConfiguration() );

        parser.setValidating(false);

        

        Map map =  (Map) parser.parse( MLSchemaLocationResolver.class.getResourceAsStream("mails.xml"));
        List mail = (List) map.get("mail");
        Map mail0 = (Map) mail.get(0);
        System.out.println( "mail0:"+mail0 );
        String id = (String) mail0.get("id");
        assertEquals( "xs int", "0", id ); // xsd simple type bindings not provided

        Map envelope = (Map) mail0.get("envelope");        
        List<String> from = (List<String>) envelope.get("From");
        assertEquals( "xs string multiplicity","b...@microsoft.com", from.get(0) );

        

        Map mail1 = (Map) mail.get(1);       
        assertNotNull( "mail multiplicity", mail1);
    }

That passes for me - the id should come out as an Integer because it is an xsd integer the schema; but I have not added the xsd bindings so it comes out as a string rather then an integer.

Justin I tried with the XSD configuration and it still came out as a String rather then an integer so am I doing something wrong? Somehow I think I need to tell it where to find the mails.xsd file as part of the configuration?

In my application I'm using GeoTool's WPSFactory to execute a WPS process and the input parameters are stored in a Map<String,Object>. Everything behind (Encoding, connection to WPS,...) is wrapped by GeoTools. I'm not configuring the binding or anything else.

This is where the WPS spec is being magic on you; if you look at the examples in the spec they start sneaking in references to the schema for any of their complex types at the top of the file.

Where we left off at with the wps code at refreactions was going through the schema definitions and setting up a configuration *just* for that particular request  - ie checking the describe process for references to any complex schemas and checking if we have any bindings for the content mentioned and adding those bindings to our configuration when we go to encode our request or parse the result.

So my original problem was just: What do I have to store in the input parameter Map for complex data parameters:
- XML Object tree (not possible for all the schemas)
- Map-based objec tree (as you explained)
- String with XML fragment

Can we be more specific - can we work through your example or something? 

Maybe this was a misunderstanding.

I think it is a case of WPS + XML being too smart for our own good.

I have to think about it. Perhaps I will try a more straight forward (but not generic) way and directly trigger the WPS without using GeoTools WPSFactory but with saved XML-Request and a URLConnection.

It is a question of where you want the complexity to be handled; what I am trying to avoid is the soap situation where people rely on code generators to access one single WPS services. 

Jody

Attached parser test  - Justin could we show some basic out of the box bindings using the mails.xml example in the xml developers good prior to implementing bindings?

Attachment: ParserTest.java
Description: Binary data

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to