Java AxisFault.addFaultDetail方法代码示例(javaaxisfault.addfaultdetail方法的典型用法代码示例)

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


Java AxisFault.addFaultDetail方法代码示例(javaaxisfault.addfaultdetail方法的典型用法代码示例)

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

示例1: makeAxisFault

import org.apache.axis.AxisFault; //导入方法依赖的package包/类
/**
 * Creates an axis fault grouping the given exceptions list
 * 
 * @param qName
 *            QName of the fault
 * @param exceptions
 *            list of exceptions
 * @return axis fault
 */
public static Exception makeAxisFault( String qName,
		Collection<Exception> exceptions )
{
	if ( exceptions.size( ) == 1 )
	{
		return makeAxisFault( qName, exceptions.iterator( ).next( ) );
	}
	else
	{
		QName exceptionQName = new QName( "string" );
		AxisFault fault = new AxisFault( BirtResources.getMessage( ResourceConstants.GENERAL_EXCEPTION_MULTIPLE_EXCEPTIONS ) );
		fault.setFaultCode( new QName( qName ) );

		for ( Iterator i = exceptions.iterator( ); i.hasNext( ); )
		{
			Exception e = (Exception) i.next( );
			fault.addFaultDetail( exceptionQName, getStackTrace( e ) );
		}
		return fault;
	}
} 
开发者ID:eclipse,项目名称:birt,代码行数:31,代码来源:BirtUtility.java

示例2: createResponseMessage

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

示例3: buildAxisFault

import org.apache.axis.AxisFault; //导入方法依赖的package包/类
public static void buildAxisFault(RuntimeException e, Document document) throws RemoteException
{
  if (e instanceof MessageExceptionDTO   ||
      e instanceof SmartExceptionDTO     ||
      e instanceof RunwayExceptionDTO ||
      e instanceof ProblemExceptionDTO)
  {
    AxisFault axisFault = new AxisFault(e.getMessage());

    Document exceptionDocument;

    if (document == null)
    {
      exceptionDocument = ConversionFacade.initializeDocument();
    }
    else
    {
      exceptionDocument = document;
    }

    Element element = null;

    if (e instanceof MessageExceptionDTO)
    {
      MessageExceptionDTO messageExceptionDTO = (MessageExceptionDTO)e;
      MessageExceptionDTOtoDoc converter = new MessageExceptionDTOtoDoc(messageExceptionDTO, exceptionDocument);
      element = converter.populate();
    }
    else if (e instanceof SmartExceptionDTO)
    {
      SmartExceptionDTOtoDoc smartExceptionDTOtoDoc = new SmartExceptionDTOtoDoc((SmartExceptionDTO) e, exceptionDocument, false);

      element = (Element)smartExceptionDTOtoDoc.populate();
    }
    else if (e instanceof RunwayExceptionDTO)
    {
      RunwayExceptionDTOtoDoc runwayExceptionDTOtoDoc = new RunwayExceptionDTOtoDoc((RunwayExceptionDTO)e, exceptionDocument);
      element = runwayExceptionDTOtoDoc.populate();
    }
    else if (e instanceof ProblemExceptionDTO)
    {
      ProblemExceptionDTO problemExceptionDTO = (ProblemExceptionDTO)e;

      ProblemExceptionDTOtoDoc problemExceptionDTOtoDoc = new ProblemExceptionDTOtoDoc(problemExceptionDTO, exceptionDocument);
      element = problemExceptionDTOtoDoc.populate();
    }
    axisFault.addFaultDetail(element);

    throw axisFault;
  }
  else
  {
    throw e;
  }
} 
开发者ID:terraframe,项目名称:Runway-SDK,代码行数:56,代码来源:WebServiceAdapter.java

本文标签属性:

示例:示例英语

代码:代码大全可复制

java:java游戏

AxisFault:AxisFault

addFaultDetail:addFaultDetail

上一篇:弹孔两字怎么写拼音(电视剧弹孔剧情简介)(《弹孔》四行仓库弹孔是真的吗)
下一篇:飞机坠毁后人都变成残骸了么 飞机坠毁的原因有哪些(坠机事故现场发现遗物101件,通过这些遗物能否确认身份?)

为您推荐