Examples of HttpOperation


Examples of javax.wsdl.extensions.http.HTTPOperation

                    axisService.mapActionToOperation(soapAction,
                                                     axisBindingOperation.getAxisOperation());
                }
            } else if (wsdl4jExtensibilityElement instanceof HTTPOperation) {
                HTTPOperation httpOperation = (HTTPOperation) wsdl4jExtensibilityElement;
                AxisBindingOperation axisBindingOperation = (AxisBindingOperation) description;

                String httpLocation = httpOperation.getLocationURI();
                if (httpLocation != null) {
                    // change the template to make it same as WSDL 2 template
                    httpLocation = httpLocation.replaceAll("\\(", "{");
                    httpLocation = httpLocation.replaceAll("\\)", "}");
                    axisBindingOperation
View Full Code Here

Examples of javax.wsdl.extensions.http.HTTPOperation

        // another test would be to check that all parts use a simple type
    }

    protected void validateUrlReplacement(BindingOperation bindingOperation) {
        HTTPOperation httpOperation = (HTTPOperation) WsdlUtils.getOperationExtension(bindingOperation);
        BindingInput input = bindingOperation.getBindingInput();
        Map inputParts = bindingOperation.getOperation().getInput().getMessage().getParts();

        // validate the url pattern
        if (WsdlUtils.useUrlReplacement(input)) {
            String locationUri = httpOperation.getLocationURI();
            Set partNames = inputParts.keySet();
            // Must be *exactly* one search pattern for each message part.
            for (Iterator it = partNames.iterator(); it.hasNext();) {
                String name = (String) it.next();
                Pattern p = Pattern.compile(".*(\\(" + name + "\\)).*");
 
View Full Code Here

Examples of javax.wsdl.extensions.http.HTTPOperation

    protected HttpMethod prepareHttpMethod(BindingOperation opBinding, String verb, Map<String, Element> partValues, Map<String, Node> headers,
                                           final String rootUri, HttpParams params) throws UnsupportedEncodingException {
        if (log.isDebugEnabled()) log.debug("Preparing http request...");
        // convenience variables...
        BindingInput bindingInput = opBinding.getBindingInput();
        HTTPOperation httpOperation = (HTTPOperation) WsdlUtils.getOperationExtension(opBinding);
        MIMEContent content = WsdlUtils.getMimeContent(bindingInput.getExtensibilityElements());
        String contentType = content == null ? null : content.getType();
        boolean useUrlEncoded = WsdlUtils.useUrlEncoded(bindingInput) || PostMethod.FORM_URL_ENCODED_CONTENT_TYPE.equalsIgnoreCase(contentType);
        boolean useUrlReplacement = WsdlUtils.useUrlReplacement(bindingInput);

        // the http method to be built and returned
        HttpMethod method = null;

        // the 4 elements the http method may be made of
        String relativeUri = httpOperation.getLocationURI();
        String queryPath = null;
        RequestEntity requestEntity;
        String encodedParams = null;

        // ODE supports uri template in both port and operation location.
View Full Code Here

Examples of javax.wsdl.extensions.http.HTTPOperation

    protected HttpMethod prepareHttpMethod(BindingOperation opBinding, String verb, Map<String, Element> partValues, Map<String, Node> headers,
                                           final String rootUri, HttpParams params) throws UnsupportedEncodingException {
        if (log.isDebugEnabled()) log.debug("Preparing http request...");
        // convenience variables...
        BindingInput bindingInput = opBinding.getBindingInput();
        HTTPOperation httpOperation = (HTTPOperation) WsdlUtils.getOperationExtension(opBinding);
        MIMEContent content = WsdlUtils.getMimeContent(bindingInput.getExtensibilityElements());
        String contentType = content == null ? null : content.getType();
        boolean useUrlEncoded = WsdlUtils.useUrlEncoded(bindingInput) || PostMethod.FORM_URL_ENCODED_CONTENT_TYPE.equalsIgnoreCase(contentType);
        boolean useUrlReplacement = WsdlUtils.useUrlReplacement(bindingInput);

        // the http method to be built and returned
        HttpMethod method = null;

        // the 4 elements the http method may be made of
        String relativeUri = httpOperation.getLocationURI();
        String queryPath = null;
        RequestEntity requestEntity;
        String encodedParams = null;

        // ODE supports uri template in both port and operation location.
View Full Code Here

Examples of javax.wsdl.extensions.http.HTTPOperation

                    axisService.mapActionToOperation(soapAction,
                                                     axisBindingOperation.getAxisOperation());
                }
            } else if (wsdl4jExtensibilityElement instanceof HTTPOperation) {
                HTTPOperation httpOperation = (HTTPOperation) wsdl4jExtensibilityElement;
                AxisBindingOperation axisBindingOperation = (AxisBindingOperation) description;

                String httpLocation = httpOperation.getLocationURI();
                if (httpLocation != null) {
                    // change the template to make it same as WSDL 2 template
                    httpLocation = httpLocation.replaceAll("\\(", "{");
                    httpLocation = httpLocation.replaceAll("\\)", "}");
                    axisBindingOperation
View Full Code Here

Examples of org.eclipse.wst.wsdl.binding.http.HTTPOperation

    // We blow away any existing ExtensibilityElements/content before we generate it
    // Is it worth being smarter?  Look for matching content first and create those which aren't found????
    List removeList = new ArrayList(bindingOperation.getEExtensibilityElements());
    removeExtensebilityElements(bindingOperation.getEExtensibilityElements(), removeList);

    HTTPOperation httpOperation = HTTPFactory.eINSTANCE.createHTTPOperation();
    httpOperation.setLocationURI("/" + operation.getName());
    bindingOperation.addExtensibilityElement(httpOperation);
  }
View Full Code Here

Examples of org.ocpsoft.rewrite.servlet.config.HttpOperation

               .addRule(Join.path("/{lang}/{path}/transposition_only").to("/{path}"))
               .where("path").transposedBy(LocaleTransposition.bundle("bundle", "lang"))

               .addRule(Join.path("/{lang}/{path}/transposition_failed_1").to("/{path}"))
               .where("path").transposedBy(LocaleTransposition.bundle("bundle", "lang").onTranspositionFailed(
                        new HttpOperation()
                        {
                           @Override
                           public void performHttp(HttpServletRewrite event, EvaluationContext context)
                           {
                              SendStatus.code(201).performHttp(event, context);
                           }
                        }))

               .addRule(Join.path("/{lang}/{path}/transposition_failed_2").to("/{path}"))
               .where("path").transposedBy(LocaleTransposition.bundle("bundle", "lang").onTranspositionFailed(
                        new HttpOperation()
                        {
                           @Override
                           public void performHttp(HttpServletRewrite event, EvaluationContext context)
                           {
                              SendStatus.code(202).performHttp(event, context);
View Full Code Here

Examples of org.ocpsoft.rewrite.servlet.config.HttpOperation

               /*
                * Test unbuffered. Use a Join to perform a forward so we know buffering would have been activated.
                */
               .addRule(Join.path("/unbuffered").to("/unbuffered.html"))
               .addRule().when(Path.matches("/unbuffered.html"))
               .perform(new HttpOperation() {
                  @Override
                  public void performHttp(HttpServletRewrite event, EvaluationContext context)
                  {
                     if (HttpRewriteWrappedResponse.getCurrentInstance(event.getRequest())
                              .isResponseContentIntercepted())
                     {
                        throw new IllegalStateException("Buffering should not be active.");
                     }
                     else
                     {
                        Response.setStatus(201).perform(event, context);
                     }
                  }
               })

               /*
                * Test buffer failure constraints.
                */
               .addRule(Join.path("/bufferforward").to("/forward.html"))
               .addRule().when(Path.matches("/forward.html"))
               .perform(new HttpOperation() {
                  @Override
                  public void performHttp(HttpServletRewrite event, EvaluationContext context)
                  {
                     Response.withOutputInterceptedBy(new ResponseToLowercase()).perform(event, context);
                     Response.setStatus(202).perform(event, context);
                  }
               })

               .addRule().when(Path.matches("/bufferfail"))
               .perform(new HttpOperation() {
                  @Override
                  public void performHttp(HttpServletRewrite event, EvaluationContext context)
                  {
                     try {
                        event.getResponse().getOutputStream(); // cause buffers to lock
View Full Code Here

Examples of org.ocpsoft.rewrite.servlet.config.HttpOperation

               /**
                * Define the inbound conditions and conversion mechanisms to be used when handling inbound requests.
                */
               .when(Method.isGet()
                        .and(Path.matches("/store/product/{pid}")))
               .perform(new HttpOperation() {
                  @Override
                  public void performHttp(final HttpServletRewrite event, final EvaluationContext context)
                  {
                     /**
                      * Extract the stored {pid} from our Path and load the Product. This is an example of how we can
                      * use a converter to directly bind and store the object we want into a binding. {@link Evaluation}
                      * is an low-level construct, and binds array values that must be dereferenced. If using other
                      * bindings such as {@link El}, the value will be bound directly to the type of the referenced
                      * property type, and this array downcast is not necessary.
                      */
                     ParameterStore store = (ParameterStore) context.get(ParameterStore.class);
                     Product product = (Product) Evaluation.property("pid").retrieveConverted(event, context,
                              store.get("pid"));

                     /**
                      * Marshal the Product into XML using JAXB. This has been extracted into a utility class.
                      */
                     try {
                        XMLUtil.streamFromObject(Product.class, product, event.getResponse()
                                 .getOutputStream());
                     }
                     catch (IOException e) {
                        throw new RuntimeException(e);
                     }

                     /**
                      * Set the content type and status code of the response, this again could be extracted into a REST
                      * utility class.
                      */
                     event.getResponse().setContentType("application/xml");
                     ((HttpInboundServletRewrite) event).sendStatusCode(200);
                  }
               }).where("pid").matches("\\d+")
               .constrainedBy(new IntegerConstraint())
               .convertedBy(productConverter)
               .validatedBy(productValidator)

               .addRule()
               .when(Path.matches("/store/products").and(Method.isGet()))
               .perform(new HttpOperation() {
                  @Override
                  public void performHttp(final HttpServletRewrite event, final EvaluationContext context)
                  {
                     try {
                        XMLUtil.streamFromObject(ProductRegistry.class, products, event.getResponse().getOutputStream());
                        event.getResponse().setContentType("application/xml");
                        ((HttpInboundServletRewrite) event).sendStatusCode(200);
                     }
                     catch (Exception e) {
                        throw new RuntimeException(e);
                     }
                  }
               })

               .addRule()
               .when(Path.matches("/store/products").and(Method.isPost()))
               .perform(new PostOperation())

               .addRule().when(Path.matches("/")).perform(new HttpOperation() {

                  @Override
                  public void performHttp(final HttpServletRewrite event, final EvaluationContext context)
                  {
                     try {
View Full Code Here

Examples of org.ocpsoft.rewrite.servlet.config.HttpOperation

                */
               .addRule()
               .when(Path.matches("/binding/{value}").and(DispatchType.isRequest()))
               .perform(Forward.to("/empty.xhtml")

                        .and(PhaseOperation.enqueue(new HttpOperation() {
                           @Override
                           public void performHttp(HttpServletRewrite event, EvaluationContext context)
                           {
                              String value = event.getRequest().getParameter("v");
                              if (value != null)
                                 SendStatus.code(505).perform(event, context);
                           }
                        }).before(PhaseId.RESTORE_VIEW))

                        .and(PhaseOperation.enqueue(new HttpOperation() {
                           @Override
                           public void performHttp(HttpServletRewrite event, EvaluationContext context)
                           {
                              HttpServletRequest request = event.getRequest();
                              String value = request.getParameter("v");
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.