Package org.apache.cxf.interceptor.transform

Examples of org.apache.cxf.interceptor.transform.TransformOutInterceptor


        Client client = ClientProxy.getClient(greeter);
        client.getRequestContext().put(RMManager.WSRM_VERSION_PROPERTY, RM10Constants.NAMESPACE_URI);
        client.getRequestContext().put(RMManager.WSRM_WSA_VERSION_PROPERTY, Names200408.WSA_NAMESPACE_NAME);

        // rewrite the outgoing message's WS-RM namespace to 1.1
        TransformOutInterceptor trans = new TransformOutInterceptor();
        Map<String, String> outElements = new HashMap<String, String>();
        outElements.put("{" + RM10Constants.NAMESPACE_URI + "}*", "{" + RM11Constants.NAMESPACE_URI + "}*");
        trans.setOutTransformElements(outElements);
       
        client.getOutInterceptors().add(trans);
        try {
            greeter.greetMe("one");
            fail("invalid namespace combination accepted");
View Full Code Here


        Client client = ClientProxy.getClient(greeter);
        client.getRequestContext().put(RMManager.WSRM_VERSION_PROPERTY, RM10Constants.NAMESPACE_URI);
        client.getRequestContext().put(RMManager.WSRM_WSA_VERSION_PROPERTY, Names200408.WSA_NAMESPACE_NAME);

        // rewrite the outgoing message's WS-A namespace to an invalid one
        TransformOutInterceptor trans = new TransformOutInterceptor();
        Map<String, String> outElements = new HashMap<String, String>();
        outElements.put("{" + Names200408.WSA_NAMESPACE_NAME + "}*", "{http://cxf.apache.org/invalid}*");
        trans.setOutTransformElements(outElements);
       
        client.getOutInterceptors().add(trans);
        try {
            greeter.greetMe("one");
            fail("invalid wsa header accepted");
View Full Code Here

        Client client = ClientProxy.getClient(greeter);
        client.getRequestContext().put(RMManager.WSRM_VERSION_PROPERTY, RM10Constants.NAMESPACE_URI);
        client.getRequestContext().put(RMManager.WSRM_WSA_VERSION_PROPERTY, Names200408.WSA_NAMESPACE_NAME);

        // rewrite the outgoing message's WS-RM namespace to an invalid one
        TransformOutInterceptor trans = new TransformOutInterceptor();
        Map<String, String> outElements = new HashMap<String, String>();
        outElements.put("{" + RM10Constants.NAMESPACE_URI + "}*", "{http://cxf.apache.org/invalid}*");
        trans.setOutTransformElements(outElements);
       
        client.getOutInterceptors().add(trans);
        try {
            greeter.greetMe("one");
            fail("invalid wsrm header");
View Full Code Here

        Client client = ClientProxy.getClient(greeter);
        client.getRequestContext().put(RMManager.WSRM_VERSION_PROPERTY, RM10Constants.NAMESPACE_URI);
        client.getRequestContext().put(RMManager.WSRM_WSA_VERSION_PROPERTY, Names200408.WSA_NAMESPACE_NAME);

        // remove the outgoing message's WS-RM header
        TransformOutInterceptor trans = new TransformOutInterceptor();
        Map<String, String> outElements = new HashMap<String, String>();
        outElements.put("{" + RM10Constants.NAMESPACE_URI + "}Sequence", "");
        trans.setOutTransformElements(outElements);
       
        client.getOutInterceptors().add(trans);
        try {
            greeter.greetMe("one");
            fail("invalid wsrm header");
View Full Code Here

    public void testPostBookTransform() throws Exception {
          
        String address = "http://localhost:" + PORT
                         + "/test/v1/rest-transform/bookstore/books";
       
        TransformOutInterceptor out =  new TransformOutInterceptor();
        out.setOutTransformElements(
            Collections.singletonMap("{http://www.example.org/books}*",
                                     "{http://www.example.org/super-books}*"));
       
        TransformInInterceptor in =  new TransformInInterceptor();
        Map<String, String> map = new HashMap<String, String>();
View Full Code Here

        BookSoapService service =
            new BookSoapService(new URL(wsdlAddress),
                                new QName("http://books.com", "BookService"));
        BookStoreJaxrsJaxws store = service.getBookPort();
       
        TransformOutInterceptor out =  new TransformOutInterceptor();
        Map<String, String> mapOut = new HashMap<String, String>();
        // Book content (id, name) is unqualified, thus the following works
        // because JAXB will report
        // - {http://jaxws.jaxrs.systest.cxf.apache.org/}Book
        // - id
        // - name
        // and only the qualified top-level Book tag gets matched by the following
        // mapping
        mapOut.put("{http://jaxws.jaxrs.systest.cxf.apache.org/}*", "*");
        out.setOutTransformElements(mapOut);
       
        TransformInInterceptor in =  new TransformInInterceptor();
        Map<String, String> mapIn = new HashMap<String, String>();
        // mapIn.put("*", "{http://jaxws.jaxrs.systest.cxf.apache.org/}*");
        // won't work for a case where a totally unqualified getBookResponse needs to be
View Full Code Here

    public void testPostBookTransform() throws Exception {
          
        String address = "http://localhost:" + PORT
                         + "/test/v1/rest-transform/bookstore/books";
       
        TransformOutInterceptor out =  new TransformOutInterceptor();
        out.setOutTransformElements(
            Collections.singletonMap("{http://www.example.org/books}*",
                                     "{http://www.example.org/super-books}*"));
       
        TransformInInterceptor in =  new TransformInInterceptor();
        Map<String, String> map = new HashMap<String, String>();
View Full Code Here

        BookSoapService service =
            new BookSoapService(new URL(wsdlAddress),
                                new QName("http://books.com", "BookService"));
        BookStoreJaxrsJaxws store = service.getBookPort();
       
        TransformOutInterceptor out =  new TransformOutInterceptor();
        Map<String, String> mapOut = new HashMap<String, String>();
        // Book content (id, name) is unqualified, thus the following works
        // because JAXB will report
        // - {http://jaxws.jaxrs.systest.cxf.apache.org/}Book
        // - id
        // - name
        // and only the qualified top-level Book tag gets matched by the following
        // mapping
        mapOut.put("{http://jaxws.jaxrs.systest.cxf.apache.org/}*", "*");
        out.setOutTransformElements(mapOut);
       
        TransformInInterceptor in =  new TransformInInterceptor();
        Map<String, String> mapIn = new HashMap<String, String>();
        // mapIn.put("*", "{http://jaxws.jaxrs.systest.cxf.apache.org/}*");
        // won't work for a case where a totally unqualified getBookResponse needs to be
View Full Code Here

    public void testPostBookTransform() throws Exception {
          
        String address = "http://localhost:" + PORT
                         + "/test/v1/rest-transform/bookstore/books";
       
        TransformOutInterceptor out =  new TransformOutInterceptor();
        out.setOutTransformElements(
            Collections.singletonMap("{http://www.example.org/books}*",
                                     "{http://www.example.org/super-books}*"));
       
        TransformInInterceptor in =  new TransformInInterceptor();
        Map<String, String> map = new HashMap<String, String>();
View Full Code Here

        BookSoapService service =
            new BookSoapService(new URL(wsdlAddress),
                                new QName("http://books.com", "BookService"));
        BookStoreJaxrsJaxws store = service.getBookPort();
       
        TransformOutInterceptor out =  new TransformOutInterceptor();
        Map<String, String> mapOut = new HashMap<String, String>();
        // Book content (id, name) is unqualified, thus the following works
        // because JAXB will report
        // - {http://jaxws.jaxrs.systest.cxf.apache.org/}Book
        // - id
        // - name
        // and only the qualified top-level Book tag gets matched by the following
        // mapping
        mapOut.put("{http://jaxws.jaxrs.systest.cxf.apache.org/}*", "*");
        out.setOutTransformElements(mapOut);
       
        TransformInInterceptor in =  new TransformInInterceptor();
        Map<String, String> mapIn = new HashMap<String, String>();
        // mapIn.put("*", "{http://jaxws.jaxrs.systest.cxf.apache.org/}*");
        // won't work for a case where a totally unqualified getBookResponse needs to be
View Full Code Here

TOP

Related Classes of org.apache.cxf.interceptor.transform.TransformOutInterceptor

Copyright © 2018 www.massapicom. 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.