Examples of SOAPMessage


Examples of javax.xml.soap.SOAPMessage

      Boolean outboundProperty = (Boolean) messageContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);

      // Mensagem chegando
      if (!outboundProperty.booleanValue()) {
        SOAPMessageContext sctx = (SOAPMessageContext) messageContext;
            SOAPMessage message     = sctx.getMessage();
            SOAPPart sp             = message.getSOAPPart();
            SOAPEnvelope senv       = sp.getEnvelope();
            SOAPHeader sh           = senv.getHeader();
           
            System.out.println("1: " + senv.getNodeName());
            Iterator it2 = senv.getChildElements();
View Full Code Here

Examples of javax.xml.soap.SOAPMessage

        RMProperties rmps = RMContextUtils.retrieveRMProperties(context, true);
        if (null == rmps) {
            // nothing to encode
            return;
        }
        SOAPMessage message = context.getMessage();
        try {
            SOAPEnvelope env = message.getSOAPPart().getEnvelope();
            SOAPHeader header = env.getHeader() != null
                                ? env.getHeader()
                                : env.addHeader();
                               
            discardRMHeaders(header);
View Full Code Here

Examples of javax.xml.soap.SOAPMessage

     * @param context the messsage context
     * @param the decoded MAPs
     * @exception SOAPFaultException if decoded MAPs are invalid
     */
    private void decode(SOAPMessageContext context) {
        SOAPMessage message = context.getMessage();
        RMProperties rmps = unmarshalRMProperties(message);
        RMContextUtils.storeRMProperties(context, rmps, false);
    }
View Full Code Here

Examples of javax.xml.soap.SOAPMessage

        EasyMock.expectLastCall().andReturn(Boolean.valueOf(outbound));
        context.get(REQUESTOR_ROLE_PROPERTY);
        EasyMock.expectLastCall().andReturn(Boolean.valueOf(requestor));
        String mapProperty = getMAPProperty(requestor, outbound);
        AddressingPropertiesImpl maps = getMAPs(exposeAs, outbound);
        SOAPMessage message = control.createMock(SOAPMessage.class);
        context.getMessage();
        EasyMock.expectLastCall().andReturn(message);
        SOAPHeader header = setUpSOAPHeader(context, message, outbound);
        JAXBContext jaxbContext = control.createMock(JAXBContext.class);
        ContextUtils.setJAXBContext(jaxbContext);
View Full Code Here

Examples of javax.xml.soap.SOAPMessage

        try {
            methodCalled("handleMessage");
            printHandlerInfo("handleMessage", isOutbound(ctx));
            Object b  = ctx.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
            boolean outbound = (Boolean)b;
            SOAPMessage msg = ctx.getMessage();

            if (isServerSideHandler()) {
                if (outbound) {
                    continueProcessing = true;
                } else {
                    continueProcessing = getReturnValue(outbound, ctx);
                    if (!continueProcessing) {
                        outbound = true;
                    }
                }

                if (outbound) {
                    try {
                        // append handler id to SOAP response message
                        SOAPBody body = msg.getSOAPBody();
                        Node resp = body.getFirstChild();

                        if (resp.getNodeName().contains("pingResponse")) {
                            Node child = resp.getFirstChild();
                            Document doc = resp.getOwnerDocument();
                            Node info = doc.createElementNS(child.getNamespaceURI(), child.getLocalName());
                            info.setPrefix("ns4");
                            info.appendChild(doc.createTextNode(getHandlerId()));
                            resp.appendChild(info);
                            msg.saveChanges();
                        }
                    } catch (DOMException e) {
                        e.printStackTrace();
                    }
                } else {
View Full Code Here

Examples of javax.xml.soap.SOAPMessage

            return true;
        }

        boolean ret = true;
        try {
            SOAPMessage msg  = ctx.getMessage();
            SOAPBody body = msg.getSOAPBody();

            if (body.getFirstChild().getFirstChild() == null) {
                return true;
            }
View Full Code Here

Examples of javax.xml.soap.SOAPMessage

        binding.marshal(objContext,
                         soapContext,
                         new JAXBDataBindingCallback(objContext.getMethod(),
                                                     DataBindingCallback.Mode.PARTS,
                                                     null));
        SOAPMessage msg = soapContext.getMessage();
       
        PersistenceUtils pu = new PersistenceUtils();
        InputStream is = pu.getContextAsInputStream(soapContext);
        assert null != is;       
        MessageContext restored = pu.getContext(is);
        assertEquals(3, restored.keySet().size());
        assertEquals(soapContext.get(ObjectMessageContext.MESSAGE_INPUT),
                     restored.get(ObjectMessageContext.MESSAGE_INPUT));
        Object[] params = (Object[])soapContext.get(ObjectMessageContext.METHOD_PARAMETERS);
        Object[] restoredParams = (Object[])restored.get(ObjectMessageContext.METHOD_PARAMETERS);
        assertEquals(params.length, restoredParams.length);
        assertEquals(params[0], restoredParams[0]);
        SOAPMessage restoredMsg = ((SOAPMessageContext)binding.
            createBindingMessageContext(objContext)).getMessage();
        assertEquals(msg.getSOAPBody().getChildNodes().getLength(),
                     restoredMsg.getSOAPBody().getChildNodes().getLength());
        assertNull(msg.getSOAPHeader());
        assertNull(restoredMsg.getSOAPHeader());
       
        InputStream is2 = pu.getContextAsInputStream(restored);
        is.reset();
        is2.reset();       
        assertEquals(is.available(), is2.available());
View Full Code Here

Examples of javax.xml.soap.SOAPMessage

        objectCtx.put(ObjectMessageContext.MESSAGE_INPUT, Boolean.FALSE);
        objectCtx.put(MESSAGE_OUTBOUND_PROPERTY, Boolean.TRUE);
        SOAPMessageContext context = (SOAPMessageContext)sb.createBindingMessageContext(objectCtx);

        MessageFactory msgFactory = MessageFactory.newInstance();
        SOAPMessage msg = msgFactory.createMessage();
        msg.setProperty(SOAPMessage.WRITE_XML_DECLARATION, "true");
        msg.getSOAPPart().getEnvelope().addNamespaceDeclaration(W3CConstants.NP_SCHEMA_XSD,
                                                                W3CConstants.NU_SCHEMA_XSD);
        msg.getSOAPPart().getEnvelope().addNamespaceDeclaration(W3CConstants.NP_SCHEMA_XSI,
                                                                W3CConstants.NU_SCHEMA_XSI);
        context.setMessage(msg);
       
        RMPropertiesImpl rmps = new RMPropertiesImpl();
        RMContextUtils.storeRMProperties(context, rmps, true);
View Full Code Here

Examples of javax.xml.soap.SOAPMessage

        RMContextUtils.storeRMProperties(context, rmps, true);
        return context;
    }

    private void verifyHeaders(SOAPMessageContext context, String... names) throws SOAPException {
        SOAPMessage message = context.getMessage();
        SOAPEnvelope env = message.getSOAPPart().getEnvelope();
        SOAPHeader header = env.getHeader();

        // check all expected headers are present

        for (String name : names) {
View Full Code Here

Examples of javax.xml.soap.SOAPMessage

        ctx.put("c", new Integer(Integer.MIN_VALUE));
        ctx.put("d", mn);
        ctx.put("e", this);
        InputStream mis = RMHandlerTest.class.getResourceAsStream("resources/GreetMeDocLiteralRequest.xml");
        SOAPBindingImpl binding = new SOAPBindingImpl(false);
        SOAPMessage smsg = binding.getMessageFactory().createMessage(null, mis);
        ctx.put(SOAP_MSG_KEY, smsg);
        InputStream cis = RMUtils.getPersistenceUtils().getContextAsInputStream(ctx);
        EasyMock.expect(msg.getContextAsStream()).andReturn(cis);
       
        control.replay();
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.