Package org.apache.axis2.engine

Examples of org.apache.axis2.engine.AxisFault


           
            String recepainets = ((InternetAddress) mimeMessage.getAllRecipients()[0]).getAddress();
            if (recepainets != null) {
                msgContext.setTo(new EndpointReference(AddressingConstants.WSA_FROM, recepainets+ "/"+serviceURL));
            }else{
                throw new AxisFault("No receptineist found in the Email");
            }

            // add the SOAPEnvelope
            String message = mimeMessage.getContent().toString();
            System.out.println("message["+message+"]");
View Full Code Here


                return values[0];
            } else {
                return null;
            }
        } catch (MessagingException e) {
            throw new AxisFault(e);
        }

    }
View Full Code Here

            XMLStreamReader xmlreader =
                XMLInputFactory.newInstance().createXMLStreamReader(in);
            StAXBuilder builder = new StAXSOAPModelBuilder(xmlreader);
            return (SOAPEnvelope) builder.getDocumentElement();
        } catch (Exception e) {
            throw new AxisFault(e.getMessage(), e);
        }
    }
View Full Code Here

                        HTTPConstants.HTTP_REQ_TYPE,
                        HTTPConstants.HEADER_GET);
                    index = 4;

                } else {
                    throw new AxisFault("Unsupported HTTP request type: Only GET and POST is supported");
                }

                value = readFirstLineArg(' ');
                map.put(HTTPConstants.REQUEST_URI, value);
                value = readFirstLineArg('\n');
                map.put(HTTPConstants.PROTOCOL_VERSION, value);
            } else {
                index = 0;
                value = readFirstLineArg(' ');
                if (value != null && value.indexOf("HTTP") >= 0) {
                    map.put(HTTPConstants.PROTOCOL_VERSION, value);
                    value = readFirstLineArg(' ');
                    map.put(HTTPConstants.RESPONSE_CODE, value);
                } else {
                    map.put(HTTPConstants.RESPONSE_CODE, value);
                }

                value = readFirstLineArg('\n');
                map.put(HTTPConstants.RESPONSE_WORD, value);
            }
            state = BEFORE_SEPERATOR;
            while (!done) {
                length = readLine(in, buf);
                if (length <= 0) {
                    throw new AxisFault("Premature end of steam");
                }
                for (int i = 0; i < length; i++) {
                    switch (state) {
                        case BEFORE_SEPERATOR :
                            if (buf[i] == ':') {
                                key = str.toString();
                                str = new StringBuffer();
                                state = AFTER_SEPERATOR;
                                if (buf[i + 1] == ' ') {
                                    i++; // ignore next space
                                }
                            } else {
                                str.append((char) buf[i]);
                            }
                            break;
                        case AFTER_SEPERATOR :
                            if (buf[i] == '\n') {
                                value = str.toString();
                                map.put(key, value);
                                str = new StringBuffer();
                                i = length;
                            } else {
                                str.append((char) buf[i]);
                            }
                            break;

                            // case END_OF_LINE :
                            // if (buf[i] == '\n') {
                            // state = END;
                            // break;
                            // } else {
                            // state = BEFORE_SEPERATOR;
                            // str.append(buf[i]);
                            // }
                            // break;
                            // case END:
                            // break;
                        default :
                            throw new AxisFault(
                                "Error Occured Unknown state " + state);
                    }
                }
                state = BEFORE_SEPERATOR;
            }
        } catch (IOException e) {
            throw new AxisFault(e.getMessage(), e);
        }
        return map;
    }
View Full Code Here

                index++;
            }
            index++;
            return str.toString();
        } catch (Exception e) {
            throw new AxisFault(e.getMessage(), e);
        }
    }
View Full Code Here

                    c = is.read();
                }
            }
        }
        if (c == -1) {
            throw new AxisFault("Every line should ends with the \\n, unexpected End of stream");
        } else {
            return (count > 0) ? count : -1;
        }
    }
View Full Code Here

            StAXBuilder builder = new StAXSOAPModelBuilder(reader);
            msgContext.setEnvelope((SOAPEnvelope) builder.getDocumentElement());
            // invoke the Axis engine
            engine.receive(msgContext);
        } catch (Exception e) {
            AxisFault af;
            if (e instanceof AxisFault) {
                af = (AxisFault) e;
                log.debug("Error occured while trying to process the mail.", af);
            } else {
                af = AxisFault.makeFault(e);
View Full Code Here

                return values[0];
            } else {
                return null;
            }
        } catch (MessagingException e) {
            throw new AxisFault(e);
        }

    }
View Full Code Here

      this.st = st;
        try {
            serverSocket = new ServerSocket(port);
            System.out.println("Server started on port " + port);
        } catch(IOException e) {
            throw new AxisFault(e);
        }
    }
View Full Code Here

                }
            }

            // set the message payload to the message context
            InputStream in;
            ManagedDataSource dataSource;
            if (builder instanceof DataSourceMessageBuilder && entry.isStreaming()) {
                in = null;
                dataSource = ManagedDataSourceFactory.create(
                        new FileObjectDataSource(file, contentType));
            } else {
                in = content.getInputStream();
                dataSource = null;
            }
           
            try {
                OMElement documentElement;
                if (in != null) {
                    documentElement = builder.processDocument(in, contentType, msgContext);
                } else {
                    documentElement = ((DataSourceMessageBuilder)builder).processDocument(
                            dataSource, contentType, msgContext);
                }
                msgContext.setEnvelope(TransportUtils.createSOAPEnvelope(documentElement));
               
                handleIncomingMessage(
                    msgContext,
                    transportHeaders,
                    null, //* SOAP Action - not applicable *//
                    contentType
                );
            }
            finally {
                if (in != null) {
                    try {
                        in.close();
                    } catch (IOException ex) {
                        handleException("Error closing stream", ex);
                    }
                } else {
                    dataSource.destroy();
                }
            }

            if (log.isDebugEnabled()) {
                log.debug("Processed file : " + file + " of Content-type : " + contentType);
View Full Code Here

TOP

Related Classes of org.apache.axis2.engine.AxisFault

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.