cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shafi_WS <shafiuddin...@sonata-software.com>
Subject Re: Error When Generating Client
Date Wed, 13 Mar 2013 12:53:56 GMT
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.

Mime
View raw message