本文整理汇总了Java中org.example.ticketagent.ObjectFactory.createListFlightsResponse方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectFactory.createListFlightsResponse方法的具体用法?Java ObjectFactory.createListFlightsResponse怎么用?Java ObjectFactory.createListFlightsResponse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.example.ticketagent.ObjectFactory
的用法示例。
在下文中一共展示了ObjectFactory.createListFlightsResponse方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: 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);
}
示例3: 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);
}
示例4: 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);
}
示例5: 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);
}