Search in sources :

Example 21 with WebMethod

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

the class CustomerService method getCustomers.

@WebMethod
@WebResult(name = "customers")
public Customers getCustomers() {
    Customers cbean = new Customers();
    cbean.setCustomer(customers.values());
    return cbean;
}
Also used : Customers(org.apache.cxf.customer.Customers) WebMethod(javax.jws.WebMethod) WebResult(javax.jws.WebResult)

Example 22 with WebMethod

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

the class BaseGreeterImpl method testDocLitBare.

@WebMethod
public BareDocumentResponse testDocLitBare(String in) {
    invocationCount++;
    BareDocumentResponse res = new BareDocumentResponse();
    res.setCompany("CXF");
    res.setId(1);
    return res;
}
Also used : BareDocumentResponse(org.apache.hello_world_soap_http.types.BareDocumentResponse) WebMethod(javax.jws.WebMethod)

Example 23 with WebMethod

use of javax.jws.WebMethod in project opentheso by miledrousset.

the class Soap method conceptToSkos.

/**
 * Web service operation
 * @param idConcept
 * @param idThesaurus
 * @return
 */
@WebMethod(operationName = "conceptToSkos")
public String conceptToSkos(@WebParam(name = "idConcept") String idConcept, @WebParam(name = "idThesaurus") String idThesaurus) {
    if (ds == null)
        return null;
    if (prefs == null)
        return null;
    ExportFromBDD exportFromBDD = new ExportFromBDD();
    exportFromBDD.setServerArk(prefs.getProperty("serverArk"));
    exportFromBDD.setServerAdress(prefs.getProperty("cheminSite"));
    String skos = exportFromBDD.exportConcept(ds, idThesaurus, idConcept).toString();
    return skos;
}
Also used : ExportFromBDD(mom.trd.opentheso.core.exports.old.ExportFromBDD) WebMethod(javax.jws.WebMethod)

Example 24 with WebMethod

use of javax.jws.WebMethod in project Payara by payara.

the class ServiceInterfaceGenerator method calculateMethods.

private Method[] calculateMethods(Class sib, Method[] initialList) {
    // we start by assuming the @WebMethod was NOT used on this class
    boolean webMethodAnnotationUsed = false;
    List<Method> list = new ArrayList<Method>();
    for (Method m : initialList) {
        WebMethod wm = m.getAnnotation(WebMethod.class);
        if ((wm != null) && !webMethodAnnotationUsed) {
            webMethodAnnotationUsed = true;
            // reset the list, this is the first annotated method we find
            list.clear();
        }
        if (wm != null) {
            list.add(m);
        } else {
            if (!webMethodAnnotationUsed && !m.getDeclaringClass().equals(java.lang.Object.class)) {
                list.add(m);
            }
        }
    }
    return list.toArray(new Method[list.size()]);
}
Also used : WebMethod(javax.jws.WebMethod) ArrayList(java.util.ArrayList) WebMethod(javax.jws.WebMethod) Method(java.lang.reflect.Method)

Example 25 with WebMethod

use of javax.jws.WebMethod in project quickstart by wildfly.

the class RestaurantServiceATImpl method makeBooking.

/**
 * Book a number of seats in the restaurant. Enrols a Participant, then passes the call through to the business logic.
 */
@WebMethod
public void makeBooking() throws RestaurantException {
    System.out.println("[SERVICE] Restaurant service invoked to make a booking");
    String transactionId;
    try {
        // get the transaction ID associated with this thread
        transactionId = UserTransactionFactory.userTransaction().toString();
        // enlist the Participant for this service:
        RestaurantParticipant restaurantParticipant = new RestaurantParticipant(transactionId);
        TransactionManager transactionManager = TransactionManagerFactory.transactionManager();
        System.out.println("[SERVICE] Enlisting a Durable2PC participant into the AT");
        transactionManager.enlistForDurableTwoPhase(restaurantParticipant, "restaurantServiceAT:" + UUID.randomUUID());
    } catch (Exception e) {
        throw new RestaurantException("Error when enlisting participant", e);
    }
    // invoke the backend business logic:
    System.out.println("[SERVICE] Invoking the back-end business logic");
    mockRestaurantManager.makeBooking(transactionId);
}
Also used : TransactionManager(com.arjuna.mw.wst11.TransactionManager) WebMethod(javax.jws.WebMethod)

Aggregations

WebMethod (javax.jws.WebMethod)48 Method (java.lang.reflect.Method)13 WebResult (javax.jws.WebResult)12 Test (org.junit.Test)7 File (java.io.File)6 IOException (java.io.IOException)6 AbstractCodeGenTest (org.apache.cxf.tools.wsdlto.AbstractCodeGenTest)6 ActionExecutionException (com.axway.ats.agent.core.exceptions.ActionExecutionException)5 AgentException (com.axway.ats.agent.core.exceptions.AgentException)5 InternalComponentException (com.axway.ats.agent.core.exceptions.InternalComponentException)5 NoCompatibleMethodFoundException (com.axway.ats.agent.core.exceptions.NoCompatibleMethodFoundException)5 NoSuchActionException (com.axway.ats.agent.core.exceptions.NoSuchActionException)5 NoSuchComponentException (com.axway.ats.agent.core.exceptions.NoSuchComponentException)5 Path (javax.ws.rs.Path)5 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)4 QName (javax.xml.namespace.QName)4 ByteArrayOutputStream (java.io.ByteArrayOutputStream)3 ObjectOutputStream (java.io.ObjectOutputStream)3 ArrayList (java.util.ArrayList)3 GET (javax.ws.rs.GET)3