Search in sources :

Example 16 with WebResult

use of javax.jws.WebResult in project cxf by apache.

the class AbstractNotificationBroker method getCurrentMessage.

/**
 * @param getCurrentMessageRequest
 * @return returns org.oasis_open.docs.wsn.b_1.GetCurrentMessageResponse
 * @throws MultipleTopicsSpecifiedFault
 * @throws TopicNotSupportedFault
 * @throws InvalidTopicExpressionFault
 * @throws ResourceUnknownFault
 * @throws TopicExpressionDialectUnknownFault
 * @throws NoCurrentMessageOnTopicFault
 */
@WebMethod(operationName = "GetCurrentMessage")
@WebResult(name = "GetCurrentMessageResponse", targetNamespace = "http://docs.oasis-open.org/wsn/b-1", partName = "GetCurrentMessageResponse")
public GetCurrentMessageResponse getCurrentMessage(@WebParam(name = "GetCurrentMessage", targetNamespace = "http://docs.oasis-open.org/wsn/b-1", partName = "GetCurrentMessageRequest") GetCurrentMessage getCurrentMessageRequest) throws // CHECKSTYLE:OFF - WS-Notification spec throws a lot of faults
InvalidTopicExpressionFault, MultipleTopicsSpecifiedFault, NoCurrentMessageOnTopicFault, ResourceUnknownFault, TopicExpressionDialectUnknownFault, TopicNotSupportedFault {
    // CHECKSTYLE:ON
    LOGGER.finest("GetCurrentMessage");
    NoCurrentMessageOnTopicFaultType fault = new NoCurrentMessageOnTopicFaultType();
    throw new NoCurrentMessageOnTopicFault("There is no current message on this topic.", fault);
}
Also used : NoCurrentMessageOnTopicFaultType(org.oasis_open.docs.wsn.b_2.NoCurrentMessageOnTopicFaultType) NoCurrentMessageOnTopicFault(org.oasis_open.docs.wsn.bw_2.NoCurrentMessageOnTopicFault) WebMethod(javax.jws.WebMethod) WebResult(javax.jws.WebResult)

Example 17 with WebResult

use of javax.jws.WebResult in project cxf by apache.

the class AbstractPullPoint method getMessages.

/**
 * @param getMessagesRequest
 * @return returns org.oasis_open.docs.wsn.b_1.GetMessagesResponse
 * @throws ResourceUnknownFault
 * @throws UnableToGetMessagesFault
 */
@WebMethod(operationName = "GetMessages")
@WebResult(name = "GetMessagesResponse", targetNamespace = "http://docs.oasis-open.org/wsn/b-1", partName = "GetMessagesResponse")
public GetMessagesResponse getMessages(@WebParam(name = "GetMessages", targetNamespace = "http://docs.oasis-open.org/wsn/b-1", partName = "GetMessagesRequest") GetMessages getMessagesRequest) throws ResourceUnknownFault, UnableToGetMessagesFault {
    LOGGER.finest("GetMessages");
    BigInteger max = getMessagesRequest.getMaximumNumber();
    List<NotificationMessageHolderType> messages = getMessages(max != null ? max.intValue() : 0);
    GetMessagesResponse response = new GetMessagesResponse();
    response.getNotificationMessage().addAll(messages);
    return response;
}
Also used : GetMessagesResponse(org.oasis_open.docs.wsn.b_2.GetMessagesResponse) BigInteger(java.math.BigInteger) NotificationMessageHolderType(org.oasis_open.docs.wsn.b_2.NotificationMessageHolderType) WebMethod(javax.jws.WebMethod) WebResult(javax.jws.WebResult)

Example 18 with WebResult

use of javax.jws.WebResult in project cxf by apache.

the class AbstractSubscription method renew.

/**
 * @param renewRequest
 * @return returns org.oasis_open.docs.wsn.b_1.RenewResponse
 * @throws UnacceptableTerminationTimeFault
 * @throws ResourceUnknownFault
 */
@WebMethod(operationName = "Renew")
@WebResult(name = "RenewResponse", targetNamespace = "http://docs.oasis-open.org/wsn/b-2", partName = "RenewResponse")
public RenewResponse renew(@WebParam(name = "Renew", targetNamespace = "http://docs.oasis-open.org/wsn/b-2", partName = "RenewRequest") Renew renewRequest) throws ResourceUnknownFault, UnacceptableTerminationTimeFault {
    XMLGregorianCalendar time = validateTerminationTime(renewRequest.getTerminationTime());
    this.setTerminationTime(time);
    renew(time);
    RenewResponse response = new RenewResponse();
    response.setTerminationTime(time);
    response.setCurrentTime(getCurrentTime());
    return response;
}
Also used : XMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar) RenewResponse(org.oasis_open.docs.wsn.b_2.RenewResponse) WebMethod(javax.jws.WebMethod) WebResult(javax.jws.WebResult)

Example 19 with WebResult

use of javax.jws.WebResult in project quickstarts by jboss-switchyard.

the class AirportService method getFLTID.

/**
 * Get flight identifier for the parameters.
 * @param from place (city)
 * @param to place (city)
 * @param date of flight
 * @return format [from/to/month/day]
 */
@WebMethod
@WebResult(name = "fltid")
public String getFLTID(@WebParam(name = "from") String from, @WebParam(name = "to") String to, @WebParam(name = "date") Date date) {
    Calendar c = Calendar.getInstance();
    c.setTime(date);
    return from + "/" + to + "/" + String.valueOf(c.get(Calendar.MONTH) + 1) + "/" + String.valueOf(c.get(Calendar.DAY_OF_MONTH));
}
Also used : Calendar(java.util.Calendar) WebMethod(javax.jws.WebMethod) WebResult(javax.jws.WebResult)

Example 20 with WebResult

use of javax.jws.WebResult in project quickstarts by jboss-switchyard.

the class AirportService method getFLTID.

/**
 * Get flight identifier for the parameters.
 * @param from place (city)
 * @param to place (city)
 * @param date of flight
 * @return format [from/to/month/day]
 */
@WebMethod
@WebResult(name = "fltid")
public String getFLTID(@WebParam(name = "from") String from, @WebParam(name = "to") String to, @WebParam(name = "date") Date date) {
    Calendar c = Calendar.getInstance();
    c.setTime(date);
    return from + "/" + to + "/" + String.valueOf(c.get(Calendar.MONTH) + 1) + "/" + String.valueOf(c.get(Calendar.DAY_OF_MONTH));
}
Also used : Calendar(java.util.Calendar) WebMethod(javax.jws.WebMethod) WebResult(javax.jws.WebResult)

Aggregations

WebResult (javax.jws.WebResult)20 WebMethod (javax.jws.WebMethod)14 Method (java.lang.reflect.Method)4 WebParam (javax.jws.WebParam)4 QName (javax.xml.namespace.QName)4 ResponseWrapper (javax.xml.ws.ResponseWrapper)4 AbstractCodeGenTest (org.apache.cxf.tools.wsdlto.AbstractCodeGenTest)4 Test (org.junit.Test)4 File (java.io.File)3 ObjectStreamClass (java.io.ObjectStreamClass)3 Calendar (java.util.Calendar)2 WebService (javax.jws.WebService)2 RequestWrapper (javax.xml.ws.RequestWrapper)2 Customers (org.apache.cxf.customer.Customers)2 Project (com.artezio.arttime.datamodel.Project)1 BigInteger (java.math.BigInteger)1 Oneway (javax.jws.Oneway)1 SOAPBinding (javax.jws.soap.SOAPBinding)1 POST (javax.ws.rs.POST)1 Path (javax.ws.rs.Path)1