axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Saminda Abeyruwan <sami...@opensource.lk>
Subject Re: [Axis2][0.94] How can i shutdown connection after call
Date Wed, 15 Mar 2006 05:16:02 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Forwarded with Axis2 prefix;

Filipp Akinfiev wrote:
> Hi all,
> in my client class  i have function like :
>   public TFileSendResponse storeFile(int type, String fileName, String 
> pathToFile) {
>     	TFileSendResponse response = null;
>     	try {
>     		response = FileSend.response(makeCall(FileSend.request(new TFileSend("", 
> "", type, fileName, pathToFile)), "storeFile"));	
> 		} catch (Exception e) {
> 			e.printStackTrace();
> 		}
> 		return response;
> 	}
> 
> it's call function makeCall:
> 
>     private MessageContext makeCall(MessageContext requestContext, String 
> action) {
>     	ServiceClient client;
>     	MessageContext result = null;
>     	try {
>     		// creating the Service
>     		AxisService service = new AxisService("IXMLWS2");
> 
>     		// creating the operations
>     		AxisOperation operation = new OutInAxisOperation();
>        		operation.setName(new 
> javax.xml.namespace.QName("urn:XMLWSIntf-IXMLWS", action));
>     		service.addOperation(operation);
>     		client = new ServiceClient(new 
> ConfigurationContextFactory().createConfigurationContextFromFileSystem(AXIS2_HOME), 
> service);
>     		client.getOptions().setTo(targetEPR);
>     		client.getOptions().setSoapAction("urn:XMLWSIntf2-IXMLWS2#" + action);
>     		client.getOptions().setExceptionToBeThrownOnSOAPFault(true);
>     		client.getOptions().setTransportInProtocol(Constants.TRANSPORT_TCP);
>     		
> client.getOptions().setProperty(org.apache.axis2.context.MessageContextConstants.CHUNKED,org.apache.axis2.Constants.VALUE_FALSE);
>     		client.getOptions().setProperty(Constants.Configuration.ENABLE_MTOM, 
> Constants.VALUE_TRUE);
> 
>     		OperationClient opClient = client.createClient(new 
> javax.xml.namespace.QName("urn:XMLWSIntf-IXMLWS", action));
> 
>       		opClient.addMessageContext(requestContext);
>       		opClient.execute(true);
>        	 
>     		return opClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
>     	} catch (AxisFault e) {
>     		e.printStackTrace();
>     	}
> 		return result;
>     }
> 
> after execute, i have open connection to axis server, how can i terminate it ?
> 
> thanks in advance!
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEF6MSYmklbLuW6wYRAlTGAJ4n3SH1JWxetBKHCEKQrrElU6mSDgCfeWfo
dmgUxQMXh+WqSEftnO+OGJ8=
=jW7k
-----END PGP SIGNATURE-----

Mime
View raw message