Examples of WebService


Examples of br.com.mystudies.jaxws.WebService

public class WSClient {

  public static void main(String[] args) {
    WebServiceService wss = new WebServiceService();
    WebService ws = wss.getWebServicePort();

    System.out.println(ws.operation("Robson"));
  }
View Full Code Here

Examples of com.jdroid.java.http.WebService

    }
  }
 
  protected WebService newCachedGetService(Cache cache, CachingStrategy cachingStrategy, Long timeToLive,
      Object... urlSegments) {
    WebService webService = newGetService(urlSegments);
    return new CachedWebService(webService, cache, cachingStrategy, timeToLive) {
     
      @Override
      protected File getHttpCacheDirectory(Cache cache) {
        return AbstractApiService.this.getHttpCacheDirectory(cache);
View Full Code Here

Examples of com.sun.enterprise.deployment.WebService

        endpointInfo.setRemoteInterface(serviceEndpointInterfaceClass);
        endpointInfo.setImplementationClass(implementationClass);

        endpointInfo.setName(endpoint_.getEndpointName());

        WebService webService = endpoint_.getWebService();


        // No need to set model file name or wsdl file, since we override
        // the code that serves up the final WSDL.
        //endpointInfo.setModelFileName()
View Full Code Here

Examples of de.uniluebeck.itm.ncoap.application.server.webservice.Webservice

        //Create settable future to wait for response
        final SettableFuture<CoapResponse> responseFuture = SettableFuture.create();

        //Look up web service instance to handle the request
        final Webservice webservice = registeredServices.get(coapRequest.getUriPath());

        if(coapRequest.getObserve() == 1 && webservice instanceof ObservableWebservice){
            Token token = coapRequest.getToken();
            if(((ObservableWebservice) webservice).removeObservation(remoteEndpoint, token)){
                log.info("Stopped observation due to GET request with observe = 1 (remote endpoint: {}, token: {})",
                        remoteEndpoint, token);
            }
            else{
                log.warn("No observation found to be stopped due to GET request with observe = 1 (remote endpoint:" +
                        "{}, token: {}", remoteEndpoint, token);
            }
        }

        responseFuture.addListener(new Runnable() {
            @Override
            public void run() {
                try{
                    CoapResponse coapResponse = responseFuture.get();
                    coapResponse.setMessageID(coapRequest.getMessageID());
                    coapResponse.setToken(coapRequest.getToken());

                    if(coapResponse.isUpdateNotification()){
                        if(webservice instanceof ObservableWebservice && coapRequest.getObserve() == 0){
                            ObservableWebservice observableWebservice = (ObservableWebservice) webservice;
                            observableWebservice.addObservation(remoteEndpoint, coapResponse.getToken(),
                                    coapResponse.getContentFormat());
                            sendUpdateNotification(ctx, remoteEndpoint, coapResponse, observableWebservice);
                        }
                        else{
                            coapResponse.removeOptions(OptionValue.Name.OBSERVE);
                            log.warn("Removed observe option from response!");
                            sendCoapResponse(ctx, remoteEndpoint, coapResponse);
                        }
                    }
                    else{
                        sendCoapResponse(ctx, remoteEndpoint, coapResponse);
                    }
                }
                catch (Exception e) {
                    log.error("Exception while processing inbound request", e);
                    CoapResponse errorResponse = CoapResponse.createErrorResponse(coapRequest.getMessageTypeName(),
                                    MessageCode.Name.INTERNAL_SERVER_ERROR_500, e.getMessage());

                    errorResponse.setMessageID(coapRequest.getMessageID());
                    errorResponse.setToken(coapRequest.getToken());

                    sendCoapResponse(ctx, remoteEndpoint, errorResponse);
                }
            }
        }, executor);

        try{
            //The requested Webservice does not exist
            if(webservice == null)
                webServiceNotFoundHandler.processCoapRequest(responseFuture, coapRequest, remoteEndpoint);

            //The IF-NON-MATCH option indicates that the request is only to be processed if the webservice does not
            //(yet) exist. But it does. So send an error response
            else if(coapRequest.isIfNonMatchSet())
                sendPreconditionFailed(coapRequest.getMessageTypeName(), coapRequest.getUriPath(), responseFuture);

            //The inbound request is to be handled by the addressed service
            else
                webservice.processCoapRequest(responseFuture, coapRequest, remoteEndpoint);

        }
        catch (Exception e) {
            log.error("This should never happen.", e);
            responseFuture.setException(e);
View Full Code Here

Examples of edu.isi.karma.rep.sources.WebService

        return;
      }
    }
   
    if (getResourceType() == ResourceType.Input || getResourceType() == ResourceType.Output) {
      WebService s = WebServiceLoader.getInstance().getSourceByUri(getServiceUri());
      if (s == null) {
        getResponse().setContentType(MimeType.TEXT_PLAIN);
        pw.write("Could not find the service " + getServiceId() + " in service repository");
        return;
      }
     
      edu.isi.karma.rep.model.Model inputModel = s.getInputModel();
      edu.isi.karma.rep.model.Model outputModel = s.getOutputModel();
      String sparql;
     
      WebServicePublisher servicePublisher = new WebServicePublisher(s);
      if (getResourceType() == ResourceType.Input) {
        if (getFormat().equalsIgnoreCase(SerializationLang.SPARQL)) {
View Full Code Here

Examples of javax.jws.WebService

        return clazz.isAnnotationPresent(WebService.class);
    }

    public WebServiceAnnotation getWebServiceAnnotation(Class clazz)
    {
        WebService webService = (WebService) clazz.getAnnotation(WebService.class);
        if (webService != null)
        {
            WebServiceAnnotation annotation = new WebServiceAnnotation();
            annotation.setEndpointInterface(webService.endpointInterface());
            annotation.setName(webService.name());
            annotation.setServiceName(webService.serviceName());
            annotation.setTargetNamespace(webService.targetNamespace());
            annotation.setPortName(webService.portName());
            annotation.setWsdlLocation(webService.wsdlLocation());
           
            return annotation;
        }
        else
        {
View Full Code Here

Examples of javax.jws.WebService

        NodeList list = msg.getSOAPBody().getChildNodes();
        assertEquals(1, list.getLength());
        Node operationNode = list.item(0);
        assertEquals(objContext.getMethod().getName(), operationNode.getLocalName());
        WebService wsAnnotation = objContext.getMethod().getDeclaringClass().getAnnotation(WebService.class);
        String expectedNameSpace = wsAnnotation.targetNamespace();
        assertTrue(expectedNameSpace.equals(operationNode.getNamespaceURI()));
        assertTrue(operationNode.hasChildNodes());
        assertEquals(arg0, operationNode.getFirstChild().getFirstChild().getNodeValue());
    }
View Full Code Here

Examples of javax.jws.WebService

        NodeList list = msg.getSOAPBody().getChildNodes();
        assertEquals(1, list.getLength());
        Node operationNode = list.item(0);
        assertEquals(objContext.getMethod().getName() + "Response", operationNode.getLocalName());
       
        WebService wsAnnotation = objContext.getMethod().getDeclaringClass().getAnnotation(WebService.class);
        String expectedNameSpace = wsAnnotation.targetNamespace();
        assertTrue(expectedNameSpace.equals(operationNode.getNamespaceURI()));
       
        assertTrue(operationNode.hasChildNodes());
        assertEquals(arg0, operationNode.getFirstChild().getFirstChild().getNodeValue());
    }
View Full Code Here

Examples of javax.jws.WebService

                    } else {
                        //TODO: What if the WSDL is RPC-Literal encoded.
                        // We need to get action out of available annotations?
                        //
                       
                        WebService wsAnnotation = method.getDeclaringClass().getAnnotation(WebService.class);
                        WebMethod wmAnnotation = method.getAnnotation(WebMethod.class);
                       
                        action = getAction(wsAnnotation.targetNamespace(),
                                           method,
                                           wmAnnotation.operationName(),
                                           false);
                    }
                       
                } else {
                    ResponseWrapper responseWrapper =
                        method.getAnnotation(ResponseWrapper.class);
                    if (responseWrapper != null) {
                        action = getAction(responseWrapper.targetNamespace(),
                                           method,
                                           responseWrapper.localName(),
                                          false);
                    } else {
                       //RPC-Literal case.
                        WebService wsAnnotation = method.getDeclaringClass().getAnnotation(WebService.class);
                        WebMethod wmAnnotation = method.getAnnotation(WebMethod.class);
                       
                        action = getAction(wsAnnotation.targetNamespace(),
                                           method,
                                           wmAnnotation.operationName(),
                                           false);
                    }
                }
View Full Code Here

Examples of javax.jws.WebService

       
        targetMethod = Greeter.class.getMethod("sayHi");
        assertNotNull("could not set up target method", targetMethod);
        context.setMethod(targetMethod);

        WebService ws = Greeter.class.getAnnotation(WebService.class);
        assertNotNull(ws);
        serviceName = new QName(ws.targetNamespace(), ws.name());
        initFixture();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.