当前位置: 首页>>代码示例>>Java>>正文


Java AxisFault.makeFault方法代码示例

本文整理汇总了Java中org.apache.axis.AxisFault.makeFault方法的典型用法代码示例。如果您正苦于以下问题:Java AxisFault.makeFault方法的具体用法?Java AxisFault.makeFault怎么用?Java AxisFault.makeFault使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.axis.AxisFault的用法示例。


在下文中一共展示了AxisFault.makeFault方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getEngine

import org.apache.axis.AxisFault; //导入方法依赖的package包/类
/**
 * get the engine for this Server from cache or context
 * @return
 * @throws AxisFault 
 */
public AxisServer getEngine() throws AxisFault {
	if (axisServer == null) {
		synchronized (context) {
			Map environment = new HashMap();
			environment.put(AxisEngine.ENV_SERVLET_CONTEXT, context);
			axisServer = AxisServer.getServer(environment);
			axisServer.setName("LuceeServer");
		}
		
		// add Component Handler
		try {
			SimpleChain sc=(SimpleChain) axisServer.getGlobalRequest();
			sc.addHandler(new ComponentHandler());	
		}
		catch (ConfigurationException e) {
			throw AxisFault.makeFault(e);
		}
		TypeMappingUtil.registerDefaults(axisServer.getTypeMappingRegistry());
		
	}
	return axisServer;
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:28,代码来源:RPCServer.java

示例2: getEngine

import org.apache.axis.AxisFault; //导入方法依赖的package包/类
/**
  * get the engine for this Server from cache or context
  * @return
  * @throws AxisFault 
  */
 public AxisServer getEngine() throws AxisFault {
     if (axisServer == null) {
         synchronized (context) {
         	Map environment = new HashMap();
             environment.put(AxisEngine.ENV_SERVLET_CONTEXT, context);
             axisServer = AxisServer.getServer(environment);
             axisServer.setName("LuceeServer");
         }
         
         // add Component Handler
         try {
	SimpleChain sc=(SimpleChain) axisServer.getGlobalRequest();
	sc.addHandler(new ComponentHandler());	
}
         catch (ConfigurationException e) {
	throw AxisFault.makeFault(e);
}
         TypeMappingUtil.registerDefaults(axisServer.getTypeMappingRegistry());
         
     }
     return axisServer;
 }
 
开发者ID:lucee,项目名称:Lucee,代码行数:28,代码来源:RPCServer.java

示例3: logMessages

import org.apache.axis.AxisFault; //导入方法依赖的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);
	}
}
 
开发者ID:mhus,项目名称:mhus-osgi-tools,代码行数:27,代码来源:AxisLog2LogHandler.java

示例4: invoke

import org.apache.axis.AxisFault; //导入方法依赖的package包/类
@Override
public void invoke(MessageContext msgContext) throws AxisFault {
  if (msgContext == null) {
    throw AxisFault.makeFault(new NullPointerException("Null message context"));
  }

  // Catch any exception thrown and wrap it in an AxisFault, per the contract of Handler.invoke.
  try {
    HttpResponse response = null;
    // Create the request.
    HttpRequest postRequest = createHttpRequest(msgContext);
    // Execute the request.
    response = postRequest.execute();
    // Translate the HTTP response to an Axis message on the message context.
    msgContext.setResponseMessage(createResponseMessage(response));
  } catch (Exception e) {
    throw AxisFault.makeFault(e);
  }
}
 
开发者ID:googleads,项目名称:googleads-java-lib,代码行数:20,代码来源:HttpHandler.java

示例5: invoke

import org.apache.axis.AxisFault; //导入方法依赖的package包/类
public void invoke(MessageContext msgContext) throws AxisFault {
    try {
        System.out.println("Starting Server verification");

        Message inMsg = msgContext.getRequestMessage();
        Message outMsg = msgContext.getResponseMessage();

        // verify signed message

        Document doc = inMsg.getSOAPEnvelope().getAsDocument();
        String BaseURI = "http://xml-security";
        CachedXPathAPI xpathAPI = new CachedXPathAPI();

        Element nsctx = doc.createElement("nsctx");
        nsctx.setAttribute("xmlns:ds", Constants.SignatureSpecNS);

        Element signatureElem = (Element) xpathAPI.selectSingleNode(doc,
                "//ds:Signature", nsctx);

        // check to make sure that the document claims to have been signed
        if (signatureElem == null) {
            System.out.println("The document is not signed");
            return;
        }

        XMLSignature sig = new XMLSignature(signatureElem, BaseURI);

        boolean verify = sig.checkSignatureValue(sig.getKeyInfo().getPublicKey());
        System.out.println("Server verification complete.");

        System.out.println("The signature is" + (verify
                ? " "
                : " not ") + "valid");
    } catch (Exception e) {
        throw AxisFault.makeFault(e);
    }

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:39,代码来源:LogHandler.java

示例6: invoke

import org.apache.axis.AxisFault; //导入方法依赖的package包/类
public void invoke(MessageContext msgContext) throws AxisFault
{
    /** Log an access each time we get invoked.
     */
    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);
        FileOutputStream fos = new FileOutputStream(filename, true);
        
        PrintWriter writer = new PrintWriter(fos);
        
        Integer numAccesses =
                         (Integer)serviceHandler.getOption("accesses");
        if (numAccesses == null)
            numAccesses = new Integer(0);
        
        numAccesses = new Integer(numAccesses.intValue() + 1);
        
        Date date = new Date();
        String result = date + ": service " +
                        msgContext.getTargetService() +
                        " accessed " + numAccesses + " time(s).";
        serviceHandler.setOption("accesses", numAccesses);
        
        writer.println(result);
        
        writer.close();
    } catch (Exception e) {
        throw AxisFault.makeFault(e);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:36,代码来源:LogHandler.java

示例7: setURL

import org.apache.axis.AxisFault; //导入方法依赖的package包/类
/**
 * Set up the call object.
 */
public void setURL(String url)
    throws AxisFault
{
    try {
        binding = new InteropTestServiceLocator().
            getecho(new java.net.URL(url));

        // safety first
        ((InteropTestSoapBindingStub)binding).setTimeout(60000);
        ((InteropTestSoapBindingStub)binding).setMaintainSession(true);
    } catch (Exception exp) {
        throw AxisFault.makeFault(exp);
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:18,代码来源:TestClient.java

示例8: makeFault

import org.apache.axis.AxisFault; //导入方法依赖的package包/类
/**
 * Create an connection problem AxisFault from an Exception
 *
 * @param msgContext MessageContext object
 * @param e Exception
 * @param remoteURL Remote URL
 * @return AxisFault
 */
private AxisFault makeFault(final MessageContext msgContext,
                            final Exception e,
                            final String remoteURL)
{
    AxisFault af = null;

    if (e instanceof org.apache.http.conn.HttpHostConnectException) {
        af = this.createFault( msgContext,
                               AxisFault.soap12receiver,
                               "Connection refused");
    } else if (e instanceof InterruptedIOException) {
        af = this.createFault( msgContext,
                               AxisFault.soap12receiver,
                               "Communication timed out");
    } else if (e instanceof java.io.IOException) {
        af = this.createFault( msgContext,
                               AxisFault.soap12receiver,
                               "Connection failed");
    }

    if (af == null) {
       // Default maker..
       af = AxisFault.makeFault(e);
    }
    try {
        SOAPFault fault = new SOAPFault(af);
        msgContext.setProperty(RAW_RESPONSE_XML, fault.getAsString());
    } catch (Exception e2) {
        log.warn("Failed to write response XML.", e2);
    }
    return af;
}
 
开发者ID:laverca,项目名称:laverca,代码行数:41,代码来源:ComponentsHTTPSender.java

示例9: invoke

import org.apache.axis.AxisFault; //导入方法依赖的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"));
    }
}
 
开发者ID:swarmbox,项目名称:netsuite-export,代码行数:48,代码来源:HTTPSender.java

示例10: invoke

import org.apache.axis.AxisFault; //导入方法依赖的package包/类
@Override
public void invoke(MessageContext msgContext) throws AxisFault {
    try {
        setupService(msgContext);
    } 
    catch (Exception e) {
        throw AxisFault.makeFault(e);
    }
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:10,代码来源:ComponentHandler.java

示例11: generateWSDL

import org.apache.axis.AxisFault; //导入方法依赖的package包/类
@Override
public void generateWSDL(MessageContext msgContext) throws AxisFault {
    try {
        setupService(msgContext);
    } 
    catch (Exception e) {
        throw AxisFault.makeFault(e);
    }
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:10,代码来源:ComponentHandler.java

示例12: invoke

import org.apache.axis.AxisFault; //导入方法依赖的package包/类
/**
 * invokes thread local component
 * @param name
 * @param args
 * @return
 * @throws AxisFault 
 * @throws PageException
 */
public static Object invoke(String name, Object[] args) throws AxisFault {
	try {
		return _invoke(name, args);
	} 
	catch (Throwable t) {
		ExceptionUtil.rethrowIfNecessary(t);
		throw AxisFault.makeFault((Caster.toPageException(t)));
	}
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:18,代码来源:ComponentController.java

示例13: invoke

import org.apache.axis.AxisFault; //导入方法依赖的package包/类
/**
 * invokes thread local component
 * @param name
 * @param args
 * @return
 * @throws AxisFault 
 * @throws PageException
 */
public static Object invoke(String name, Object[] args) throws AxisFault {
	try {
		return _invoke(name, args);
	} 
	catch(Throwable t) {
		ExceptionUtil.rethrowIfNecessary(t);
		throw AxisFault.makeFault((Caster.toPageException(t)));
	}
}
 
开发者ID:lucee,项目名称:Lucee,代码行数:18,代码来源:ComponentController.java

示例14: makeAxisFault

import org.apache.axis.AxisFault; //导入方法依赖的package包/类
/**
 * Creates an axis fault based on a given exception.
 * 
 * @param qName
 *            QName of the fault
 * @param e
 *            exception
 * @return axis fault
 */
public static AxisFault makeAxisFault( Exception e )
{
	if ( e instanceof AxisFault )
	{
		return (AxisFault) e;
	}
	else
	{
		AxisFault fault = AxisFault.makeFault( e );
		fault.addFaultDetailString( BirtUtility.getStackTrace( e ) );
		return fault;
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:23,代码来源:BirtUtility.java

示例15: proxyService

import org.apache.axis.AxisFault; //导入方法依赖的package包/类
/**
 * Process the given message, treating it as raw XML.
 */
public void proxyService(SOAPEnvelope env1, SOAPEnvelope env2)
    throws AxisFault
{
    try {
        // Get the current Message Context
        MessageContext msgContext = MessageContext.getCurrentContext();
        
        // Look in the message context for our service
        Handler self = msgContext.getService();
        
        // what is our target URL?
        String dest = (String)self.getOption("URL");
        
        // use the server's client engine in case anything has 
        // been deployed to it
        Service service = new Service();
        service.setEngine( msgContext.getAxisEngine().getClientEngine() );
        Call    call = (Call) service.createCall();

        SimpleTargetedChain c = new SimpleTargetedChain(new TCPSender());
        // !!! FIXME
        //service.getEngine().deployTransport("tcp", c);

        // add TCP for proxy testing
        call.addTransportPackage("samples.transport");
        call.setTransportForProtocol("tcp", TCPTransport.class);
        
        // NOW set the client's URL (since now the tcp handler exists)
        call.setTargetEndpointAddress(new java.net.URL(dest));

        call.setRequestMessage(msgContext.getRequestMessage());
        
        call.invoke();
        
        Message msg = call.getResponseMessage();

        msgContext.setResponseMessage(msg);
    }
    catch( Exception exp ) {
        throw AxisFault.makeFault( exp );
    }
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:46,代码来源:ProxyService.java


注:本文中的org.apache.axis.AxisFault.makeFault方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。