本文整理汇总了Java中org.example.ticketagent.ObjectFactory类的典型用法代码示例。如果您正苦于以下问题:Java ObjectFactory类的具体用法?Java ObjectFactory怎么用?Java ObjectFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ObjectFactory类属于org.example.ticketagent包,在下文中一共展示了ObjectFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: listFlights
import org.example.ticketagent.ObjectFactory; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public List<BigInteger> listFlights() {
ObjectFactory factory = new ObjectFactory();
TListFlights tListFlights = factory.createTListFlights();
JAXBElement<TListFlights> request = factory.createListFlightsRequest(tListFlights);
JAXBElement<TFlightsResponse> response = null;
try {
response = (JAXBElement<TFlightsResponse>) webServiceTemplate.marshalSendAndReceive(request);
return response.getValue().getFlightNumber();
} catch (Exception e) {
LOGGER.error(e.getMessage());
// TODO handle the exception
return new ArrayList<>();
}
}
示例3: listFlights
import org.example.ticketagent.ObjectFactory; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public List<BigInteger> listFlights() {
ObjectFactory factory = new ObjectFactory();
TListFlights tListFlights = factory.createTListFlights();
JAXBElement<TListFlights> request = factory.createListFlightsRequest(tListFlights);
JAXBElement<TFlightsResponse> response = (JAXBElement<TFlightsResponse>) webServiceTemplate
.marshalSendAndReceive(request, new WebServiceMessageCallback() {
public void doWithMessage(WebServiceMessage message) {
TransportContext context = TransportContextHolder.getTransportContext();
HttpUrlConnection connection = (HttpUrlConnection) context.getConnection();
connection.getConnection().addRequestProperty("Authorization",
BasicAuthenticationUtil.generateBasicAutenticationHeader(clientConfig.getUserName(),
clientConfig.getUserPassword()));
}
});
return response.getValue().getFlightNumber();
}
示例4: listFlights
import org.example.ticketagent.ObjectFactory; //导入依赖的package包/类
public List<BigInteger> listFlights(String clientId) {
ObjectFactory factory = new ObjectFactory();
TListFlights tListFlights = factory.createTListFlights();
// create the SOAP header
TListFlightsHeader tListFlightsHeader =
factory.createTListFlightsHeader();
tListFlightsHeader.setClientId(clientId);
TFlightsResponse response = ticketAgentProxy
.listFlights(tListFlights, tListFlightsHeader);
return response.getFlightNumber();
}
示例5: 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;
}
示例6: listFlights
import org.example.ticketagent.ObjectFactory; //导入依赖的package包/类
public List<BigInteger> listFlights() {
ObjectFactory factory = new ObjectFactory();
TListFlights tListFlights = factory.createTListFlights();
TFlightsResponse response =
ticketAgentProxyBean.listFlights(tListFlights);
return response.getFlightNumber();
}
示例7: 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;
}
示例8: listFlights
import org.example.ticketagent.ObjectFactory; //导入依赖的package包/类
public List<BigInteger> listFlights() {
ObjectFactory factory = new ObjectFactory();
TListFlights tListFlights = factory.createTListFlights();
// create the SOAP header
TListFlightsHeader tListFlightsHeader =
factory.createTListFlightsHeader();
tListFlightsHeader.setClientId("abc123");
TFlightsResponse response = ticketAgentProxy
.listFlights(tListFlightsHeader, tListFlights);
return response.getFlightNumber();
}
示例9: 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;
}
示例10: listFlights
import org.example.ticketagent.ObjectFactory; //导入依赖的package包/类
public List<BigInteger> listFlights(String startCity,
String endCity) throws ListFlightsFault {
ObjectFactory factory = new ObjectFactory();
TListFlights tListFlights = factory.createTListFlights();
tListFlights.setStartCity(startCity);
tListFlights.setEndCity(endCity);
TFlightsResponse response =
ticketAgentProxy.listFlights(tListFlights);
return response.getFlightNumber();
}
示例11: listFlights
import org.example.ticketagent.ObjectFactory; //导入依赖的package包/类
public List<BigInteger> listFlights() {
ObjectFactory factory = new ObjectFactory();
TListFlights tListFlights = factory.createTListFlights();
TFlightsResponse response =
ticketAgentProxy.listFlights(tListFlights);
return response.getFlightNumber();
}
示例12: 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;
}
示例13: 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);
}
示例14: listFlights
import org.example.ticketagent.ObjectFactory; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public List<BigInteger> listFlights() {
ObjectFactory factory = new ObjectFactory();
TListFlights tListFlights = factory.createTListFlights();
JAXBElement<TListFlights> request = factory.createListFlightsRequest(tListFlights);
JAXBElement<TFlightsResponse> response =
(JAXBElement<TFlightsResponse>) webServiceTemplate.marshalSendAndReceive(request);
return response.getValue().getFlightNumber();
}
示例15: 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);
}