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


Java ObjectFactory.createTFlightsResponse方法代码示例

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


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

示例1: listFlights

import org.example.ticketagent.ObjectFactory; //导入方法依赖的package包/类
@Override
public TFlightsResponse listFlights(TListFlights request)
    throws ListFlightsFault {
  ObjectFactory factory = new ObjectFactory();

  if ("XYZ".equals(request.getStartCity())) {
    TFlightsFault tFlightsFault = factory.createTFlightsFault();
    tFlightsFault.setErrorMessage("no city named XYZ");

    throw new ListFlightsFault("unknown city", tFlightsFault);
  }

  TFlightsResponse response = factory.createTFlightsResponse();
  response.getFlightNumber().add(BigInteger.valueOf(101));

  return response;
}
 
开发者ID:code-not-found,项目名称:cxf-jaxws,代码行数:18,代码来源:TicketAgentImpl.java

示例2: listFlights

import org.example.ticketagent.ObjectFactory; //导入方法依赖的package包/类
@Override
public TFlightsResponse listFlights(TListFlights body,
    TListFlightsHeader header) {
  ObjectFactory factory = new ObjectFactory();
  TFlightsResponse response = factory.createTFlightsResponse();
  response.getFlightNumber().add(BigInteger.valueOf(101));

  // add an extra flightNumber in the case of a clientId == abc123
  if ("abc123".equals(header.getClientId())) {
    response.getFlightNumber().add(BigInteger.valueOf(202));
  }

  return response;
}
 
开发者ID:code-not-found,项目名称:cxf-jaxws,代码行数:15,代码来源:TicketAgentImpl.java

示例3: listFlights

import org.example.ticketagent.ObjectFactory; //导入方法依赖的package包/类
@Override
public TFlightsResponse listFlights(TListFlights body) {
  ObjectFactory factory = new ObjectFactory();
  TFlightsResponse response = factory.createTFlightsResponse();
  response.getFlightNumber().add(BigInteger.valueOf(101));

  return response;
}
 
开发者ID:code-not-found,项目名称:cxf-jaxws,代码行数:9,代码来源:TicketAgentImpl.java

示例4: listFlights

import org.example.ticketagent.ObjectFactory; //导入方法依赖的package包/类
@Override
public TFlightsResponse listFlights(TListFlightsHeader header,
    TListFlights body) {
  ObjectFactory factory = new ObjectFactory();
  TFlightsResponse response = factory.createTFlightsResponse();
  response.getFlightNumber().add(BigInteger.valueOf(101));

  // add an extra flightNumber in the case of a clientId == abc123
  if ("abc123".equals(header.getClientId())) {
    response.getFlightNumber().add(BigInteger.valueOf(202));
  }

  return response;
}
 
开发者ID:code-not-found,项目名称:cxf-jaxws,代码行数:15,代码来源:TicketAgentImpl.java

示例5: listFlights

import org.example.ticketagent.ObjectFactory; //导入方法依赖的package包/类
@Override
public TFlightsResponse listFlights(TListFlights request) {
  ObjectFactory factory = new ObjectFactory();
  TFlightsResponse response = factory.createTFlightsResponse();
  response.getFlightNumber().add(BigInteger.valueOf(101));

  return response;
}
 
开发者ID:code-not-found,项目名称:cxf-jaxws,代码行数:9,代码来源:TicketAgentImpl.java

示例6: listFlights

import org.example.ticketagent.ObjectFactory; //导入方法依赖的package包/类
@PayloadRoot(namespace = "http://example.org/TicketAgent.xsd", localPart = "listFlightsRequest")
@ResponsePayload
public JAXBElement<TFlightsResponse> listFlights(
    @RequestPayload JAXBElement<TListFlights> request) throws InterruptedException {

  // sleep for 10 seconds so a timeout occurs
  Thread.sleep(10 * 1000);

  ObjectFactory factory = new ObjectFactory();
  TFlightsResponse tFlightsResponse = factory.createTFlightsResponse();
  tFlightsResponse.getFlightNumber().add(BigInteger.valueOf(101));

  return factory.createListFlightsResponse(tFlightsResponse);
}
 
开发者ID:code-not-found,项目名称:spring-ws,代码行数:15,代码来源:TicketAgentEndpoint.java

示例7: listFlights

import org.example.ticketagent.ObjectFactory; //导入方法依赖的package包/类
@PayloadRoot(namespace = "http://example.org/TicketAgent.xsd", localPart = "listFlightsRequest")
@ResponsePayload
public JAXBElement<TFlightsResponse> listFlights(
    @RequestPayload JAXBElement<TListFlights> request) {
  ObjectFactory factory = new ObjectFactory();
  TFlightsResponse tFlightsResponse = factory.createTFlightsResponse();
  tFlightsResponse.getFlightNumber().add(BigInteger.valueOf(101));

  return factory.createListFlightsResponse(tFlightsResponse);
}
 
开发者ID:code-not-found,项目名称:spring-ws,代码行数:11,代码来源:TicketAgentEndpoint.java

示例8: listFlights

import org.example.ticketagent.ObjectFactory; //导入方法依赖的package包/类
@PayloadRoot(namespace = "http://example.org/TicketAgent.xsd", localPart = "listFlightsRequest")
@ResponsePayload
public JAXBElement<TFlightsResponse> listFlights(
    @RequestPayload JAXBElement<TListFlights> request) {

  ObjectFactory factory = new ObjectFactory();
  TFlightsResponse tFlightsResponse = factory.createTFlightsResponse();
  tFlightsResponse.getFlightNumber().add(BigInteger.valueOf(101));

  return factory.createListFlightsResponse(tFlightsResponse);
}
 
开发者ID:code-not-found,项目名称:spring-ws,代码行数:12,代码来源:TicketAgentEndpoint.java

示例9: listFlights

import org.example.ticketagent.ObjectFactory; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@PayloadRoot(namespace = "http://example.org/TicketAgent.xsd", localPart = "listFlightsRequest")
@ResponsePayload
public JAXBElement<TFlightsResponse> listFlights(
    @RequestPayload JAXBElement<TListFlights> request, @SoapHeader(
        value = "{http://example.org/TicketAgent.xsd}listFlightsSoapHeaders") SoapHeaderElement soapHeaderElement) {
  String clientId = "unknown";

  try {
    // create an unmarshaller
    JAXBContext context = JAXBContext.newInstance(ObjectFactory.class);
    Unmarshaller unmarshaller = context.createUnmarshaller();

    // unmarshal the header from the specified source
    JAXBElement<ListFlightsSoapHeaders> headers =
        (JAXBElement<ListFlightsSoapHeaders>) unmarshaller
            .unmarshal(soapHeaderElement.getSource());

    // get the header values
    ListFlightsSoapHeaders requestSoapHeaders = headers.getValue();
    clientId = requestSoapHeaders.getClientId();
  } catch (Exception e) {
    LOGGER.error("error during unmarshalling of the SOAP headers", e);
  }

  ObjectFactory factory = new ObjectFactory();
  TFlightsResponse tFlightsResponse = factory.createTFlightsResponse();
  tFlightsResponse.getFlightNumber().add(BigInteger.valueOf(101));

  // add an extra flightNumber in the case of a clientId == abc123
  if ("abc123".equals(clientId)) {
    LOGGER.info("clientId == abc123");
    tFlightsResponse.getFlightNumber().add(BigInteger.valueOf(202));
  }

  return factory.createListFlightsResponse(tFlightsResponse);
}
 
开发者ID:code-not-found,项目名称:spring-ws,代码行数:38,代码来源:TicketAgentEndpoint.java

示例10: listFlights

import org.example.ticketagent.ObjectFactory; //导入方法依赖的package包/类
@SoapAction(value = "http://example.com/TicketAgent/listFlights")
@ResponsePayload
public JAXBElement<TFlightsResponse> listFlights(
    @RequestPayload JAXBElement<TListFlights> request, MessageContext messageContext) {
  // access the SOAPAction value
  WebServiceMessage webServiceMessage = messageContext.getRequest();
  SoapMessage soapMessage = (SoapMessage) webServiceMessage;
  LOGGER.info("SOAPAction header: {}", soapMessage.getSoapAction());

  ObjectFactory factory = new ObjectFactory();
  TFlightsResponse tFlightsResponse = factory.createTFlightsResponse();
  tFlightsResponse.getFlightNumber().add(BigInteger.valueOf(101));

  return factory.createListFlightsResponse(tFlightsResponse);
}
 
开发者ID:code-not-found,项目名称:spring-ws,代码行数:16,代码来源:TicketAgentEndpoint.java


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