Package org.apache.axis

Examples of org.apache.axis.Message


     * Return the target service (should be this!)
     */
    public String argAsDOM(Data input) throws Exception {

       // get the first parameter
       Message message = MessageContext.getCurrentContext().getRequestMessage();
       RPCElement body = (RPCElement)message.getSOAPEnvelope().getFirstBody();
       NodeList parms = body.getAsDOM().getChildNodes();
       Node parm1 = null;
       for (int i=0; i<parms.getLength(); i++) {
           parm1 = parms.item(i);
           if (parm1.getNodeType() == Node.ELEMENT_NODE) break;
View Full Code Here


                          methodNS + "\">";
        String bodyElemFoot = "</m:" + method + ">";
        // Construct the soap request
        String msgStr = header + bodyElemHead + bodyStr +
                        bodyElemFoot + footer;
        msgContext.setRequestMessage(new Message(msgStr));
        msgContext.setTypeMappingRegistry(engine.getTypeMappingRegistry());
       
        // Invoke the Axis engine
        try {
            engine.invoke(msgContext);
        } catch (AxisFault af) {
            return af;
        }

        // Extract the response Envelope
        Message message = msgContext.getResponseMessage();
        assertNotNull("Response message was null!", message);
        SOAPEnvelope envelope = (SOAPEnvelope)message.getSOAPEnvelope();
        assertNotNull("SOAP envelope was null", envelope);

        // Extract the body from the envelope
        RPCElement body = (RPCElement)envelope.getFirstBody();
        assertNotNull("SOAP body was null", body);
View Full Code Here

                        new QName("http://www.sidestep.com/sbws", "SbSupplier")));
    }

    protected Object deserialize(String data)
            throws Exception {
        Message message = new Message(header + data + footer);
        message.setMessageContext(new MessageContext(server));

        SOAPEnvelope envelope = (SOAPEnvelope) message.getSOAPEnvelope();
        assertNotNull("SOAP envelope should not be null", envelope);

        RPCElement body = (RPCElement) envelope.getFirstBody();
        assertNotNull("SOAP body should not be null", body);
View Full Code Here

    public void invoke(MessageContext msgContext) throws AxisFault {
        try {
            System.out.println("Starting Server verification");

            Message inMsg = msgContext.getRequestMessage();
            Message outMsg = msgContext.getResponseMessage();

            // verify signed message

            Document doc = inMsg.getSOAPEnvelope().getAsDocument();
            String BaseURI = "http://xml-security";
View Full Code Here

        log.debug("---");
        log.debug(msgString);
        log.debug("---");

        Message message = new Message(msgString);
        message.setMessageContext(msgContext);
        SOAPEnvelope env = message.getSOAPEnvelope();
        RPCElement rpcEl = (RPCElement)env.getFirstBody();
        Vector params = rpcEl.getParams();
        assertEquals("Wrong # of params in deserialized message!",
                     1,
                     params.size());
View Full Code Here

        // Serialize the bean in to XML
        msg.output(context);
        // Get the XML as a string
        String msgString = writer.toString();

        Message message = new Message(msgString);
        message.setMessageContext(msgContext);
        SOAPEnvelope env = message.getSOAPEnvelope();
        RPCElement rpcEl = (RPCElement)env.getFirstBody();
        Vector params = rpcEl.getParams();
        assertEquals("Wrong # of params in deserialized message!",
                     1,
                     params.size());
View Full Code Here

                if(resolver != null)
                   ret = resolver.getReferencedObject(href);
            }
            if( null == ret && !href.startsWith("#")){
                //Could this be an attachment?
                Message msg= null;
                if(null != (msg=msgContext.getCurrentMessage())){
                    Attachments attch= null;
                    if( null != (attch= msg.getAttachmentsImpl())){
                        try{
                        ret= attch.getAttachmentByReference(href);
                        }catch(AxisFault e){
                            throw new RuntimeException(e.toString() + JavaUtils.stackToString(e));
                        }
View Full Code Here

     * @return soap envelope
     * @throws Exception if there is any problem constructing the soap envelope
     */
    protected Message getSOAPMessage() throws Exception {
        InputStream in = new ByteArrayInputStream(soapMsg.getBytes());
        Message msg = new Message(in);
        msg.setMessageContext(msgContext);
        return msg;
    }
View Full Code Here

       
        encrKeyBuilder.prependToHeader(secHeader);
        encrKeyBuilder.prependBSTElementToHeader(secHeader);

       
       Message encryptedMsg = (Message) SOAPUtil.toSOAPMessage(encryptedDoc);
       if (log.isDebugEnabled()) {
           log.debug("Encrypted message: 3DES  + DerivedKeys");
           XMLUtils.PrettyElementToWriter(encryptedMsg.getSOAPEnvelope()
                    .getAsDOM(), new PrintWriter(System.out));
       }
//       String out = org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc);
//       System.out.println(out);
       verify(doc);
View Full Code Here

         Document encryptedDoc = encrBuilder.build(doc, secHeader);
        
         encrKeyBuilder.prependToHeader(secHeader);
         encrKeyBuilder.prependBSTElementToHeader(secHeader);
        
        Message encryptedMsg = (Message) SOAPUtil.toSOAPMessage(encryptedDoc);
        if (log.isDebugEnabled()) {
            log.debug("Encrypted message: 3DES  + DerivedKeys");
            XMLUtils.PrettyElementToWriter(encryptedMsg.getSOAPEnvelope()
                    .getAsDOM(), new PrintWriter(System.out));
        }
//        String out = org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc);
//        System.out.println(out);
        verify(doc);
View Full Code Here

TOP

Related Classes of org.apache.axis.Message

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.