/** * calls the xml pretty printers * * @param file */ protected void prettifyFile(File file) { XMLPrettyPrinter.prettify(file); }
protected void prettifyFile(File file) { XMLPrettyPrinter.prettify(file); } }
private void writeToFile(OMElement content, File file) throws Exception { File tempFile = File.createTempFile("syn_mx_", ".xml"); OutputStream out = FileUtils.openOutputStream(tempFile); XMLPrettyPrinter.prettify(content, out); out.flush(); out.close(); FileUtils.copyFile(tempFile, file); FileUtils.deleteQuietly(tempFile); }
private void writeToFile(OMElement content, File file) throws Exception { File tempFile = File.createTempFile("syn_mx_", ".xml"); OutputStream out = FileUtils.openOutputStream(tempFile); XMLPrettyPrinter.prettify(content, out); out.flush(); out.close(); FileUtils.copyFile(tempFile, file); FileUtils.deleteQuietly(tempFile); }
public void writeSchema(XmlSchema schema, String schemaFileName) { try { if (schema != null) { //create a output file File outputFile = FileWriter.createClassFile(baseFolder, null, schemaFileName.substring(0, schemaFileName.lastIndexOf( ".")), ".xsd"); FileOutputStream fos = new FileOutputStream(outputFile); //set the options for the schemas schema.write(fos,getDefaultOptionMap()); fos.flush(); fos.close(); XMLPrettyPrinter.prettify(outputFile); } } catch (Exception e) { throw new RuntimeException("Schema writing failed!", e); } }
protected void writeToFile(OMElement content, String fileName) throws Exception { // this is not good, but I couldn't think of a better design :-( SynapseArtifactDeploymentStore deploymentStore = getSynapseConfiguration().getArtifactDeploymentStore(); deploymentStore.addRestoredArtifact(fileName); OutputStream out = FileUtils.openOutputStream(new File(fileName)); XMLPrettyPrinter.prettify(content, out); out.flush(); out.close(); }
protected void writeToFile(OMElement content, String fileName) throws Exception { // this is not good, but I couldn't think of a better design :-( SynapseArtifactDeploymentStore deploymentStore = getSynapseConfiguration().getArtifactDeploymentStore(); deploymentStore.addRestoredArtifact(fileName); OutputStream out = FileUtils.openOutputStream(new File(fileName)); XMLPrettyPrinter.prettify(content, out); out.flush(); out.close(); }
writer.write(dsContents); writer.close(); XMLPrettyPrinter.prettify(new File(dataservicesFile)); } catch (IOException e) { String message = "Error in writing the contract first data service to the repository";
public String readWSDLFromFile(String path) throws Exception { File file=new File(path); XMLPrettyPrinter.prettify(file); //this is used to correct unnecessary formatting in the file return readFile(path); }
private static void invokeTimeService() { String endPointUrl = "xmpp://synapse.demo.0@gmail.com/" + "TimeService"; EndpointReference targetEPR = new EndpointReference(endPointUrl); try { ConfigurationContext ctx = ConfigurationContextFactory.createConfigurationContextFromURIs( XMPPSampleClient.class.getResource("axis2.xml"), null); OMElement payload = getPayload(); Options options = new Options(); options.setProperty(XMPPConstants.XMPP_SERVER_TYPE, XMPPConstants.XMPP_SERVER_TYPE_GOOGLETALK); options.setProperty(XMPPConstants.XMPP_SERVER_URL, XMPPConstants.GOOGLETALK_URL); options.setProperty(XMPPConstants.XMPP_SERVER_USERNAME, "synapse.demo.0"); options.setProperty(XMPPConstants.XMPP_SERVER_PASSWORD, "mailpassword"); options.setTo(targetEPR); options.setAction("urn:getServerTime"); ServiceClient sender = new ServiceClient(ctx,null); sender.setOptions(options); OMElement result = sender.sendReceive(payload); XMLPrettyPrinter.prettify(result, System.out); } catch (Exception e) { e.printStackTrace(); } }
/** * Retrieves the WSDL data associated with the given serviceURL. * @param out The output stream for the WSDL data to be written, NOTE: the stream is not closed after the operation, * it is the responsibility of the caller to close the stream after usage. * @param serviceURL The fist element of this array i.e. serviceURL[0] is taken in retrieving the target service. */ private void getWSDL(OutputStream out, String[] serviceURL) throws AxisFault { // Retrieve WSDL using the same data retrieval path for GetMetadata // request. DataRetrievalRequest request = new DataRetrievalRequest(); request.putDialect(DRConstants.SPEC.DIALECT_TYPE_WSDL); request.putOutputForm(OutputForm.INLINE_FORM); MessageContext context = new MessageContext(); context.setAxisService(this); context.setTo(new EndpointReference(serviceURL[0])); Data[] result = getData(request, context); OMElement wsdlElement; if (result != null && result.length > 0) { wsdlElement = (OMElement) (result[0].getData()); try { XMLPrettyPrinter.prettify(wsdlElement, out); out.flush(); } catch (Exception e) { throw AxisFault.makeFault(e); } } }
/** * Retrieves the WSDL data associated with the given serviceURL. * @param out The output stream for the WSDL data to be written, NOTE: the stream is not closed after the operation, * it is the responsibility of the caller to close the stream after usage. * @param serviceURL The fist element of this array i.e. serviceURL[0] is taken in retrieving the target service. */ private void getWSDL(OutputStream out, String[] serviceURL) throws AxisFault { // Retrieve WSDL using the same data retrieval path for GetMetadata // request. DataRetrievalRequest request = new DataRetrievalRequest(); request.putDialect(DRConstants.SPEC.DIALECT_TYPE_WSDL); request.putOutputForm(OutputForm.INLINE_FORM); MessageContext context = new MessageContext(); context.setAxisService(this); context.setTo(new EndpointReference(serviceURL[0])); Data[] result = getData(request, context); OMElement wsdlElement; if (result != null && result.length > 0) { wsdlElement = (OMElement) (result[0].getData()); try { XMLPrettyPrinter.prettify(wsdlElement, out); out.flush(); } catch (Exception e) { throw AxisFault.makeFault(e); } } }
XMLPrettyPrinter.prettify(wsdlElement, out); out.flush(); } catch (Exception e) {
XMLPrettyPrinter.prettify(wsdlElement, out); out.flush(); } catch (Exception e) {
XMLPrettyPrinter.prettify(wsdlElement, out); out.flush(); } catch (Exception e) {
XMLPrettyPrinter.prettify(wsdlElement, out); out.flush(); } catch (Exception e) {