Hi,

I have a strange problem when I use ClientProxyFactoryBean. I have created a
Cxf project (using cxf 2.1.2) and generated code from my WSDL file using
wsdl2java generator.

In the following unit test, the result of the web service call is NULL. 

        private static String ADDRESS = "http://localhost:9000/unittesttrack";;
        
        @BeforeClass
    public static void startServer() throws Exception {
        // We need to start a server that exposes or webservice during the
unit testing
        // We use jaxws to do this pretty simple
        TrackerServiceImpl server = new TrackerServiceImpl();
        Endpoint.publish(ADDRESS, server);

    }
        
        @Test
        public void serverStarted() throws Exception {
        // Start server
        this.startServer();
        }
        

        @Test
        public void shouldGenerateWsdl() throws Exception {
                URL url = new URL(ADDRESS + "?wsdl");
                URLConnection connection = url.openConnection();
                Assert.assertNotNull(connection.getContent());
                showResponse(connection);
        }

        @Test
        public void shouldHaveParcelViaWebService() throws Exception {
                XMLGregorianCalendar calendar =
DatatypeFactory.newInstance().newXMLGregorianCalendar( new
GregorianCalendar());
        calendar.setDay(7);
        calendar.setMonth(10);
        calendar.setYear(2008);
        
        // Create web service client
        createWebServiceClient();
                
        TrackParcelEndpoint client = createWebServiceClient();
                InputTrackParcel parcel = new InputTrackParcel();
                parcel.setName("chm");
                parcel.setDestination("Brussels");
                parcel.setOrigin("Florennes");
                parcel.setDeliveryDate(calendar);
                
                OutputTrackParcel result = client.PostParcel(parcel);
                Log.info("Result : " + result.getReference()); <<<<<  NULL 
POINTER
EXCEPTION IS GENERATED HERE
                Assert.assertNotNull(result);
        }

        private TrackParcelEndpoint createWebServiceClient() {
        
                ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
                factory.setServiceClass(TrackParcelEndpoint.class);
                factory.setAddress(ADDRESS);
                TrackParcelEndpoint client = (TrackParcelEndpoint) 
factory.create();
                return client;
        }

Surprisingly, if I try to connect to the server using the SOAPUI client, my
SOAPUI client receives a reply from the service.

How can I solve/debug my problem ?

Charles Moulliard

-----
Enterprise Architect

Xpectis
12, route d'Esch
L-1470 Luxembourg

Phone +352 25 10 70 470
Mobile +352 621 45 36 22

e-mail : [EMAIL PROTECTED]
web site :  www.xpectis.com www.xpectis.com 
My Blog :  http://cmoulliard.blogspot.com/ http://cmoulliard.blogspot.com/  
-- 
View this message in context: 
http://www.nabble.com/ClientProxyFactoryBean-return-null-%21%21%21-tp19876268p19876268.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to