here is the complete code after setting the User credentials

URL url = new URL("http://bg4ws0099:7047/DynamicsNAV/WS/Services";);

                JaxWsDynamicClientFactory clientFactory = 
JaxWsDynamicClientFactory
                                .newInstance();

                Client client = 
clientFactory.createClient(url.toExternalForm());

HTTPConduit http = (HTTPConduit) client.getConduit();
                AuthorizationPolicy policy = new AuthorizationPolicy();
                policy.setUserName("newuser1");
                policy.setPassword("calling123");
                http.setAuthorization(policy);
                HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
                httpClientPolicy.setConnectionTimeout(60000);
                httpClientPolicy.setAllowChunking(false);
                httpClientPolicy.setReceiveTimeout(60000);
                http.setClient(httpClientPolicy);
                Object[] responseArray = null;
                try {
                        responseArray = client.invoke("Read", new 
String("10000"));
                } catch (Exception e) {
                        
                        System.out.println("EXCEPTION is " + e.getCause());
                        System.out.println("EXCEPTION is " + e);
                        
                }

                System.out.println(responseArray[0]);




--
View this message in context: 
http://cxf.547215.n5.nabble.com/Error-When-Generating-Client-tp5724501p5724502.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Reply via email to