From 28c9d9bac4df3dfc10467befdc377b60e29d4031 Mon Sep 17 00:00:00 2001
From: wuxw7 <wuxw7@asiainfo.com>
Date: 星期日, 25 十一月 2018 00:28:40 +0800
Subject: [PATCH] 添加api 脚本

---
 java110-common/src/main/java/com/java110/common/util/WebServiceAxisClient.java |   25 ++++++++++++++++---------
 1 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/java110-common/src/main/java/com/java110/common/util/WebServiceAxisClient.java b/java110-common/src/main/java/com/java110/common/util/WebServiceAxisClient.java
index f7b2616..bfc726d 100644
--- a/java110-common/src/main/java/com/java110/common/util/WebServiceAxisClient.java
+++ b/java110-common/src/main/java/com/java110/common/util/WebServiceAxisClient.java
@@ -7,6 +7,8 @@
  * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
  */
 
+import com.java110.common.constant.ResponseConstant;
+import com.java110.common.exception.BusinessException;
 import com.java110.common.log.LoggerEngine;
 import org.apache.axis.client.Call;
 import org.apache.axis.client.Service;
@@ -14,16 +16,21 @@
 
 public class WebServiceAxisClient extends LoggerEngine {
     public static void main(String[] args) {
-        String url = "http://135.192.100.2:9001/QH10000Web/WebTelecom10000";
-        String function = "getBalance";
+        String url = "http://135.192.70.67:9084/serviceAgent/http/FactorageManager_ForAgent?AppKey=2017082401";
+        String function = "queryOrderInfo";
 
-        String areaCode = "0971";
-        String accNbr = "18997240042";
-        String type = "2";
-        Object[] obj = new Object[]{areaCode, accNbr, type};
+        String xml  = "<QueryOrderInfoRequest>\n" +
+                "\t<accNbr>18009706604</accNbr>\n" +
+                "\t<accNbrType>1</accNbrType> \n" +
+                "\t<areaCode>0971</areaCode>\n" +
+                "\t<channelId></channelId>\n" +
+                "\t<staffCode></staffCode> \t\n" +
+                "</QueryOrderInfoRequest>";
 
         try {
-            Object retObj = WebServiceAxisClient.callWebService(url, function, obj);
+            Object retObj = WebServiceAxisClient.callWebService(url, function, new Object[]{xml});
+
+
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -52,7 +59,7 @@
      * @return
      * @throws Exception
      */
-    public static Object callWebService(String url, String function, Object[] obj,Integer timeOut) throws Exception{
+    public static Object callWebService(String url, String function, Object[] obj,Integer timeOut) throws BusinessException {
         Object retObj = null;
         try {
             logger.debug("-----------寮�濮嬭皟鐢╓eb Service-----------");
@@ -73,7 +80,7 @@
             logger.error("-----------璋冪敤Web Service寮傚父,鍘熷洜:{}", e);
             e.printStackTrace();
             retObj = e.getMessage();
-            throw new Exception("WebServiceAxisClient.callWebService throws Exception : " + e.getMessage(), e);
+            throw new BusinessException(ResponseConstant.RESULT_CODE_INNER_ERROR,"WebServiceAxisClient.callWebService throws Exception : " + e.getMessage());
         }
         return retObj;
     }

--
Gitblit v1.8.0