axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gibyALEX <alexg...@gmail.com>
Subject Issue with AXis2 client code connection
Date Wed, 06 Jun 2012 08:10:34 GMT

I am Getting error like  while using AXIs2 ....  Can any help me .. i didn't
get what is issue...

org.apache.axis2.AxisFault: Connection refused: connect
	at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
	at
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:203)
	at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:76)
	at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:400)
	at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:225)
	at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:438)
	at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:402)
	at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
	at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
	at
com.taleo.www.ws.tee800._2009._01.find.FindServiceStub.findPartialEntities(FindServiceStub.java:497)
	at com.taleo.demo.TaleoDemo.exportRequisition(TaleoDemo.java:101)
	at com.taleo.demo.TaleoDemo.main(TaleoDemo.java:43)
Caused by: java.net.ConnectException: Connection refused: connect
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
	at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:367)
	at java.net.Socket.connect(Socket.java:524)
	at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:545)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:592)
	at
org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:140)
	at
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:130)
	at
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
	at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
	at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
	at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
	at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
	at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
	at
org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:557)
	at
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:199)
	... 10 more
The Client Code is the Below one...
--------------------------------------------------------------------------------------------------
	public static void main(String[] args) {
		TaleoDemo taleDemo = new TaleoDemo();
		String returnValue = null;
		try {
			returnValue = taleDemo.exportRequisition(pEndpoint, pUsername,
					pPassword, pPageIndex);
		} catch (RemoteException e) {
			e.printStackTrace();
		} 		
		catch (Exception ex) {
		ex.printStackTrace();
		}
		
		System.out.println("The Return value is"+returnValue);

	}

	private String exportRequisition(String pEndpoint, String pUsername,
			String pPassword, int pPageIndex) throws RemoteException,Exception {
		FindServiceStub stub = new FindServiceStub(pEndpoint);
		HttpTransportProperties.Authenticator auth = new
HttpTransportProperties.Authenticator();
		auth.setUsername(pUsername);
		auth.setPassword(pPassword);
		auth.setPreemptiveAuthentication(true);
		stub._getServiceClient().getOptions().setProperty(
				HTTPConstants.AUTHENTICATE, auth);
		FindPartialEntitiesDocument findDoc = FindPartialEntitiesDocument.Factory
				.newInstance();
		FindPartialEntitiesDocument.FindPartialEntities find = findDoc
				.addNewFindPartialEntities();
		find.setMappingVersion("http://www.taleo.com/ws/tee800/2009/01");
		SqxmlQuery sqxmlquery = find.addNewQuery();
		Query query = sqxmlquery.addNewQuery();
		query.setAlias("Find Open and Posted Requisitions");
		query.setProjectedClass("Requisition");
		Projections projections = query.addNewProjections();
		Projection contestNumberProj = projections.addNewProjection();
		Field contestNumberField = contestNumberProj.addNewField();
		contestNumberField.setPath("ContestNumber");
		Projection jobInfoTitleProj = projections.addNewProjection();
		Field jobInfoTitleField = jobInfoTitleProj.addNewField();
		jobInfoTitleField.setPath("JobInformation,Title");
		Filterings filterings = query.addNewFilterings();
		Filtering filtering = filterings.addNewFiltering();
		IncludedIn includedIn = filtering.addNewIncludedIn();
		Field stateField = includedIn.addNewField();
		stateField.setPath("State,Number");
		List stateList = includedIn.addNewList();
		Long open = stateList.addNewLong();
		open.setLongValue(3);
		Long posted = stateList.addNewLong();
		posted.setLongValue(13);
		Sortings sortings = query.addNewSortings();
		Sorting sorting = sortings.addNewSorting();
		Field contestNumberSortingField = sorting.addNewField();
		contestNumberSortingField.setPath("ContestNumber");
		String2StringMap attrs = find.addNewAttributes();
		Entry entry = attrs.addNewEntry();
		entry.setKey("pageindex");
		entry.setValue(String.valueOf(pPageIndex));
		FindPartialEntitiesResponseDocument response;
		try {
			response = stub.findPartialEntities(findDoc);
		} catch (WebServiceFault e) {
			System.err.println("Error while creating the candidate: "
					+ e.getFaultMessage().getWebServiceFault().getMessage());
			throw new RuntimeException(e);
		}
		FindPartialEntitiesResponse rsp = response
				.getFindPartialEntitiesResponse();
		Entities entities = rsp.getEntities();
		System.out.println("Fetched page: " + entities.getPageIndex() + "/"
				+ entities.getPageCount());
		if (!entities.getPageCount().equals(entities.getPageIndex())) {
			return exportRequisition(pEndpoint, pUsername, pPassword,
					+pPageIndex);
		} else {
			Requisition requisition = (Requisition)
entities.getEntityArray()[entities
					.sizeOfEntityArray() - 1];
			return requisition.getContestNumber();
		}
	}

----------------------------------------------------------------------

etting error like ....
-- 
View this message in context: http://old.nabble.com/Issue-with-AXis2-client-code-connection-tp33968566p33968566.html
Sent from the Axis - User mailing list archive at Nabble.com.

Mime
View raw message