diff options
author | 10090474 <yuan.hu1@zte.com.cn> | 2017-01-22 16:06:27 +0800 |
---|---|---|
committer | 10090474 <yuan.hu1@zte.com.cn> | 2017-01-22 16:13:11 +0800 |
commit | 2fc88d416c3207c382b9b35f847a25c1114cbdd5 (patch) | |
tree | f50c8d0b419997bab319bb0d12746d90760495de /wso2bpel-ext/wso2bpel-core/BPEL4RESTLight/src/main/java/de/unistuttgart/iaas/bpel/extensions/bpel4restlight/EPRDemoOperation.java | |
parent | b9d6eed278f02c75865fa97f4ba6020e348f2e93 (diff) |
Merger the code provide by lvbo chenbo.
Change-Id: I6b4b0402dea075e8d4d4629dfef3fe16d7930901
Issue-id: OCS-198
Signed-off-by: 10090474 <yuan.hu1@zte.com.cn>
Diffstat (limited to 'wso2bpel-ext/wso2bpel-core/BPEL4RESTLight/src/main/java/de/unistuttgart/iaas/bpel/extensions/bpel4restlight/EPRDemoOperation.java')
-rw-r--r-- | wso2bpel-ext/wso2bpel-core/BPEL4RESTLight/src/main/java/de/unistuttgart/iaas/bpel/extensions/bpel4restlight/EPRDemoOperation.java | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/wso2bpel-ext/wso2bpel-core/BPEL4RESTLight/src/main/java/de/unistuttgart/iaas/bpel/extensions/bpel4restlight/EPRDemoOperation.java b/wso2bpel-ext/wso2bpel-core/BPEL4RESTLight/src/main/java/de/unistuttgart/iaas/bpel/extensions/bpel4restlight/EPRDemoOperation.java new file mode 100644 index 0000000..fd7b4b3 --- /dev/null +++ b/wso2bpel-ext/wso2bpel-core/BPEL4RESTLight/src/main/java/de/unistuttgart/iaas/bpel/extensions/bpel4restlight/EPRDemoOperation.java @@ -0,0 +1,74 @@ +/** + * + * Copyright 2011 IAAS University of Stuttgart <br> + * <br> + * + * THIS CLASS IS USED FOR TEST PURPOSES! + * + * @author uwe.breitenbuecher@iaas.uni-stuttgart.de + * + */ +package de.unistuttgart.iaas.bpel.extensions.bpel4restlight; + +import java.net.HttpURLConnection; +import java.net.URL; + +import org.apache.ode.bpel.common.FaultException; +import org.apache.ode.bpel.o.OPartnerLink; +import org.apache.ode.bpel.runtime.PartnerLinkInstance; +import org.apache.ode.bpel.runtime.extension.AbstractSyncExtensionOperation; +import org.apache.ode.bpel.runtime.extension.ExtensionContext; +import org.w3c.dom.Element; + +import de.unistuttgart.iaas.xml.DomXmlConverter; + + +public class EPRDemoOperation extends AbstractSyncExtensionOperation { + + /** {@inheritDoc} */ + @Override + protected void runSync(ExtensionContext context, Element element) throws FaultException { + System.out.println("bin hier"); + try { + for (OPartnerLink l : context.getInternalInstance().getProcessModel().allPartnerLinks) { + + PartnerLinkInstance pli = context.getPartnerLinkInstance(l); + + Element epr = context.getInternalInstance().fetchPartnerRoleEndpointReferenceData(pli); + System.out.println("EPR|||"); + System.out.println(DomXmlConverter.nodeToString(epr, null)); + + System.out.println(epr.getChildNodes().item(0).getChildNodes().item(1).getNodeName()); + System.out.println(epr.getChildNodes().item(0).getChildNodes().item(1).getTextContent()); + System.out.println(".."); + System.out.println(epr.getChildNodes().item(0).getChildNodes().item(1).getChildNodes().item(0).getTextContent()); + + epr.getChildNodes().item(0).getChildNodes().item(1).getChildNodes().item(0).setTextContent("http://localhost:8084/FRP/rrr"); + + System.out.println(epr.getChildNodes().item(0).getChildNodes().item(1).getChildNodes().item(0).getTextContent()); + + System.out.println(context.getDUDir().toString()); + + } + + } catch (Exception e) { + e.printStackTrace(); + } + + System.out.println("ich bin hiiiiiiiiiier!!"); + + try { + URL url = new URL("http://localhost:8084/FRP/rrr"); + + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod("PUT"); + + int responseCode = connection.getResponseCode(); + System.out.println(responseCode); + + } catch (Exception e) { + e.printStackTrace(); + } + } + +} |