本文整理汇总了Java中org.apache.axis.utils.Messages类的典型用法代码示例。如果您正苦于以下问题:Java Messages类的具体用法?Java Messages怎么用?Java Messages使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Messages类属于org.apache.axis.utils包,在下文中一共展示了Messages类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSocket
import org.apache.axis.utils.Messages; //导入依赖的package包/类
/**
* Creates a socket connection to the SOAP server
*
* @param protocol "http" for standard, "https" for ssl.
* @param host host name
* @param port port to connect to
* @param otherHeaders buffer for storing additional headers that need to be sent
* @param useFullURL flag to indicate if the complete URL has to be sent
*
* @throws IOException
*/
protected void getSocket(SocketHolder sockHolder,
MessageContext msgContext,
String protocol,
String host, int port, int timeout,
StringBuffer otherHeaders,
BooleanHolder useFullURL)
throws Exception {
Hashtable options = getOptions();
if(timeout > 0) {
if(options == null) {
options = new Hashtable();
}
options.put(DefaultSocketFactory.CONNECT_TIMEOUT,Integer.toString(timeout));
}
SocketFactory factory = SocketFactoryFactory.getFactory(protocol, options);
if (factory == null) {
throw new IOException(Messages.getMessage("noSocketFactory", protocol));
}
Socket sock = factory.create(host, port, otherHeaders, useFullURL);
if(timeout > 0) {
sock.setSoTimeout(timeout);
}
sockHolder.setSocket(sock);
}
示例2: doGet
import org.apache.axis.utils.Messages; //导入依赖的package包/类
/**
* Process GET requests. This includes handoff of pseudo-SOAP requests
*
* @param request request in
* @param response request out
* @throws ServletException
*/
public void doGet(HttpServletRequest request, HttpServletResponse response, Component component) throws ServletException {
PrintWriter writer = new FilterPrintWriter(response);
try {
if (!doGet(request, response, writer,component)) {
response.setContentType("text/html; charset=utf-8");
writer.println("<html><h1>Lucee Webservice</h1>");
writer.println(Messages.getMessage("reachedServlet00"));
writer.println("<p>" + Messages.getMessage("transportName00","<b>http</b>"));
writer.println("</html>");
}
}
catch (Throwable e) {
ExceptionUtil.rethrowIfNecessary(e);
if(e instanceof InvocationTargetException)
e= ((InvocationTargetException)e).getTargetException();
if(e instanceof PageException)
throw new PageServletException((PageException)e);
throw new ServletException(e);
}
}
示例3: processAxisFault
import org.apache.axis.utils.Messages; //导入依赖的package包/类
/**
* routine called whenever an axis fault is caught; where they
* are logged and any other business. The method may modify the fault
* in the process
* @param fault what went wrong.
*/
private void processAxisFault(AxisFault fault) {
//log the fault
Element runtimeException = fault.lookupFaultDetail(
Constants.QNAME_FAULTDETAIL_RUNTIMEEXCEPTION);
if (runtimeException != null) {
exceptionLog.info(Messages.getMessage("axisFault00"), fault);
//strip runtime details
fault.removeFaultDetail(Constants.
QNAME_FAULTDETAIL_RUNTIMEEXCEPTION);
} else if (exceptionLog.isDebugEnabled()) {
exceptionLog.debug(Messages.getMessage("axisFault00"), fault);
}
//dev systems only give fault dumps
//if (!isDevelopment()) {
//strip out the stack trace
fault.removeFaultDetail(Constants.QNAME_FAULTDETAIL_STACKTRACE);
//}
}
示例4: doGet
import org.apache.axis.utils.Messages; //导入依赖的package包/类
/**
* Process GET requests. This includes handoff of pseudo-SOAP requests
*
* @param request request in
* @param response request out
* @throws ServletException
*/
public void doGet(HttpServletRequest request, HttpServletResponse response, Component component) throws ServletException {
PrintWriter writer = new FilterPrintWriter(response);
try {
if (!doGet(request, response, writer,component)) {
ReqRspUtil.setContentType(response,"text/html; charset=utf-8");
writer.println("<html><h1>"+lucee.runtime.config.Constants.NAME+" Webservice</h1>");
writer.println(Messages.getMessage("reachedServlet00"));
writer.println("<p>" + Messages.getMessage("transportName00","<b>http</b>"));
writer.println("</html>");
}
}
catch (Throwable e) {
ExceptionUtil.rethrowIfNecessary(e);
if(e instanceof InvocationTargetException)
e= ((InvocationTargetException)e).getTargetException();
if(e instanceof PageException)
throw new PageServletException((PageException)e);
throw new ServletException(e);
}
}
示例5: processAxisFault
import org.apache.axis.utils.Messages; //导入依赖的package包/类
/**
* routine called whenever an axis fault is caught; where they
* are logged and any other business. The method may modify the fault
* in the process
* @param fault what went wrong.
*/
private void processAxisFault(AxisFault fault) {
//log the fault
Element runtimeException = fault.lookupFaultDetail(
Constants.QNAME_FAULTDETAIL_RUNTIMEEXCEPTION);
if (runtimeException != null) {
exceptionLog.info(Messages.getMessage("axisFault00"), fault);
//strip runtime details
fault.removeFaultDetail(Constants.
QNAME_FAULTDETAIL_RUNTIMEEXCEPTION);
} else if(exceptionLog.isDebugEnabled()){
exceptionLog.debug(Messages.getMessage("axisFault00"), fault);
}
//dev systems only give fault dumps
//if (!isDevelopment()) {
//strip out the stack trace
fault.removeFaultDetail(Constants.QNAME_FAULTDETAIL_STACKTRACE);
//}
}
示例6: invokeCFCFunction
import org.apache.axis.utils.Messages; //导入依赖的package包/类
public Object invokeCFCFunction(MessageContext msgContext, cfSession session, String cfcName, cfStructData method, Object[] argValues) throws Exception {
// Create the cfc
cfComponentData cfc = new cfComponentData(session, cfcName);
if (cfc == null || cfc.getMetaData() == null || cfc.getMetaData().isEmpty())
throw new AxisFault(Messages.getMessage("noClassForService00", cfcName));
// Convert the params
cfArgStructData args = prepareArgs(session, method, argValues);
// Execute the cfc
cfData rtn = invokeComponentMethod(session, method, args, cfc);
if (rtn == null || rtn instanceof cfNullData)
return null;
else {
return tagUtils.getNatural(rtn, true, true, true);
}
}
示例7: logMessages
import org.apache.axis.utils.Messages; //导入依赖的package包/类
private void logMessages(MessageContext msgContext) throws AxisFault {
try {
Message inMsg = msgContext.getRequestMessage();
Message outMsg = msgContext.getResponseMessage();
StringBuffer msg = new StringBuffer();
if (start != -1) {
msg.append("= " + Messages.getMessage("elapsed00", "" + (System.currentTimeMillis() - start))).append('\n');
}
msg.append("= " + Messages.getMessage("inMsg00", (inMsg == null ? "null" : inMsg.getSOAPPartAsString()))).append('\n');
msg.append("= " + Messages.getMessage("outMsg00", (outMsg == null ? "null" : outMsg.getSOAPPartAsString()))).append('\n');
switch (logLevel) {
case "debug": log.debug(msg); break;
case "info": log.info(msg); break;
case "warn": log.warn(msg); break;
case "error": log.error(msg); break;
default:
log.trace(msg);
}
} catch (Exception e) {
log.error(Messages.getMessage("exception00"), e);
throw AxisFault.makeFault(e);
}
}
示例8: validateOptions
import org.apache.axis.utils.Messages; //导入依赖的package包/类
/**
* validateOptions
* This method is invoked after the options are set to validate and default the options
* the option settings.
*/
protected void validateOptions() {
if (wsdlURI == null) {
System.out.println(Messages.getMessage("w2jMissingWSDLURI00"));
printUsage();
}
if (parser.isQuiet()) {
if (parser.isVerbose()) {
System.out.println(Messages.getMessage("exclusiveQuietVerbose"));
printUsage();
}
if (parser.isDebug()) {
System.out.println(Messages.getMessage("exclusiveQuietDebug"));
printUsage();
}
}
// Set username and password if provided in URL
checkForAuthInfo(wsdlURI);
Authenticator.setDefault(new DefaultAuthenticator(parser.getUsername(),
parser.getPassword()));
}
示例9: isHostInNonProxyList
import org.apache.axis.utils.Messages; //导入依赖的package包/类
/**
* Check if the specified host is in the list of non proxy hosts.
*
* @param host host name
* @param nonProxyHosts string containing the list of non proxy hosts
* @return true/false
*/
protected boolean isHostInNonProxyList(String host, String nonProxyHosts)
{
if( (nonProxyHosts == null) || (host == null) )
{
return false;
}
/*
* The http.nonProxyHosts system property is a list enclosed in double
* quotes with items separated by a vertical bar.
*/
StringTokenizer tokenizer = new StringTokenizer(nonProxyHosts, "|\"");
while( tokenizer.hasMoreTokens() )
{
String pattern = tokenizer.nextToken();
if( log.isDebugEnabled() )
{
log.debug(Messages.getMessage("match00", new String[]{"HTTPSender", host, pattern}));
}
if( match(pattern, host, false) )
{
return true;
}
}
return false;
}
示例10: onFault
import org.apache.axis.utils.Messages; //导入依赖的package包/类
public void onFault(MessageContext msgContext) {
try {
Handler serviceHandler = msgContext.getService();
String filename = (String) getOption("filename");
if ((filename == null) || (filename.equals("")))
throw new AxisFault("Server.NoLogFile",
"No log file configured for the LogHandler!",
null, null);
FileWriter fw = new FileWriter(filename, true);
PrintWriter pw = new PrintWriter(fw);
pw.println("=====================");
pw.println("= " + Messages.getMessage("fault00"));
pw.println("=====================");
pw.close();
} catch (Exception e) {
log.error(e);
}
}
示例11: getSOAPEnvelopeAsDocument
import org.apache.axis.utils.Messages; //导入依赖的package包/类
private Document getSOAPEnvelopeAsDocument(SOAPEnvelope env, MessageContext msgContext)
throws Exception {
StringWriter writer = new StringWriter();
SerializationContext serializeContext = new SerializationContext(writer, msgContext);
env.output(serializeContext);
writer.close();
Reader reader = new StringReader(writer.getBuffer().toString());
Document doc = XMLUtils.newDocument(new InputSource(reader));
if (doc == null)
throw new Exception(
Messages.getMessage("noDoc00", writer.getBuffer().toString()));
return doc;
}
示例12: invoke
import org.apache.axis.utils.Messages; //导入依赖的package包/类
/**
* invoke creates a socket connection, sends the request SOAP message and then
* reads the response SOAP message back from the SOAP server
*
* @param msgContext the messsage context
*
* @throws AxisFault
*/
public void invoke(MessageContext msgContext) throws AxisFault {
if (log.isDebugEnabled()) {
log.debug(Messages.getMessage("enter00", "HTTPSender::invoke"));
}
SocketHolder socketHolder = new SocketHolder(null);
try {
BooleanHolder useFullURL = new BooleanHolder(false);
StringBuffer otherHeaders = new StringBuffer();
targetURL = new URL(msgContext.getStrProp(MessageContext.TRANS_URL));
String host = targetURL.getHost();
int port = targetURL.getPort();
// Send the SOAP request to the server
InputStream inp = writeToSocket(socketHolder, msgContext, targetURL,
otherHeaders, host, port, msgContext.getTimeout(), useFullURL);
// Read the response back from the server
Hashtable headers = new Hashtable();
inp = readHeadersFromSocket(socketHolder, msgContext, inp, headers);
readFromSocket(socketHolder, msgContext, inp, headers);
} catch (Exception e) {
log.debug(e);
try {
if (socketHolder.getSocket() != null ) {
socketHolder.getSocket().close();
}
} catch (IOException ie) {
// we shouldn't get here.
}
throw AxisFault.makeFault(e);
}
if (log.isDebugEnabled()) {
log.debug(Messages.getMessage("exit00",
"HTTPDispatchHandler::invoke"));
}
}
示例13: writeToStringMethod
import org.apache.axis.utils.Messages; //导入依赖的package包/类
/**
* Writes the toString method
* Currently the toString method is only written for
* simpleTypes.
*/
protected void writeToStringMethod() {
// If this is a simple type, emit a toString
if (simpleValueTypes.size() == 0) {
return;
}
pw.println(" // " + Messages.getMessage("needToString"));
pw.println(" public java.lang.String toString() {");
if (isUnion() || simpleValueTypes.get(0).equals("java.lang.String")) {
pw.println(" return _value;");
} else {
String wrapper =
JavaUtils.getWrapper((String) simpleValueTypes.get(0));
if (wrapper != null) {
pw.println(" return new " + wrapper
+ "(_value).toString();");
} else {
String simpleValueType0 = (String)simpleValueTypes.get(0);
if (simpleValueType0.equals("byte[]")) {
String encoder = getBinaryTypeEncoderName ("_value");
pw.println(
" return _value == null ? null : " +
encoder + ".encode(_value);");
} else if (simpleValueType0.equals("java.util.Calendar")) {
pw.println(
" return _value == null ? null : new org.apache.axis.encoding.ser.CalendarSerializer().getValueAsString(_value, null);");
} else {
pw.println(
" return _value == null ? null : _value.toString();");
}
}
}
pw.println(" }");
pw.println();
}
示例14: isHostInNonProxyList
import org.apache.axis.utils.Messages; //导入依赖的package包/类
/**
* Check if the specified host is in the list of non proxy hosts.
*
* @param host
* host name
* @param nonProxyHosts
* string containing the list of non proxy hosts
*
* @return true/false
*/
protected boolean isHostInNonProxyList(String host, String nonProxyHosts) {
if ((nonProxyHosts == null) || (host == null)) {
return false;
}
/*
* The http.nonProxyHosts system property is a list enclosed in double
* quotes with items separated by a vertical bar.
*/
StringTokenizer tokenizer = new StringTokenizer(nonProxyHosts, "|\"");
while (tokenizer.hasMoreTokens()) {
String pattern = tokenizer.nextToken();
if (log.isDebugEnabled()) {
log.debug(Messages.getMessage("match00",
new String[]{"HTTPSender",
host,
pattern}));
}
if (match(pattern, host, false)) {
return true;
}
}
return false;
}
示例15: startElement
import org.apache.axis.utils.Messages; //导入依赖的package包/类
/**
* startElement
*
* The ONLY reason that this method is overridden is so that
* the object value can be set or a reasonable exception is thrown
* indicating that the object cannot be created. This is done
* at this point so that it occurs BEFORE href/id processing.
* @param namespace is the namespace of the element
* @param localName is the name of the element
* @param prefix is the prefix of the element
* @param attributes are the attributes on the element...used to get the
* type
* @param context is the DeserializationContext
*/
public void startElement(String namespace, String localName,
String prefix, Attributes attributes,
DeserializationContext context)
throws SAXException
{
// Create the bean object if it was not already
// created in the constructor.
if (value == null) {
try {
value=javaType.newInstance();
} catch (Exception e) {
// Use first found constructor.
// Note : the right way is to use XML mapping information
// for example JSR 109's constructor-parameter-order
Constructor[] constructors = javaType.getConstructors();
if (constructors.length > 0) {
constructorToUse = constructors[0];
}
// Failed to create an object if no constructor
if (constructorToUse == null) {
throw new SAXException(Messages.getMessage("cantCreateBean00",
javaType.getName(),
e.toString()));
}
}
}
// Invoke super.startElement to do the href/id processing.
super.startElement(namespace, localName,
prefix, attributes, context);
}