本文整理汇总了Java中org.apache.axis.utils.Messages.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java Messages.getMessage方法的具体用法?Java Messages.getMessage怎么用?Java Messages.getMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.axis.utils.Messages
的用法示例。
在下文中一共展示了Messages.getMessage方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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);
}
}
示例3: 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;
}
示例4: 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);
}
示例5: 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
*/
@Override
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);
}
示例6: getSoapAction
import org.apache.axis.utils.Messages; //导入方法依赖的package包/类
/**
* Extract the SOAPAction header.
* if SOAPAction is null then we'll we be forced to scan the body for it.
* if SOAPAction is "" then use the URL
* @param req incoming request
* @return the action
* @throws AxisFault
*/
private String getSoapAction(HttpServletRequest req) throws AxisFault {
String soapAction = req.getHeader(HTTPConstants.HEADER_SOAP_ACTION);
if (soapAction == null) {
String contentType = req.getHeader(HTTPConstants.HEADER_CONTENT_TYPE);
if(contentType != null) {
int index = contentType.indexOf("action");
if(index != -1){
soapAction = contentType.substring(index + 7);
}
}
}
if (isDebug) {
log.debug("HEADER_SOAP_ACTION:" + soapAction);
/**
* Technically, if we don't find this header, we should probably fault.
* It's required in the SOAP HTTP binding.
*/
}
if (soapAction == null) {
AxisFault af = new AxisFault("Client.NoSOAPAction",
Messages.getMessage("noHeader00",
"SOAPAction"),
null, null);
exceptionLog.error(Messages.getMessage("genFault00"), af);
throw af;
}
// the SOAP 1.1 spec & WS-I 1.0 says:
// soapaction = "SOAPAction" ":" [ <"> URI-reference <"> ]
// some implementations leave off the quotes
// we strip them if they are present
if (soapAction.startsWith("\"") && soapAction.endsWith("\"")
&& soapAction.length() >= 2) {
int end = soapAction.length() - 1;
soapAction = soapAction.substring(1, end);
}
if (soapAction.length() == 0) {
soapAction = req.getContextPath(); // Is this right?
}
return soapAction;
}
示例7: getSoapAction
import org.apache.axis.utils.Messages; //导入方法依赖的package包/类
/**
* Extract the SOAPAction header.
* if SOAPAction is null then we'll we be forced to scan the body for it.
* if SOAPAction is "" then use the URL
* @param req incoming request
* @return the action
* @throws AxisFault
*/
private String getSoapAction(HttpServletRequest req) throws AxisFault {
String soapAction = req.getHeader(HTTPConstants.HEADER_SOAP_ACTION);
if (soapAction == null) {
String contentType = req.getHeader(HTTPConstants.HEADER_CONTENT_TYPE);
if(contentType != null) {
int index = contentType.indexOf("action");
if(index != -1){
soapAction = contentType.substring(index + 7);
}
}
}
if (isDebug) {
log.debug("HEADER_SOAP_ACTION:" + soapAction);
/**
* Technically, if we don't find this header, we should probably fault.
* It's required in the SOAP HTTP binding.
*/
}
if (soapAction == null) {
AxisFault af = new AxisFault("Client.NoSOAPAction",
Messages.getMessage("noHeader00",
"SOAPAction"),
null, null);
exceptionLog.error(Messages.getMessage("genFault00"), af);
throw af;
}
// the SOAP 1.1 spec & WS-I 1.0 says:
// soapaction = "SOAPAction" ":" [ <"> URI-reference <"> ]
// some implementations leave off the quotes
// we strip them if they are present
if (soapAction.startsWith("\"") && soapAction.endsWith("\"")
&& soapAction.length() >= 2) {
int end = soapAction.length() - 1;
soapAction = soapAction.substring(1, end);
}
if (soapAction.length() == 0) {
soapAction = req.getContextPath(); // Is this right?
}
return soapAction;
}