public void close() throws XFireException { try { if (is != null) is.close(); } catch (IOException e) { throw new XFireException("Couldn't close stream.", e); } finally { if (urlConn != null) urlConn.disconnect(); } }
throw new XFireException("Couldn't send message.", e); throw new IOException(e.getMessage());
public void writeRequest(OutputStream out) throws IOException { if (CommonsHttpMessageSender.isGzipRequestEnabled(context)) { out = new GZIPOutputStream(out); } try { Attachments atts = message.getAttachments(); if (atts != null) { atts.write(out); } else { HttpChannel.writeWithoutAttachments(context, message, out); } } catch (XFireException e) { log.error("Couldn't send message.", e); throw new IOException(e.getMessage()); } out.close(); }
protected Service getService( XFire xfire, String uri ) throws XFireException { if( null == xfire ) { return null; } int i = uri.indexOf( "//" ); if( i == -1 ) { throw new XFireException( "Malformed service URI" ); } String name = uri.substring( i + 2 ); Service service = xfire.getServiceRegistry().getService( name ); if( null == service ) { logger.info( "Unable to locate '" + name + "' in ServiceRegistry" ); } return service; }
protected Service getService(XFire xfire, String uri) throws XFireException { if (null == xfire) { logger.warn("No XFire instance in context, unable to determine service"); return null; } int i = uri.indexOf("//"); if (i == -1) { throw new XFireException("Malformed service URI"); } String name = uri.substring(i + 2); Service service = xfire.getServiceRegistry().getService(name); if (null == service) { // TODO this should be an exception... logger.warn("Unable to locate '" + name + "' in ServiceRegistry"); } return service; }
public void close() throws XFireException { if (msgIs != null) { try { msgIs.close(); } catch (IOException e) { throw new XFireException("Could not close connection.", e); } } if (source != null) { source.dispose(); } if (postMethod != null) postMethod.releaseConnection(); }
void writeWithoutAttachments(MessageContext context, OutMessage message, OutputStream out) throws XFireException { XMLStreamWriter writer = STAXUtils.createXMLStreamWriter(out, message.getEncoding(), context); message.getSerializer().writeMessage(message, writer, context); try { writer.flush(); } catch (XMLStreamException e) { logger.error(e); throw new XFireException("Couldn't send message.", e); } }
public static void writeWithoutAttachments(MessageContext context, OutMessage message, OutputStream out) throws XFireException { XMLStreamWriter writer = STAXUtils.createXMLStreamWriter(out, message.getEncoding(), context); message.getSerializer().writeMessage(message, writer, context); try { writer.flush(); } catch (XMLStreamException e) { log.error(e); throw new XFireException("Couldn't send message.", e); } }
protected Source getContent(MessageContext context, OutMessage message) throws XMLStreamException, IOException, XFireException { ByteArrayOutputStream outStream = new ByteArrayOutputStream(); XMLStreamWriter writer = getTransformer().getOutputFactory() .createXMLStreamWriter(outStream, message.getEncoding()); MessageSerializer serializer = context.getOutMessage().getSerializer(); if (serializer == null) { AbstractSoapBinding binding = (AbstractSoapBinding) context.getBinding(); if (binding == null) { throw new XFireException("Couldn't find the binding!"); } serializer = AbstractSoapBinding.getSerializer(binding.getStyle(), binding.getUse()); } serializer.writeMessage(message, writer, context); writer.close(); outStream.close(); return new StreamSource(new ByteArrayInputStream(outStream.toByteArray())); }
public void invoke(MessageContext context) throws Exception { AbstractSoapBinding binding = (AbstractSoapBinding) context.getBinding(); if (binding == null) { throw new XFireException("Couldn't find the binding!"); } context.getOutMessage().setSerializer(binding.getSerializer()); } }
public void invoke(MessageContext context) throws Exception { AbstractSoapBinding binding = (AbstractSoapBinding) context.getBinding(); if (binding == null) { throw new XFireException("Couldn't find the binding!"); } context.getOutMessage().setSerializer(binding.getSerializer()); } }
public InputStream createInputStream() throws XFireException { try { // TODO: its really not necessary to cache this... out = new CachedOutputStream(1024*1000, null); XMLStreamWriter writer = STAXUtils.createXMLStreamWriter(out, msg.getEncoding(), context); msg.setProperty(Channel.OUTPUTSTREAM, out); msg.getSerializer().writeMessage(msg, writer, context); writer.flush(); writer.close(); out.close(); return out.getInputStream(); } catch (XMLStreamException e) { throw new XFireException("Couldn't send message.", e); } catch (IOException e) { throw new XFireException("Couldn't send message.", e); } }
throw new XFireException("Configuration file required");
throw new XFireException("Couldn't send message.", e);
throw new XFireException("Couldn't send message.", e);
throw new XFireException("Couldn't create channel.", e); throw new XFireException("Couldn't schedule worker threads. " + e.getMessage(), e);
throw new XFireException("Couldn't send message.", e); throw new XFireException("Failed to Send via MuleUniversalChannel: " + e.getMessage(), e);
throw new XFireException("Could not find wsdl " + wsdl + " with a base URI of " + baseURI + ".");
/** * Validates that the mustUnderstand and role headers are processed correctly. * * @param context * @throws XFireFault */ public void invoke(MessageContext context) throws Exception { MessageSerializer serializer = context.getOutMessage().getSerializer(); if (serializer == null) { AbstractSoapBinding binding = (AbstractSoapBinding) context.getBinding(); if (binding == null) { throw new XFireException("Couldn't find the binding!"); } serializer = AbstractSoapBinding.getSerializer(binding.getStyle(), binding.getUse()); } context.getOutMessage().setSerializer(new SoapSerializer(serializer)); }
throw new XFireException("Couldn't close stream.", e); throw new XFireException( "Couldn't create channel.", e );