Commit 43fcd76a authored by Quxl's avatar Quxl

x

parent 4c77ea8e
...@@ -15,10 +15,13 @@ import org.apache.ws.security.WSConstants; ...@@ -15,10 +15,13 @@ import org.apache.ws.security.WSConstants;
import org.apache.ws.security.handler.WSHandlerConstants; import org.apache.ws.security.handler.WSHandlerConstants;
import org.apache.wss4j.common.ext.WSPasswordCallback; import org.apache.wss4j.common.ext.WSPasswordCallback;
import com.egolm.sso.services.material_master.MaterialMasterService;
import com.egolm.sso.services.material_master.Z_MT_SD_001_MATERIAL_MASTER;
public class ServiceFactory { public class ServiceFactory {
private static final String username = "test"; static String username = "test";
private static final String password = "78258c537d6e4d5fb210a57d05619fb6"; static String password = "78258c537d6e4d5fb210a57d05619fb6";
public static <T> T create(String wsdlLocation, String namespace, String serviceName, Class<T> requiredType) throws Exception { public static <T> T create(String wsdlLocation, String namespace, String serviceName, Class<T> requiredType) throws Exception {
Map<String, Object> pro = new HashMap<String, Object>(); Map<String, Object> pro = new HashMap<String, Object>();
...@@ -41,4 +44,14 @@ public class ServiceFactory { ...@@ -41,4 +44,14 @@ public class ServiceFactory {
return service; return service;
} }
public static void main(String[] args) throws Exception {
String wsdlLocation = "http://localhost:8080/sso/services/material_master?wsdl";
String namespace = "http://material_master.sso.egolm.com";
String serviceName = "MaterialMasterService";
MaterialMasterService service = create(wsdlLocation, namespace, serviceName, MaterialMasterService.class);
String XML = StringUtil.readText("D:/data/sso/001.XML");
Z_MT_SD_001_MATERIAL_MASTER Z_MT_SD_001_MATERIAL_MASTER = XMLUtil.toBeanByJxab(XML, Z_MT_SD_001_MATERIAL_MASTER.class);
service.execute(Z_MT_SD_001_MATERIAL_MASTER);
}
} }
package test;
import com.egolm.sso.services.dn_deletion.DNDeletionService;
import com.egolm.sso.services.dn_deletion.Z_MT_SD_010_SO_DN_DELETION;
import com.egolm.sso.util.ServiceFactory;
import com.egolm.sso.util.StringUtil;
import com.egolm.sso.util.XMLUtil;
public class DeletionServiceTest {
public static void main(String[] args) throws Exception {
String wsdlLocation = "http://localhost:8080/sso/services/dn_deletion?wsdl";
String namespace = "http://dn_deletion.sso.egolm.com";
String serviceName = "DNDeletionService";
DNDeletionService service = ServiceFactory.create(wsdlLocation, namespace, serviceName, DNDeletionService.class);
String XML = StringUtil.readText("D:/data/sso/002.XML");
Z_MT_SD_010_SO_DN_DELETION Z_MT_SD_010_SO_DN_DELETION = XMLUtil.toBeanByJxab(XML, Z_MT_SD_010_SO_DN_DELETION.class);
service.execute(Z_MT_SD_010_SO_DN_DELETION);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment