Commit bb37ae76 authored by Quxl's avatar Quxl

x

parent dbe0cd36
......@@ -9,6 +9,7 @@ import javax.security.auth.callback.CallbackHandler;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import org.apache.cxf.endpoint.Client;
import org.apache.cxf.frontend.ClientProxy;
import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
import org.apache.ws.security.WSConstants;
......@@ -40,18 +41,18 @@ public class ServiceFactory {
QName qName = new QName(namespace, serviceName);
Service dyService = Service.create(WSDL_URL, qName);
T service = dyService.getPort(requiredType);
ClientProxy.getClient(service).getOutInterceptors().add(new WSS4JOutInterceptor(pro));
Client client = ClientProxy.getClient(service);
client.getOutInterceptors().add(new WSS4JOutInterceptor(pro));
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);
Z_MT_SD_001_MATERIAL_MASTER bean = XMLUtil.toBeanByJxab(XML, Z_MT_SD_001_MATERIAL_MASTER.class);
service.execute(bean);
}
}
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