本文整理汇总了Java中org.apache.axis.client.Call.setTimeout方法的典型用法代码示例。如果您正苦于以下问题:Java Call.setTimeout方法的具体用法?Java Call.setTimeout怎么用?Java Call.setTimeout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axis.client.Call
的用法示例。
在下文中一共展示了Call.setTimeout方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCall
import org.apache.axis.client.Call; //导入方法依赖的package包/类
private Call createCall() throws RemoteException {
try {
Call _call = super._createCall();
if (super.maintainSessionSet) {
_call.setMaintainSession(super.maintainSession);
}
if (super.cachedUsername != null) {
_call.setUsername(super.cachedUsername);
}
if (super.cachedPassword != null) {
_call.setPassword(super.cachedPassword);
}
if (super.cachedEndpoint != null) {
_call.setTargetEndpointAddress(super.cachedEndpoint);
}
if (super.cachedTimeout != null) {
_call.setTimeout(super.cachedTimeout);
}
if (super.cachedPortName != null) {
_call.setPortName(super.cachedPortName);
}
java.util.Enumeration keys = super.cachedProperties.keys();
while (keys.hasMoreElements()) {
String key = (String) keys.nextElement();
_call.setProperty(key, super.cachedProperties.get(key));
}
return _call;
} catch (Throwable _t) {
throw new AxisFault("Failure trying to get the Call object", _t);
}
}
示例2: main
import org.apache.axis.client.Call; //导入方法依赖的package包/类
public static void main(String args[]) throws Exception {
FileReader reader = new FileReader();
reader.setDaemon(true);
reader.start();
Options opts = new Options( args );
args = opts.getRemainingArgs();
if ( args == null ) {
System.err.println( "Usage: GetQuote <symbol>" );
System.exit(1);
}
String symbol = args[0] ;
Service service = new Service(new XMLStringProvider(wsdd));
Call call = (Call) service.createCall();
call.setOperationName( new QName("urn:xmltoday-delayed-quotes", "getQuote") );
call.addParameter( "symbol", XMLType.XSD_STRING, ParameterMode.IN );
call.setReturnType( XMLType.XSD_FLOAT );
call.setTransport( new FileTransport() );
call.setUsername(opts.getUser() );
call.setPassword(opts.getPassword() );
call.setTimeout(new Integer(10000));
Float res = new Float(0.0F);
res = (Float) call.invoke( new Object[] {symbol} );
System.out.println( symbol + ": " + res );
reader.halt();
}
示例3: main
import org.apache.axis.client.Call; //导入方法依赖的package包/类
public static void main(String args[]) throws Exception {
Options opts = new Options( args );
// first check if we should print usage
if ((opts.isFlagSet('?') > 0) || (opts.isFlagSet('h') > 0))
printUsage();
HashMap connectorMap = SimpleJMSListener.createConnectorMap(opts);
HashMap cfMap = SimpleJMSListener.createCFMap(opts);
String destination = opts.isValueSet('d');
String username = opts.getUser();
String password = opts.getPassword();
// create the jms listener
SimpleJMSListener listener = new SimpleJMSListener(connectorMap,
cfMap,
destination,
username,
password,
false);
listener.start();
args = opts.getRemainingArgs();
if ( args == null || args.length == 0)
printUsage();
Service service = new Service(new XMLStringProvider(wsdd));
// create the transport
JMSTransport transport = new JMSTransport(connectorMap, cfMap);
// create a new Call object
Call call = (Call) service.createCall();
call.setOperationName( new QName("urn:xmltoday-delayed-quotes", "getQuote") );
call.addParameter( "symbol", XMLType.XSD_STRING, ParameterMode.IN );
call.setReturnType( XMLType.XSD_FLOAT );
call.setTransport(transport);
// set additional params on the call if desired
//call.setUsername(username );
//call.setPassword(password );
//call.setProperty(JMSConstants.WAIT_FOR_RESPONSE, Boolean.FALSE);
//call.setProperty(JMSConstants.PRIORITY, new Integer(5));
//call.setProperty(JMSConstants.DELIVERY_MODE,
// new Integer(javax.jms.DeliveryMode.PERSISTENT));
//call.setProperty(JMSConstants.TIME_TO_LIVE, new Long(20000));
call.setProperty(JMSConstants.DESTINATION, destination);
call.setTimeout(new Integer(10000));
Float res = new Float(0.0F);
// invoke a call for each of the symbols and print out
for (int i = 0; i < args.length; i++)
{
try
{
res = (Float) call.invoke(new Object[] {args[i]});
System.out.println(args[i] + ": " + res);
}
catch(AxisFault af)
{
System.out.println(af.dumpToString());
}
}
// shutdown
listener.shutdown();
transport.shutdown();
}
示例4: getMetadata
import org.apache.axis.client.Call; //导入方法依赖的package包/类
private String getMetadata() {
try {
Configuration configuration = getConfigBean();
JsonNode json = configuration.getJson();
String endpoint = json.get("endpoint").textValue();
Call call = (Call) new Service().createCall();
call.setTimeout(new Integer(0));
call.setTargetEndpointAddress(endpoint);
call.setOperationName(new QName("describe"));
String metadata = (String) call.invoke(new Object[0]);
logger.info(metadata);
// Old impl, returns a tree of the XML
// ColXMLTree tree = new ColXMLTree(metadata);
URL sheetURL = SoaplabActivityContextualView.class
.getResource("/analysis_metadata_2_html.xsl");
TransformerFactory transformerFactory = TransformerFactory.newInstance();
logger.info(sheetURL.toString());
Templates stylesheet = transformerFactory.newTemplates(new StreamSource(sheetURL
.openStream()));
Transformer transformer = stylesheet.newTransformer();
StreamSource inputStream = new StreamSource(new ByteArrayInputStream(
metadata.getBytes()));
ByteArrayOutputStream transformedStream = new ByteArrayOutputStream();
StreamResult result = new StreamResult(transformedStream);
transformer.transform(inputStream, result);
transformedStream.flush();
transformedStream.close();
// String summaryText = "<html><head>"
// + WorkflowSummaryAsHTML.STYLE_NOBG + "</head>"
// + transformedStream.toString() + "</html>";
// JEditorPane metadataPane = new ColJEditorPane("text/html",
// summaryText);
// metadataPane.setText(transformedStream.toString());
// // logger.info(transformedStream.toString());
// JScrollPane jsp = new JScrollPane(metadataPane,
// JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
// JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
// jsp.setPreferredSize(new Dimension(0, 0));
// jsp.getVerticalScrollBar().setValue(0);
return transformedStream.toString();
} catch (Exception ex) {
return "<font color=\"red\">Error</font><p>An exception occured while trying to fetch Soaplab metadata from the server. The error was :<pre>"
+ ex.getMessage() + "</pre>";
}
}
开发者ID:apache,项目名称:incubator-taverna-plugin-bioinformatics,代码行数:47,代码来源:SoaplabActivityContextualView.java