本文整理汇总了Java中org.apache.axis.Constants类的典型用法代码示例。如果您正苦于以下问题:Java Constants类的具体用法?Java Constants怎么用?Java Constants使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Constants类属于org.apache.axis包,在下文中一共展示了Constants类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getParamData
import org.apache.axis.Constants; //导入依赖的package包/类
/**
* Method getParamData
*
* @param c
* @param arg
*/
private Object getParamData(org.apache.axis.client.Call c, Parameter p, String arg) throws Exception {
// Get the QName representing the parameter type
QName paramType = org.apache.axis.wsdl.toJava.Utils.getXSIType(p);
TypeEntry type = p.getType();
if (type instanceof BaseType && ((BaseType) type).isBaseType()) {
DeserializerFactory factory = c.getTypeMapping().getDeserializer(paramType);
Deserializer deserializer = factory.getDeserializerAs(Constants.AXIS_SAX);
if (deserializer instanceof SimpleDeserializer) {
return ((SimpleDeserializer)deserializer).makeValue(arg);
}
}
throw new RuntimeException("not know how to convert '" + arg
+ "' into " + c);
}
示例2: getElementDecl
import org.apache.axis.Constants; //导入依赖的package包/类
/**
* Returns the TypeEntry of the given element
*/
protected TypeEntry getElementDecl(String elementName)
{
if (elements != null) {
for (int i = 0; i < elements.size(); i++) {
ElementDecl elem = (ElementDecl) elements.get(i);
String variableName;
if (elem.getAnyElement()) {
variableName = Constants.ANYCONTENT;
} else {
variableName = elem.getName();
}
if (variableName.equals(elementName))
return elem.getType();
}
}
return null;
}
示例3: _get
import org.apache.axis.Constants; //导入依赖的package包/类
private CacheEntry _get(String cacheName,String method,String key) throws ServiceException, MalformedURLException, RemoteException {
Service service = new Service();
Call call = (Call) service.createCall();
call.registerTypeMapping(
Element.class,
element,
BeanSerializerFactory.class,
BeanDeserializerFactory.class);
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("http://soap.server.ehcache.sf.net/", method));
call.addParameter("arg0", Constants.XSD_STRING, String.class, ParameterMode.IN);
call.addParameter("arg1", Constants.XSD_STRING, String.class, ParameterMode.IN);
call.setReturnClass(Element.class);
call.setReturnQName(element);
return new SoapCacheEntry((Element) call.invoke( new Object[] {cacheName,key } ));
}
示例4: _remove
import org.apache.axis.Constants; //导入依赖的package包/类
private boolean _remove(String cacheName,String method,String key) throws ServiceException, MalformedURLException, RemoteException {
Service service = new Service();
Call call = (Call) service.createCall();
call.registerTypeMapping(
Element.class,
element,
BeanSerializerFactory.class,
BeanDeserializerFactory.class);
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("http://soap.server.ehcache.sf.net/", method));
call.addParameter("arg0", Constants.XSD_STRING, String.class, ParameterMode.IN);
call.addParameter("arg1", Constants.XSD_STRING, String.class, ParameterMode.IN);
call.setReturnClass(boolean.class);
call.setReturnQName(Constants.XSD_BOOLEAN);
return ((Boolean)call.invoke( new Object[] {cacheName,key } )).booleanValue();
}
示例5: _put
import org.apache.axis.Constants; //导入依赖的package包/类
private void _put(String cacheName,String method,Element el) throws ServiceException, MalformedURLException, RemoteException {
Service service = new Service();
Call call = (Call) service.createCall();
el.setResourceUri(endpoint);
call.registerTypeMapping(
Element.class,
element,
BeanSerializerFactory.class,
BeanDeserializerFactory.class);
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("http://soap.server.ehcache.sf.net/", method));
call.addParameter("arg0", Constants.XSD_STRING, String.class, ParameterMode.IN);
call.addParameter("arg1", element, Element.class, ParameterMode.IN);
call.setReturnType(Constants.XSD_ANYSIMPLETYPE);
call.invoke( new Object[] {cacheName,el } );
//call.invokeOneWay(new Object[] {cacheName,el } );
}
示例6: toAxisTypeSoap
import org.apache.axis.Constants; //导入依赖的package包/类
private static Object toAxisTypeSoap(TypeMapping tm,String local, Object value, Set<Object> done) throws PageException {
if(local.equals(Constants.SOAP_ARRAY.getLocalPart())) return toArrayList(tm,value,done);
if(local.equals(Constants.SOAP_ARRAY12.getLocalPart())) return toArrayList(tm,value,done);
if(local.equals(Constants.SOAP_ARRAY_ATTRS11.getLocalPart())) return toArrayList(tm,value,done);
if(local.equals(Constants.SOAP_ARRAY_ATTRS12.getLocalPart())) return toArrayList(tm,value,done);
if(local.equals(Constants.SOAP_BASE64.getLocalPart())) return Caster.toBinary(value);
if(local.equals(Constants.SOAP_BASE64BINARY.getLocalPart())) return Caster.toBinary(value);
if(local.equals(Constants.SOAP_BOOLEAN.getLocalPart())) return Caster.toBoolean(value);
if(local.equals(Constants.SOAP_BYTE.getLocalPart())) return Caster.toByte(value);
if(local.equals(Constants.SOAP_DECIMAL.getLocalPart())) return new BigDecimal(Caster.toDoubleValue(value));
if(local.equals(Constants.SOAP_DOUBLE.getLocalPart())) return Caster.toDouble(value);
if(local.equals(Constants.SOAP_FLOAT.getLocalPart())) return new Float(Caster.toDoubleValue(value));
if(local.equals(Constants.SOAP_INT.getLocalPart())) return Caster.toInteger(value);
if(local.equals(Constants.SOAP_INTEGER.getLocalPart())) return Caster.toInteger(value);
if(local.equals(Constants.SOAP_LONG.getLocalPart())) return Caster.toLong(value);
if(local.equals(Constants.SOAP_MAP.getLocalPart())) return toMap(tm,value,done);
if(local.equals(Constants.SOAP_SHORT.getLocalPart())) return Caster.toShort(value);
if(local.equals(Constants.SOAP_STRING.getLocalPart())) return Caster.toString(value);
if(local.equals(Constants.SOAP_VECTOR.getLocalPart())) return toVector(tm,value,done);
return _toDefinedType(tm,null,null,null,value,done);
}
示例7: processAxisFault
import org.apache.axis.Constants; //导入依赖的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);
//}
}
示例8: doGet
import org.apache.axis.Constants; //导入依赖的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);
}
}
示例9: processAxisFault
import org.apache.axis.Constants; //导入依赖的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);
//}
}
示例10: addStackTraceFault
import org.apache.axis.Constants; //导入依赖的package包/类
private void addStackTraceFault() {
// check if stack trace fault is already added
Element stackElement = this.fault.lookupFaultDetail(
Constants.QNAME_FAULTDETAIL_STACKTRACE);
if (stackElement == null) {
return;
}
// remove SOAP details stack entry
this.fault.removeFaultDetail(Constants.QNAME_FAULTDETAIL_STACKTRACE);
String message = this.fault.getClass().getName();
String stackTrace = stackElement.getFirstChild().getNodeValue();
// add stack trace fault
addFaultCause(createStackFault(message, stackTrace));
}
示例11: DataDeser
import org.apache.axis.Constants; //导入依赖的package包/类
public DataDeser()
{
typesByMemberName.put(STRINGMEMBER, Constants.XSD_STRING);
typesByMemberName.put(FLOATMEMBER, Constants.XSD_FLOAT);
typesByMemberName.put(DATAMEMBER, myTypeQName);
value = new Data();
}
示例12: getRequestNameSpace
import org.apache.axis.Constants; //导入依赖的package包/类
public static String getRequestNameSpace() {
String rawURL = ReqRspUtil.getRequestURL(ThreadLocalPageContext.get().getHttpServletRequest(),false);
String urlPath ="";
try {
urlPath = new java.net.URL(rawURL).getPath();
}
catch (MalformedURLException e) {}
String pathWithoutContext = urlPath.replaceFirst("/[^/]*", "");
return lucee.runtime.config.Constants.WEBSERVICE_NAMESPACE_URI + pathWithoutContext.toLowerCase();
}
示例13: initialize
import org.apache.axis.Constants; //导入依赖的package包/类
void initialize(Object serviceImpl, ClassLoader classLoader) throws ClassNotFoundException {
this.serviceImpl = serviceImpl;
Class serviceEndpointBaseClass = classLoader.loadClass(serviceEndpointClassName);
serviceEndpointClass = enhanceServiceEndpointInterface(serviceEndpointBaseClass, classLoader);
Class[] constructorTypes = new Class[]{classLoader.loadClass(GenericServiceEndpoint.class.getName())};
this.constructor = FastClass.create(serviceEndpointClass).getConstructor(constructorTypes);
this.handlerInfoChainFactory = new HandlerInfoChainFactory(handlerInfos);
sortedOperationInfos = new OperationInfo[FastClass.create(serviceEndpointClass).getMaxIndex() + 1];
String encodingStyle = "";
for (int i = 0; i < operationInfos.length; i++) {
OperationInfo operationInfo = operationInfos[i];
Signature signature = operationInfo.getSignature();
MethodProxy methodProxy = MethodProxy.find(serviceEndpointClass, signature);
if (methodProxy == null) {
throw new ServerRuntimeException("No method proxy for operationInfo " + signature);
}
int index = methodProxy.getSuperIndex();
sortedOperationInfos[index] = operationInfo;
if (operationInfo.getOperationDesc().getUse() == Use.ENCODED) {
encodingStyle = org.apache.axis.Constants.URI_SOAP11_ENC;
}
}
//register our type descriptors
Service service = ((ServiceImpl) serviceImpl).getService();
AxisEngine axisEngine = service.getEngine();
TypeMappingRegistry typeMappingRegistry = axisEngine.getTypeMappingRegistry();
TypeMapping typeMapping = typeMappingRegistry.getOrMakeTypeMapping(encodingStyle);
typeMapping.register(BigInteger.class, Constants.XSD_UNSIGNEDLONG, new SimpleSerializerFactory(BigInteger.class, Constants.XSD_UNSIGNEDLONG), new SimpleDeserializerFactory(BigInteger.class, Constants.XSD_UNSIGNEDLONG));
typeMapping.register(URI.class, Constants.XSD_ANYURI, new SimpleSerializerFactory(URI.class, Constants.XSD_ANYURI), new SimpleDeserializerFactory(URI.class, Constants.XSD_ANYURI));
//It is essential that the types be registered before the typeInfos create the serializer/deserializers.
for (Iterator iter = typeInfo.iterator(); iter.hasNext(); ) {
TypeInfo info = (TypeInfo) iter.next();
TypeDesc.registerTypeDescForClass(info.getClazz(), info.buildTypeDesc());
}
TypeInfo.register(typeInfo, typeMapping);
}
示例14: createResponseMessage
import org.apache.axis.Constants; //导入依赖的package包/类
/**
* Returns a new Axis Message based on the contents of the HTTP response.
*
* @param httpResponse the HTTP response
* @return an Axis Message for the HTTP response
* @throws IOException if unable to retrieve the HTTP response's contents
* @throws AxisFault if the HTTP response's status or contents indicate an unexpected error, such
* as a 405.
*/
private Message createResponseMessage(HttpResponse httpResponse) throws IOException, AxisFault {
int statusCode = httpResponse.getStatusCode();
String contentType = httpResponse.getContentType();
// The conditions below duplicate the logic in CommonsHTTPSender and HTTPSender.
boolean shouldParseResponse =
(statusCode > 199 && statusCode < 300)
|| (contentType != null
&& !contentType.equals("text/html")
&& statusCode > 499
&& statusCode < 600);
// Wrap the content input stream in a notifying stream so the stream event listener will be
// notified when it is closed.
InputStream responseInputStream =
new NotifyingInputStream(httpResponse.getContent(), inputStreamEventListener);
if (!shouldParseResponse) {
// The contents are not an XML response, so throw an AxisFault with
// the HTTP status code and message details.
String statusMessage = httpResponse.getStatusMessage();
AxisFault axisFault =
new AxisFault("HTTP", "(" + statusCode + ")" + statusMessage, null, null);
axisFault.addFaultDetail(
Constants.QNAME_FAULTDETAIL_HTTPERRORCODE, String.valueOf(statusCode));
try (InputStream stream = responseInputStream) {
byte[] contentBytes = ByteStreams.toByteArray(stream);
axisFault.setFaultDetailString(
Messages.getMessage(
"return01", String.valueOf(statusCode), new String(contentBytes, UTF_8)));
}
throw axisFault;
}
// Response is an XML response. Do not consume and close the stream in this case, since that
// will happen later when the response is deserialized by Axis (as confirmed by unit tests for
// this class).
Message responseMessage =
new Message(
responseInputStream, false, contentType, httpResponse.getHeaders().getLocation());
responseMessage.setMessageType(Message.RESPONSE);
return responseMessage;
}
示例15: getMechanismType
import org.apache.axis.Constants; //导入依赖的package包/类
@Override
public String getMechanismType() {
return Constants.AXIS_SAX;
}