@Transactional(readOnly = true) public class WebService { public void letsThrowAnException() { throw new XFireRuntimeException("test!"); } }
protected void nextEvent(XMLStreamReader dr) { try { dr.next(); } catch (XMLStreamException e) { throw new XFireRuntimeException("Couldn't parse stream.", e); } }
public static Document createDocument() { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder b = factory.newDocumentBuilder(); return b.newDocument(); } catch (ParserConfigurationException e) { throw new XFireRuntimeException("Couldn't find a DOM parser.", e); } } }
@Override public void setTypeClass(Class typeClass) { if (!typeClass.isEnum()) { throw new XFireRuntimeException("Type class must be an enum."); } super.setTypeClass(typeClass); }
public WSDLBuilder createWSDLBuilder(Service service, TransportManager transportManager) { try { return new XmlBeansWSDLBuilder(service, transportManager); } catch (WSDLException e) { throw new XFireRuntimeException("error creating wsdlbuilder", e); } } }
public XMLGregorianCalendarType() { try { dtFactory = DatatypeFactory.newInstance(); } catch (DatatypeConfigurationException e) { throw new XFireRuntimeException("Couldn't load DatatypeFactory.", e); } setTypeClass(XMLGregorianCalendar.class); }
public static String createContentID(String ns) { String uid = UID.generate(); try { URI uri = new URI(ns); return uid + "@" + uri; } catch (URISyntaxException e) { throw new XFireRuntimeException("Could not create URI for namespace: " + ns); } }
private void ensureSoapAttachmentIsRead() { if (soapMessageRead) return; try { soapMessage = readNextAttachment(); soapMessageRead = true; } catch (IOException e) { throw new XFireRuntimeException("Could not read message!", e); } }
public DurationType() { try { dtFactory = DatatypeFactory.newInstance(); } catch (DatatypeConfigurationException e) { throw new XFireRuntimeException("Couldn't load DatatypeFactory.", e); } setTypeClass(Duration.class); }
public WSDLBuilder createWSDLBuilder(Service service, TransportManager transportManager) { try { return new JaxbWSDLBuilder(service, transportManager); } catch (WSDLException e) { throw new XFireRuntimeException("Error creating the WSDLBuilder", e); } } }
public void generateWSDL(final String serviceName, final OutputStream out) { try { final WSDLWriter wsdl = getWSDL(serviceName); wsdl.write(out); } catch (IOException e) { throw new XFireRuntimeException("Couldn't generate WSDL.", e); } }
protected Service findService(final String serviceName) { Service service = getServiceRegistry().getService(serviceName); if (service == null) { throw new XFireRuntimeException("Couldn't find service " + serviceName); } return service; }
public void addNamespace(String prefix, String uri) { Namespace declaredUri = schemaTypes.getNamespace(prefix); if (declaredUri == null) { schemaTypes.addNamespaceDeclaration(Namespace.getNamespace(prefix, uri)); } else if (!declaredUri.getURI().equals(uri)) { throw new XFireRuntimeException("Namespace conflict: " + declaredUri + " was declared but " + uri + " was attempted."); } }
protected void setUse(MessagePartContainer msg, String use) { String current = getSoapBinding().getUse(); if (!useSet) { getSoapBinding().setUse(use); useSet = true; } else { if (!current.equals(use)) throw new XFireRuntimeException("Multiple uses not supported at this time."); } }
public Object[] invoke(String name, Object[] params) throws Exception { OperationInfo op = service.getServiceInfo().getOperation(name); if (op == null) throw new XFireRuntimeException("Could not find operation with name " + name); return invoke(op, params); }
public void write(OutputStream out) throws IOException { try { javax.wsdl.xml.WSDLWriter writer = WSDLFactory.newInstance().newWSDLWriter(); writer.writeWSDL(def, out); } catch (WSDLException e) { throw new XFireRuntimeException("Could not write wsdl definition!", e); } } }
private List getMatches(Object doc, String xpath) { try { XPath path = XPath.newInstance(xpath); path.addNamespace("xsd", SoapConstants.XSD); path.addNamespace("s", SoapConstants.XSD); List result = path.selectNodes(doc); return result; } catch (JDOMException e) { throw new XFireRuntimeException("Error evaluating xpath " + xpath, e); } }
protected void setStyle(String style) { if (getService().getServiceInfo().isWrapped()) style = SoapConstants.STYLE_WRAPPED; String current = getSoapBinding().getStyle(); if (current == null) { getSoapBinding().setStyle(style); } else { if (!current.equals(style)) throw new XFireRuntimeException("Multiple styles not supported at this time."); } }
public Object create(Binding binding, String address) throws MalformedURLException { Transport t = xfire.getTransportManager().getTransport(binding.getBindingId()); if (t == null) { throw new XFireRuntimeException("Could not find transport for binding " + binding.getBindingId()); } Client client = new Client(t, binding, address); return create(client); } }
public Object create(Endpoint endpoint) throws MalformedURLException { Binding binding = endpoint.getBinding(); Transport t = xfire.getTransportManager().getTransport(binding.getBindingId()); if (t == null) { throw new XFireRuntimeException("Could not find transport for binding " + binding.getBindingId()); } return create(new Client(t, endpoint)); }