Package org.apache.axis2.jaxws.handler

Examples of org.apache.axis2.jaxws.handler.SOAPHeadersAdapter


        acoh1ContentList.add(acoh1);
       
        // leaving this list empty
        List<String> acoh2ContentList = new ArrayList<String>();
       
        SOAPHeadersAdapter adapter = (SOAPHeadersAdapter)messageContext.getProperty(Constants.JAXWS_OUTBOUND_SOAP_HEADERS);
       
        adapter.put(ACOH1_HEADER_QNAME, acoh1ContentList);
        adapter.put(ACOH2_HEADER_QNAME, acoh2ContentList);
       
        // TODO is this reasonable for a map (the adapter) to ignore an empty list?  I think so.
        assertTrue("Adapter should have one item, but has " + adapter.size(), adapter.size() == 1);
       
        // double-check
        assertTrue(adapter.get(ACOH1_HEADER_QNAME).get(0).equals(acoh1));
        // TODO is this reasonable for a map (the adapter) to ignore an empty list?  I think so.
        assertTrue("We found an item where we shouldn't have.", adapter.get(ACOH2_HEADER_QNAME) == null);

  }
View Full Code Here


       
        // leaving this list empty
        List<String> acoh2ContentList = new ArrayList<String>();
        acoh2ContentList.add(acoh2);
       
        SOAPHeadersAdapter adapter = (SOAPHeadersAdapter)messageContext.getProperty(Constants.JAXWS_OUTBOUND_SOAP_HEADERS);
       
        QName equivalentKey = new QName(ACOH1_HEADER_QNAME.getNamespaceURI(), ACOH1_HEADER_QNAME.getLocalPart(), ACOH1_HEADER_QNAME.getPrefix());
       
        adapter.put(ACOH1_HEADER_QNAME, acoh1ContentList);
        adapter.put(equivalentKey, acoh2ContentList);

        // testing that two object keys that pass the QName.equals() will result
        // in previously added headers being wiped
       
        assertTrue("Adapter should have one item, but has " + adapter.size(), adapter.size() == 1);
       
        // double-check
        assertTrue(adapter.get(ACOH1_HEADER_QNAME).get(0).equals(acoh2));
        assertTrue(((List<String>)(adapter.get(ACOH1_HEADER_QNAME))).size() == 1);

  }
View Full Code Here

        // leaving this list empty
        List<String> acoh2ContentList = new ArrayList<String>();
        acoh2ContentList.add(acoh2);
        acoh2ContentList.add(acoh3);
       
        SOAPHeadersAdapter adapter = (SOAPHeadersAdapter)messageContext.getProperty(Constants.JAXWS_OUTBOUND_SOAP_HEADERS);
       
        adapter.put(ACOH1_HEADER_QNAME, acoh1ContentList);
        adapter.put(ACOH2_HEADER_QNAME, acoh2ContentList);
       
        // remove everything, by different means
        adapter.remove(ACOH1_HEADER_QNAME);
       
        // SOAPHeadersAdapter does NOT give back a live list, so these don't mean anything
        adapter.get(ACOH2_HEADER_QNAME).remove(0);
        adapter.get(ACOH2_HEADER_QNAME).remove(acoh3);

        assertTrue("Adapter should have one item, but has " + adapter.size(), adapter.size() == 1);
       
        // double-check
        assertTrue(adapter.get(ACOH2_HEADER_QNAME).get(0).equals(acoh2));
        assertTrue(adapter.get(ACOH2_HEADER_QNAME).get(1).equals(acoh3));
        assertTrue(((List<String>)(adapter.get(ACOH2_HEADER_QNAME))).size() == 2);

  }
View Full Code Here

      String acoh1 = e1.toString();
     
        List<String> acoh1ContentList = new ArrayList<String>();
        acoh1ContentList.add(acoh1);
       
        SOAPHeadersAdapter adapter = (SOAPHeadersAdapter)messageContext.getProperty(Constants.JAXWS_OUTBOUND_SOAP_HEADERS);
       
        adapter.put(ACOH1_HEADER_QNAME, acoh1ContentList);
       
        try {
          adapter.remove(ACOH1_HEADER_QNAME);
          fail("should have got an exception");
        } catch (WebServiceException e) {
          // it's not ideal to compare exception output, but...
          assertTrue(e.getCause().getMessage().contains("Element name from data source is acoh2, not the expected acoh1"));
          return;
View Full Code Here

      String acoh1 = e1.toString();

        List<String> acoh1ContentList = new ArrayList<String>();
        acoh1ContentList.add(acoh1);
       
        SOAPHeadersAdapter adapter = (SOAPHeadersAdapter)messageContext.getProperty(Constants.JAXWS_OUTBOUND_SOAP_HEADERS);
       
        adapter.put(ACOH1_HEADER_QNAME, acoh1ContentList);
       
        assertTrue("Adapter should have one item, but has " + adapter.size(), adapter.size() == 1);
  }
View Full Code Here

      String acoh1 = e1.toString();

        List<String> acoh1ContentList = new ArrayList<String>();
        acoh1ContentList.add(acoh1);
       
        SOAPHeadersAdapter adapter = (SOAPHeadersAdapter)messageContext.getProperty(Constants.JAXWS_OUTBOUND_SOAP_HEADERS);
       
        // Mismatched QNames!
        adapter.put(ACOH1_HEADER_QNAME, acoh1ContentList);
        adapter.put(ACOH2_HEADER_QNAME, acoh1ContentList);
       
        assertTrue("Adapter should have two items, but has " + adapter.size(), adapter.size() == 2);
  }
View Full Code Here

      String acoh1 = e1.toString();

        List<String> acoh1ContentList = new ArrayList<String>();
        acoh1ContentList.add(acoh1);
       
        SOAPHeadersAdapter adapter = (SOAPHeadersAdapter)messageContext.getProperty(Constants.JAXWS_OUTBOUND_SOAP_HEADERS);
       
        adapter.put(ACOH1_HEADER_QNAME, acoh1ContentList);
       
        assertTrue("Adapter should contain the key " + ACOH1_HEADER_QNAME, adapter.containsKey(ACOH1_HEADER_QNAME));
  }
View Full Code Here

            String charSetEncoding = BuilderUtil.getCharSetEncoding(contentTypeStr);
            msgContext.setProperty(
                    Constants.Configuration.CHARACTER_SET_ENCODING, charSetEncoding);
            boolean eprFound = false;
            if (endpointsConfiguration != null) {
                URLEndpoint epr = endpointsConfiguration.getEndpoint(request.getRequestLine().getUri());
                if (epr != null) {
                    eprFound = true;
                    String type = TransportUtils.getContentType(contentTypeStr, msgContext);
                    msgContext.setProperty(Constants.Configuration.MESSAGE_TYPE, type);
                    epr.setParameters(msgContext);

                    Builder builder = epr.getBuilder(type);
                    if (HTTPTransportUtils.isRESTRequest(contentTypeStr)) {
                        RESTUtil.processPOSTRequest(msgContext, is, os,
                                request.getRequestLine().getUri(), contentType, builder, isRestDispatching);
                    } else {
View Full Code Here

            String contentTypeStr = contentType != null ?
                    contentType.getValue() : inferContentType();

            boolean eprFound = false;
            if (endpointsConfiguration != null) {
                URLEndpoint epr = endpointsConfiguration.getEndpoint(request.getRequestLine().getUri());
                if (epr != null) {
                    eprFound = true;
                    String type = TransportUtils.getContentType(contentTypeStr, msgContext);
                    msgContext.setProperty(Constants.Configuration.MESSAGE_TYPE, type);

                    epr.setParameters(msgContext);

                    Builder builder = epr.getBuilder(type);
                    RESTUtil.processGetAndDeleteRequest(
                            msgContext, os, request.getRequestLine().getUri(),
                            request.getFirstHeader(HTTP.CONTENT_TYPE), builder,
                            method, isRestDispatching);
                }
View Full Code Here

        params = getListenerParameters();


        param = transportIn.getParameter(NhttpConstants.ENDPOINTS_CONFIGURATION);
        if (param != null && param.getValue() != null) {
            endpoints = new URLEndpointsConfigurationFactory().create(param.getValue().toString());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.axis2.jaxws.handler.SOAPHeadersAdapter

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.