@Override public void restoreSynapseArtifact(String artifactName) { if (log.isDebugEnabled()) { log.debug("Restoring the ProxyService with name : " + artifactName + " : Started"); } try { ProxyService proxy = getSynapseConfiguration().getProxyService(artifactName); OMElement proxyElem = ProxyServiceSerializer.serializeProxy(null, proxy); if (proxy.getFileName() != null) { String fileName = getServerConfigurationInformation().getSynapseXMLLocation() + File.separator + MultiXMLConfigurationBuilder.PROXY_SERVICES_DIR + File.separator + proxy.getFileName(); writeToFile(proxyElem, fileName); if (log.isDebugEnabled()) { log.debug("Restoring the ProxyService with name : " + artifactName + " : Completed"); } log.info("ProxyService named '" + artifactName + "' has been restored"); } else { handleSynapseArtifactDeploymentError("Couldn't restore the ProxyService named '" + artifactName + "', filename cannot be found"); } } catch (Exception e) { handleSynapseArtifactDeploymentError( "Restoring of the ProxyService named '" + artifactName + "' has failed", e); } }
OMElement proxyElem = ProxyServiceSerializer.serializeProxy(null, proxy); if (proxy.getFileName() != null) { String fileName = getServerConfigurationInformation().getSynapseXMLLocation()
while (itr.hasNext()) { ProxyService service = (ProxyService) itr.next(); ProxyServiceSerializer.serializeProxy(definitions, service);
public OMElement serializeProxy(ProxyService service, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { File proxyDir = createDirectory(currentDirectory, MultiXMLConfigurationBuilder.PROXY_SERVICES_DIR); OMElement proxyElem = ProxyServiceSerializer.serializeProxy(null, service); String fileName = service.getFileName(); if (fileName != null) { if (currentDirectory == rootDirectory) { handleDeployment(proxyDir, fileName, service.getName(), synapseConfig.getArtifactDeploymentStore()); } File proxyFile = new File(proxyDir, fileName); writeToFile(proxyElem, proxyFile); } else if (parent != null) { parent.addChild(proxyElem); } return proxyElem; }
public OMElement serializeProxy(ProxyService service, SynapseConfiguration synapseConfig, OMElement parent) throws Exception { File proxyDir = createDirectory(currentDirectory, MultiXMLConfigurationBuilder.PROXY_SERVICES_DIR); OMElement proxyElem = ProxyServiceSerializer.serializeProxy(null, service); String fileName = service.getFileName(); if (fileName != null) { if (currentDirectory == rootDirectory) { handleDeployment(proxyDir, fileName, service.getName(), synapseConfig.getArtifactDeploymentStore()); } File proxyFile = new File(proxyDir, fileName); writeToFile(proxyElem, proxyFile); } else if (parent != null) { parent.addChild(proxyElem); } return proxyElem; }
public void testProxyServiceSerializationSenarioTwo() throws Exception { String inputXml = "<proxy xmlns=\"http://ws.apache.org/ns/synapse\" startOnLoad=\"true\" " + "name=\"name\" transports=\"http\"><description>description</description>" + "<target endpoint=\"epr\" outSequence=\"out\"/><publishWSDL key=\"key\">" + "</publishWSDL><policy key=\"key\"/><parameter name=\"para\">text</parameter></proxy>"; OMElement inputOM = createOMElement(inputXml); ProxyService proxy = ProxyServiceFactory.createProxy(inputOM, new Properties()); OMElement resultOM = ProxyServiceSerializer.serializeProxy(null, proxy); assertTrue(compare(resultOM, inputOM)); }
public void testProxyServiceSerializationSenarioFive() throws Exception { String inputXml = "<proxy xmlns=\"http://ws.apache.org/ns/synapse\" startOnLoad=\"true\" " + "name=\"name\" transports=\"http\"><description>description</description><target>" + "<endpoint><address uri=\"http://www.example.com/testepr\"/></endpoint><outSequence><send/>" + "</outSequence></target><publishWSDL uri=\"http://uri\"></publishWSDL><policy key=\"key\"/>" + "<parameter name=\"para\">text</parameter></proxy>"; OMElement inputOM = createOMElement(inputXml); ProxyService proxy = ProxyServiceFactory.createProxy(inputOM, new Properties()); OMElement resultOM = ProxyServiceSerializer.serializeProxy(null, proxy); assertTrue(compare(resultOM, inputOM)); }
public void testProxyServiceSerializationSenarioFour() throws Exception { String inputXml = "<proxy xmlns=\"http://ws.apache.org/ns/synapse\" " + "name=\"name\" startOnLoad=\"true\" transports=\"http\"><description>" + "description</description><target><inSequence onError=\"ref\"><send/></inSequence>" + "<outSequence><send/></outSequence></target><enableAddressing/><publishWSDL key=\"key\"></publishWSDL>" + "<policy key=\"key\"/><parameter name=\"para\">text</parameter></proxy>"; OMElement inputOM = createOMElement(inputXml); ProxyService proxy = ProxyServiceFactory.createProxy(inputOM, new Properties()); OMElement resultOM = ProxyServiceSerializer.serializeProxy(null, proxy); assertTrue(compare(resultOM, inputOM)); }
public void testProxyServiceSerializationSenarioOne() throws Exception { String inputXml = "<proxy xmlns=\"http://ws.apache.org/ns/synapse\" name=\"name\" " + "startOnLoad=\"true\" transports=\"http\"><description>description</description>" + "<target inSequence=\"inseqname\" outSequence=\"outseqname\" faultSequence=\"faultseqname\" />" + "<publishWSDL uri=\"http://uri\" ></publishWSDL><policy key=\"key\"/>" + "<parameter name=\"para\">text</parameter></proxy>"; OMElement inputOM = createOMElement(inputXml); ProxyService proxy = ProxyServiceFactory.createProxy(inputOM, new Properties()); OMElement resultOM = ProxyServiceSerializer.serializeProxy(null, proxy); assertTrue(compare(resultOM, inputOM)); }
public void testProxyServiceSerializationSenarioThree() throws Exception { String inputXml = "<proxy xmlns=\"http://ws.apache.org/ns/synapse\" " + "name=\"name\" startOnLoad=\"true\" transports=\"http\"><description>" + "description</description><target><inSequence onError=\"ref\"><description>Test documentation</description><send/></inSequence>" + "<outSequence><send/></outSequence></target><publishWSDL key=\"key\"></publishWSDL>" + "<policy key=\"key\"/><parameter name=\"para\">text</parameter></proxy>"; OMElement inputOM = createOMElement(inputXml); ProxyService proxy = ProxyServiceFactory.createProxy(inputOM, new Properties()); OMElement resultOM = ProxyServiceSerializer.serializeProxy(null, proxy); assertTrue(compare(resultOM, inputOM)); }
public void testProxyServiceSerializationScenarioSix() throws Exception { String inputXml = "<proxy xmlns=\"http://ws.apache.org/ns/synapse\" startOnLoad=\"true\" " + "name=\"name\" transports=\"http\"><description>description</description><target>" + "<endpoint><address uri=\"http://www.example.com/testepr\"/></endpoint><outSequence><send/>" + "</outSequence></target><publishWSDL endpoint=\"wsdl_ep\"></publishWSDL><policy key=\"key\"/>" + "<parameter name=\"para\">text</parameter></proxy>"; OMElement inputOM = createOMElement(inputXml); ProxyService proxy = ProxyServiceFactory.createProxy(inputOM, new Properties()); OMElement resultOM = ProxyServiceSerializer.serializeProxy(null, proxy); assertTrue(compare(resultOM, inputOM)); } // public void testProxyServiceSerializationSenarioSix() throws Exception {
while (itr.hasNext()) { ProxyService service = (ProxyService) itr.next(); ProxyServiceSerializer.serializeProxy(definitions, service);
/** * Serialization of 'preserveProxy' attribute in PublishWSDL * * @throws Exception */ public void testProxyServiceSerializationWithPreserveProxy() throws Exception { String inputXml = "<proxy xmlns=\"http://ws.apache.org/ns/synapse\" startOnLoad=\"true\" " + "name=\"name\" transports=\"http\"><description>description</description><target>" + "<endpoint><address uri=\"http://www.example.com/testepr\"/></endpoint><outSequence><send/>" + "</outSequence></target><publishWSDL preservePolicy=\"true\" endpoint=\"wsdl_ep\"></publishWSDL><policy key=\"key\"/>" + "<parameter name=\"para\">text</parameter></proxy>"; OMElement inputOM = createOMElement(inputXml); ProxyService proxy = ProxyServiceFactory.createProxy(inputOM, new Properties()); OMElement resultOM = ProxyServiceSerializer.serializeProxy(null, proxy); assertTrue(compare(resultOM, inputOM)); } }
public void testProxyServiceSerializationWithResourceMap() throws Exception { String inputXml = "<proxy xmlns=\"http://ws.apache.org/ns/synapse\" name=\"name\" " + "startOnLoad=\"true\"><target><endpoint><address uri=\"http://www.example.com/testepr\"/>" + "</endpoint><outSequence><send/></outSequence></target><publishWSDL uri=\"http://uri\">" + "<resource location=\"test1.xsd\" key=\"test-key1\"/><resource location=\"test2.xsd\"" + " key=\"test-key2\"/></publishWSDL></proxy>"; OMElement inputOM = createOMElement(inputXml); ProxyService proxy = ProxyServiceFactory.createProxy(inputOM, new Properties()); assertNotNull(proxy.getResourceMap()); OMElement resultOM = ProxyServiceSerializer.serializeProxy(null, proxy); assertTrue(compare(resultOM, inputOM)); }
ProxyServiceSerializer.serializeProxy(definitions, service);
ProxyServiceSerializer.serializeProxy(definitions, service);