OCT
REM:1.调试获取全部防护对象接口 2.调试添加防护对象接口 3.调试修改防护对象接口 4.调试删除防护对象中某一保护网段接口 5.调试删除防护对象接口
This commit is contained in:
parent
fb0f651e16
commit
8a6eb66f48
|
@ -0,0 +1,64 @@
|
|||
package com.cmcc.hy.phoenix.dptech.wsdl;
|
||||
|
||||
import com.sun.org.apache.xpath.internal.objects.XString;
|
||||
|
||||
/*
|
||||
4.2 添加防护对象
|
||||
*/
|
||||
public class TestaddProtectionObjectForUMC {
|
||||
public static void main(String[] args) {
|
||||
try{
|
||||
org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator basicAuthentication =
|
||||
new org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator();
|
||||
|
||||
basicAuthentication.setUsername("admin");
|
||||
basicAuthentication.setPassword("UMCAdministrator");
|
||||
|
||||
AbnormalFlowCleaningServiceStub stub = new AbnormalFlowCleaningServiceStub();
|
||||
AbnormalFlowCleaningServiceStub.AddProtectionObjectForUMC addPObject = new AbnormalFlowCleaningServiceStub.AddProtectionObjectForUMC();
|
||||
/*
|
||||
输入参数:
|
||||
属性 类型 说明
|
||||
detectionDevices string 检测设备列表。(无检测设备时可填写空串)
|
||||
cleaningDevices string 清洗设备列表。
|
||||
protectionName string 防护对象名称。
|
||||
ipSegment string 防护IP段。(注意:防护对象IP段格式同检测对象稍有不同,请参考下面的格式说明。)
|
||||
ipType int IP类型(V4:0;V6:1)。
|
||||
cleaningType int 清洗类型(Probe自动:3;Probe手动:4;第三方自动:1;第三方手动:2;无检测设备:0)。
|
||||
*/
|
||||
String detectionDevices = "";
|
||||
String cleaningDevices = "10.88.76.41";
|
||||
String protectionName = "test";
|
||||
String ipSegment = "1_192.168.1.5-192.168.1.6";
|
||||
int ipType = 0; //文档标错
|
||||
int cleaningType = 1; //文档标错
|
||||
|
||||
addPObject.setDetectionDevices(detectionDevices);
|
||||
addPObject.setCleaningDevices(cleaningDevices);
|
||||
addPObject.setProtectionName(protectionName);
|
||||
addPObject.setIpSegment(ipSegment);
|
||||
addPObject.setIpType(ipType);
|
||||
addPObject.setCleaningType(cleaningType);
|
||||
|
||||
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE);
|
||||
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, basicAuthentication);
|
||||
|
||||
/*
|
||||
属性 类型 说明
|
||||
resultRetVal int 返回状态码。
|
||||
resultInfo string 请求执行结果描述。
|
||||
执行成功NtcRequestResultInfo类的resultRetVal属性值为0。
|
||||
执行失败NtcRequestResultInfo类的resultRetVal属性值为非0。可获取resultInfo属性值查看失败提示信息。
|
||||
*/
|
||||
AbnormalFlowCleaningServiceStub.AddProtectionObjectForUMCResponse response = stub.addProtectionObjectForUMC(addPObject);
|
||||
System.out.println("resultRetVal:" + response.localOut.getResultRetVal());
|
||||
System.out.println("resultInfo" + response.localOut.getResultInfo());
|
||||
|
||||
}catch (org.apache.axis2.AxisFault ex) {
|
||||
System.out.println(ex.toString());
|
||||
} catch (java.rmi.RemoteException ex2) {
|
||||
System.out.println(ex2.toString());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package com.cmcc.hy.phoenix.dptech.wsdl;
|
||||
|
||||
/*
|
||||
4.5 删除防护对象
|
||||
*/
|
||||
public class TestdeleteProtectionObjectForUMC {
|
||||
public static void main(String[] args) {
|
||||
try{
|
||||
org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator basicAuthentication =
|
||||
new org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator();
|
||||
|
||||
basicAuthentication.setUsername("admin");
|
||||
basicAuthentication.setPassword("UMCAdministrator");
|
||||
|
||||
AbnormalFlowCleaningServiceStub stub = new AbnormalFlowCleaningServiceStub();
|
||||
AbnormalFlowCleaningServiceStub.DeleteProtectionObjectForUMC deletePO = new AbnormalFlowCleaningServiceStub.DeleteProtectionObjectForUMC();
|
||||
/*
|
||||
输入参数:
|
||||
属性 类型 说明
|
||||
protectionName string 防护对象名称。
|
||||
*/
|
||||
String protectionName = "1";
|
||||
|
||||
deletePO.setProtectionName(protectionName);
|
||||
|
||||
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE);
|
||||
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, basicAuthentication);
|
||||
|
||||
/*
|
||||
输出:NtcRequestResultInfo类的属性信息如下:
|
||||
属性 类型 说明
|
||||
resultRetVal int 返回状态码。
|
||||
resultInfo string 请求执行结果描述。
|
||||
*/
|
||||
AbnormalFlowCleaningServiceStub.DeleteProtectionObjectForUMCResponse response = stub.deleteProtectionObjectForUMC(deletePO);
|
||||
System.out.println("resultRetVal:"+response.localOut.getResultRetVal());
|
||||
System.out.println("resultInfo:"+response.localOut.getResultInfo());
|
||||
|
||||
}catch (org.apache.axis2.AxisFault ex) {
|
||||
System.out.println(ex.toString());
|
||||
} catch (java.rmi.RemoteException ex2) {
|
||||
System.out.println(ex2.toString());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package com.cmcc.hy.phoenix.dptech.wsdl;
|
||||
|
||||
/*
|
||||
4.4 删除防护对象中某一保护网段
|
||||
*/
|
||||
public class TestdeleteProtectionObjectIPRangeForUMC {
|
||||
public static void main(String[] args) {
|
||||
try{
|
||||
org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator basicAuthentication =
|
||||
new org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator();
|
||||
|
||||
basicAuthentication.setUsername("admin");
|
||||
basicAuthentication.setPassword("UMCAdministrator");
|
||||
|
||||
AbnormalFlowCleaningServiceStub stub = new AbnormalFlowCleaningServiceStub();
|
||||
AbnormalFlowCleaningServiceStub.DeleteProtectionObjectIPRangeForUMC deletePOIP = new AbnormalFlowCleaningServiceStub.DeleteProtectionObjectIPRangeForUMC();
|
||||
/*
|
||||
输入参数:
|
||||
属性 类型 说明
|
||||
protectionName String 防护对象名称。
|
||||
ipRangeIDs string 保护网段ID列表。
|
||||
*/
|
||||
String protectionName = "test";
|
||||
String ipRangeIDs = "1";
|
||||
|
||||
deletePOIP.setProtectionName(protectionName);
|
||||
deletePOIP.setIpRangeIDs(ipRangeIDs);
|
||||
|
||||
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE);
|
||||
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, basicAuthentication);
|
||||
|
||||
/*
|
||||
输出:NtcRequestResultInfo类的属性信息如下:
|
||||
属性 类型 说明
|
||||
resultRetVal int 返回状态码。
|
||||
resultInfo string 请求执行结果描述。
|
||||
*/
|
||||
AbnormalFlowCleaningServiceStub.DeleteProtectionObjectIPRangeForUMCResponse response = stub.deleteProtectionObjectIPRangeForUMC(deletePOIP);
|
||||
System.out.println("resultRetVal:"+response.localOut.getResultRetVal());
|
||||
System.out.println("resultInfo:"+response.localOut.getResultInfo());
|
||||
|
||||
}catch (org.apache.axis2.AxisFault ex) {
|
||||
System.out.println(ex.toString());
|
||||
} catch (java.rmi.RemoteException ex2) {
|
||||
System.out.println(ex2.toString());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,13 @@
|
|||
package com.cmcc.hy.phoenix.dptech.wsdl;
|
||||
|
||||
public class getAllDetectDevices {
|
||||
/*
|
||||
2.1 获取全部检测设备
|
||||
输入参数 无
|
||||
输出参数 :
|
||||
属性 类型 说明
|
||||
out string UMC全部清洗设备列表(注:以英文逗号间隔)
|
||||
*/
|
||||
public class TestgetAllDetectDevices {
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator basicAuthentication =
|
|
@ -1,6 +1,13 @@
|
|||
package com.cmcc.hy.phoenix.dptech.wsdl;
|
||||
|
||||
public class getAllProtectDevices {
|
||||
/*
|
||||
2.2 获取全部清洗设备
|
||||
输入参数 无
|
||||
输出参数 :
|
||||
属性 类型 说明
|
||||
out string UMC全部检测设备列表(注:以英文逗号间隔)
|
||||
*/
|
||||
public class TestgetAllProtectDevices {
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator basicAuthentication =
|
|
@ -0,0 +1,59 @@
|
|||
package com.cmcc.hy.phoenix.dptech.wsdl;
|
||||
|
||||
import com.sun.org.apache.xpath.internal.objects.XNull;
|
||||
|
||||
/*
|
||||
4.1 获取全部防护对象
|
||||
*/
|
||||
public class TestgetAllProtectionObjectFromUMC {
|
||||
public static void main(String[] args) {
|
||||
try{
|
||||
org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator basicAuthentication =
|
||||
new org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator();
|
||||
|
||||
basicAuthentication.setUsername("admin");
|
||||
basicAuthentication.setPassword("UMCAdministrator");
|
||||
|
||||
AbnormalFlowCleaningServiceStub stub = new AbnormalFlowCleaningServiceStub();
|
||||
/*
|
||||
输入参数:无
|
||||
*/
|
||||
AbnormalFlowCleaningServiceStub.GetAllProtectionObjectFromUMC getPObject = new AbnormalFlowCleaningServiceStub.GetAllProtectionObjectFromUMC();
|
||||
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE);
|
||||
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, basicAuthentication);
|
||||
|
||||
/*
|
||||
输出:数组ArrayOfProtectionObjectDataForService 函数返回值。该类为防护对象的数组。
|
||||
ArrayOfProtectionObjectDataForService类为ProtectionObjectDataForService类的数组。
|
||||
ProtectionObjectDataForService类的属性信息如下:
|
||||
属性 类型 说明
|
||||
detectionDevices string 检测设备列表。(无检测设备时为空串)
|
||||
cleaningDevices string 清洗设备列表。
|
||||
protectionName string 防护对象名称。
|
||||
ipSegment string 防护IP段。(注意:防护对象IP段格式同检测对象稍有不同,请参考下面的格式说明。)
|
||||
ipType string IP类型(V4:0;V6:1)。
|
||||
cleaningType string 清洗类型(Probe自动:3;Probe手动:4;第三方自动:1;第三方手动:2;无检测设备:0)。
|
||||
*/
|
||||
AbnormalFlowCleaningServiceStub.GetAllProtectionObjectFromUMCResponse response = stub.getAllProtectionObjectFromUMC(getPObject);
|
||||
try {
|
||||
for (AbnormalFlowCleaningServiceStub.ProtectionObjectDataForService v : response.localOut.getProtectionObjectDataForService()) {
|
||||
System.out.println("detectionDevices:" + v.getDetectionDevices());
|
||||
System.out.println("cleaningDevices:" + v.getCleaningDevices());
|
||||
System.out.println("protectionName:" + v.getProtectionName());
|
||||
System.out.println("ipSegment:" + v.getIpSegment());
|
||||
System.out.println("ipType:" + v.getIpType());
|
||||
System.out.println("cleaningType:" + v.getCleaningType());
|
||||
}
|
||||
} catch (NullPointerException ex) {
|
||||
System.out.println(ex.toString());
|
||||
}
|
||||
|
||||
|
||||
}catch (org.apache.axis2.AxisFault ex) {
|
||||
System.out.println(ex.toString());
|
||||
} catch (java.rmi.RemoteException ex2) {
|
||||
System.out.println(ex2.toString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package com.cmcc.hy.phoenix.dptech.wsdl;
|
||||
|
||||
import com.sun.org.apache.xpath.internal.objects.XString;
|
||||
|
||||
/*
|
||||
4.3 修改防护对象
|
||||
*/
|
||||
public class TestmodifyProtectionObjectForUMC {
|
||||
public static void main(String[] args) {
|
||||
try{
|
||||
org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator basicAuthentication =
|
||||
new org.apache.axis2.transport.http.impl.httpclient4.HttpTransportPropertiesImpl.Authenticator();
|
||||
|
||||
basicAuthentication.setUsername("admin");
|
||||
basicAuthentication.setPassword("UMCAdministrator");
|
||||
|
||||
AbnormalFlowCleaningServiceStub stub = new AbnormalFlowCleaningServiceStub();
|
||||
AbnormalFlowCleaningServiceStub.ModifyProtectionObjectForUMC modifyDO = new AbnormalFlowCleaningServiceStub.ModifyProtectionObjectForUMC();
|
||||
/*
|
||||
输入参数:
|
||||
属性 类型 说明
|
||||
protectionName string 防护对象名称。
|
||||
ipSegment string 防护IP段。(注意:防护对象IP段格式同检测对象稍有不同,请参考下面的格式说明。)
|
||||
ipType string IP类型(V4:0;V6:1)。
|
||||
cleaningType int 清洗类型(Probe自动:3;Probe手动:4;第三方自动:1;第三方手动:2;无检测设备:0)。 //文档类型错误
|
||||
*/
|
||||
String protectionName = "test";
|
||||
String ipSegment = "1_192.168.1.7-192.168.1.8";
|
||||
int ipType = 0; //文档错误
|
||||
int cleaningType = 0; //文档错误
|
||||
|
||||
modifyDO.setProtectionName(protectionName);
|
||||
modifyDO.setIpSegment(ipSegment);
|
||||
modifyDO.setIpType(ipType);
|
||||
modifyDO.setCleaningType(cleaningType);
|
||||
|
||||
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE);
|
||||
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, basicAuthentication);
|
||||
|
||||
/*
|
||||
输出:NtcRequestResultInfo类的属性信息如下:
|
||||
属性 类型 说明
|
||||
resultRetVal int 返回状态码。
|
||||
resultInfo string 请求执行结果描述。
|
||||
*/
|
||||
AbnormalFlowCleaningServiceStub.ModifyProtectionObjectForUMCResponse response = stub.modifyProtectionObjectForUMC(modifyDO);
|
||||
System.out.println("resultRetVal:"+response.localOut.getResultRetVal());
|
||||
System.out.println("resultInfo:"+response.localOut.getResultInfo());
|
||||
|
||||
}catch (org.apache.axis2.AxisFault ex) {
|
||||
System.out.println(ex.toString());
|
||||
} catch (java.rmi.RemoteException ex2) {
|
||||
System.out.println(ex2.toString());
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue