|
@@ -0,0 +1,29 @@
|
|
|
|
|
+package com.psi.gabontel.mobileapp.thirdparty.helper;
|
|
|
|
|
+
|
|
|
|
|
+import java.util.Arrays;
|
|
|
|
|
+import java.util.Hashtable;
|
|
|
|
|
+
|
|
|
|
|
+import javax.naming.Context;
|
|
|
|
|
+import javax.naming.InitialContext;
|
|
|
|
|
+
|
|
|
|
|
+import com.psi.ussd.interfaces.UssdReceiverFunction;
|
|
|
|
|
+
|
|
|
|
|
+public class Test {
|
|
|
|
|
+
|
|
|
|
|
+ public static void main(String[] args) {
|
|
|
|
|
+// final Hashtable<String, String> jndiProperties = new Hashtable<>();
|
|
|
|
|
+// //jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
|
|
|
|
|
+// jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.wildfly.naming.client.WildFlyInitialContextFactory");
|
|
|
|
|
+// jndiProperties.put(Context.PROVIDER_URL, "http://localhost:8280/wildfly-services");
|
|
|
|
|
+// String jndi = "java:jboss/exported/Test_110_GabonTelUssdMfsInfo/GetMfsTypeBean!com.psi.ussd.interfaces.UssdReceiverFunction";
|
|
|
|
|
+// try {
|
|
|
|
|
+// final Context context = new InitialContext(jndiProperties);
|
|
|
|
|
+// UssdReceiverFunction reference = (UssdReceiverFunction) context.lookup(jndi.replace("java:jboss/exported", "ejb:") );
|
|
|
|
|
+// System.out.println(reference.requestFunc(Arrays.asList("moov","241060000")));
|
|
|
|
|
+// } catch (Exception e) {
|
|
|
|
|
+// e.printStackTrace();
|
|
|
|
|
+// }
|
|
|
|
|
+ System.exit(0);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|