/*
 * Created on 19.05.2006
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package org.client;

import localhost.axis2.services.cat.OAQueryPropertyType;
import localhost.axis2.services.cat.OAQueryType;
import localhost.axis2.services.cat.OASearchRequestDocument;
import localhost.axis2.services.cat.OASearchRequestType;
import localhost.axis2.services.cat.OASearchResponseDocument;

import org.apache.axis2.AxisFault;
import org.example.types.CatStub;
import org.example.types.CatStub;
//import org.example.types.Sfgs2Stub;


//import sfgs2.FeatureTypeDocument;
//import sfgs2.GenericFeatureTypeDocument;


/**
 * @author hil
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class CATClient {

    public static void main(String[] args) {
        try {

            System.out.println("CAT Client...");
            String url = "http://localhost:8082/axis2/services/cat";
            System.out.println("url "+url);
            CatStub stub = new CatStub(url);            
            System.out.println("stub "+stub);
            
            OAQueryType query = OAQueryType.Factory.newInstance();
            query.setQuery("WMS");
            OAQueryPropertyType queryPropertyType = OAQueryPropertyType.Factory.newInstance();
            queryPropertyType.setOAQuery(query);
            OASearchRequestType searchRequest = OASearchRequestType.Factory.newInstance();
            searchRequest.setQuery(queryPropertyType);
            OASearchRequestDocument searchRequestDocument = OASearchRequestDocument.Factory.newInstance();
            searchRequestDocument.setOASearchRequest(searchRequest);
            System.out.println("vor search");
            OASearchResponseDocument response = stub.search(searchRequestDocument);            
            System.out.println("response "+response);
            
            System.out.println("CAT client Ende");           

        } catch (AxisFault axisFault) {
            axisFault.printStackTrace();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}
