From 42bb31a54e3f709678b7252e5f2eb0fafa8634d0 Mon Sep 17 00:00:00 2001 From: mjkhan21 Date: Fri, 28 Mar 2025 14:28:08 +0900 Subject: [PATCH] =?UTF-8?q?SntrisWSBindingStub=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sntris/SntrisWSBindingStub.java | 134 ++++++ .../sntris/buga/BugaWSSoapBindingStub.java | 152 +----- .../fileoffer/SntrFileOfferWSBindingStub.java | 262 ++--------- .../prenotice/SntrPreNoticeWSBindingStub.java | 226 +-------- src/main/wsdl/SntrFileOfferWebService.wsdl | 431 ++++++++++++++++++ src/main/wsdl/SntrPreNoticeWebService.wsdl | 198 ++++++++ 6 files changed, 830 insertions(+), 573 deletions(-) create mode 100644 src/main/java/cokr/xit/interfaces/sntris/SntrisWSBindingStub.java create mode 100644 src/main/wsdl/SntrFileOfferWebService.wsdl create mode 100644 src/main/wsdl/SntrPreNoticeWebService.wsdl diff --git a/src/main/java/cokr/xit/interfaces/sntris/SntrisWSBindingStub.java b/src/main/java/cokr/xit/interfaces/sntris/SntrisWSBindingStub.java new file mode 100644 index 0000000..1f181a5 --- /dev/null +++ b/src/main/java/cokr/xit/interfaces/sntris/SntrisWSBindingStub.java @@ -0,0 +1,134 @@ +package cokr.xit.interfaces.sntris; + +import java.rmi.RemoteException; +import java.util.Enumeration; +import java.util.Vector; + +import javax.xml.namespace.QName; + +import org.apache.axis.AxisEngine; +import org.apache.axis.AxisFault; +import org.apache.axis.NoEndPointException; +import org.apache.axis.client.Call; +import org.apache.axis.client.Service; +import org.apache.axis.client.Stub; +import org.apache.axis.description.OperationDesc; +import org.apache.axis.encoding.DeserializerFactory; +import org.apache.axis.encoding.SerializerFactory; +import org.apache.axis.encoding.ser.BeanDeserializerFactory; +import org.apache.axis.encoding.ser.BeanSerializerFactory; +import org.apache.axis.soap.SOAPConstants; +import org.apache.axis.utils.JavaUtils; + +public abstract class SntrisWSBindingStub extends Stub { + protected Vector cachedSerQNames = new Vector<>(); + protected Vector> cachedSerClasses = new Vector<>(); + protected Vector cachedSerFactories = new Vector<>(); + protected Vector cachedDeserFactories = new Vector<>(); + + protected abstract Descriptor descriptor(); + + protected void init(Service service, Class... klasses) { + if (service == null) { + super.service = new Service(); + } else { + super.service = service; + } + ((Service)super.service).setTypeMappingVersion("1.2"); + + Descriptor desc = descriptor(); + for(Class klass: klasses) { + cachedSerQNames.add(desc.qname(klass.getSimpleName())); + cachedSerClasses.add(klass); + cachedSerFactories.add(BeanSerializerFactory.class); + cachedDeserFactories.add(BeanDeserializerFactory.class); + }; + } + + protected Call createCall() throws RemoteException { + try { + Call _call = super._createCall(); + if (super.maintainSessionSet) { + _call.setMaintainSession(super.maintainSession); + } + if (super.cachedUsername != null) { + _call.setUsername(super.cachedUsername); + } + if (super.cachedPassword != null) { + _call.setPassword(super.cachedPassword); + } + if (super.cachedEndpoint != null) { + _call.setTargetEndpointAddress(super.cachedEndpoint); + } + if (super.cachedTimeout != null) { + _call.setTimeout(super.cachedTimeout); + } + if (super.cachedPortName != null) { + _call.setPortName(super.cachedPortName); + } + Enumeration keys = super.cachedProperties.keys(); + while (keys.hasMoreElements()) { + String key = (String) keys.nextElement(); + _call.setProperty(key, super.cachedProperties.get(key)); + } + // All the type mapping information is registered + // when the first call is made. + // The type mapping information is actually registered in + // the TypeMappingRegistry of the service, which + // is the reason why registration is only needed for the first call. + synchronized (this) { + if (firstCall()) { + // must set encoding style before registering serializers + _call.setEncodingStyle(null); + for (int i = 0; i < cachedSerFactories.size(); ++i) { + Class cls = cachedSerClasses.get(i); + QName qName = cachedSerQNames.get(i); + Object x = cachedSerFactories.get(i); + if (x instanceof Class sf) { + Class df = (Class)cachedDeserFactories.get(i); + _call.registerTypeMapping(cls, qName, sf, df, false); + } + else if (x instanceof SerializerFactory sf) { + DeserializerFactory df = (DeserializerFactory)cachedDeserFactories.get(i); + _call.registerTypeMapping(cls, qName, sf, df, false); + } + } + } + } + return _call; + } catch (Throwable _t) { + throw new AxisFault("Failure trying to get the Call object", _t); + } + } + + protected T execute(OperationDesc oper, String soapActionURI, Object... params) throws RemoteException { + if (super.cachedEndpoint == null) + throw new NoEndPointException(); + + Call _call = createCall(); + _call.setOperation(oper); + _call.setUseSOAPAction(true); + _call.setSOAPActionURI(soapActionURI); + _call.setEncodingStyle(null); + _call.setProperty(Call.SEND_TYPE_ATTR, Boolean.FALSE); + _call.setProperty(AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); + _call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(descriptor().qname(oper.getName())); + + setRequestHeaders(_call); + setAttachments(_call); + + Object _resp = _call.invoke(params); + if (_resp instanceof RemoteException re) + throw re; + + extractAttachments(_call); + Class returnType = oper.getReturnClass(); + + try { + return returnType.cast(_resp); + } catch (Exception _exception) { + return returnType.cast(JavaUtils.convert(_resp, returnType)); + } + } +} \ No newline at end of file diff --git a/src/main/java/cokr/xit/interfaces/sntris/buga/BugaWSSoapBindingStub.java b/src/main/java/cokr/xit/interfaces/sntris/buga/BugaWSSoapBindingStub.java index 62f5d3b..94ae65c 100644 --- a/src/main/java/cokr/xit/interfaces/sntris/buga/BugaWSSoapBindingStub.java +++ b/src/main/java/cokr/xit/interfaces/sntris/buga/BugaWSSoapBindingStub.java @@ -2,50 +2,21 @@ package cokr.xit.interfaces.sntris.buga; import java.net.URL; import java.rmi.RemoteException; -import java.util.Enumeration; -import java.util.List; -import java.util.Vector; -import javax.xml.namespace.QName; - -import org.apache.axis.AxisEngine; import org.apache.axis.AxisFault; -import org.apache.axis.NoEndPointException; -import org.apache.axis.client.Call; import org.apache.axis.client.Service; -import org.apache.axis.client.Stub; import org.apache.axis.description.OperationDesc; import org.apache.axis.description.ParameterDesc; -import org.apache.axis.encoding.DeserializerFactory; -import org.apache.axis.encoding.SerializerFactory; -import org.apache.axis.encoding.ser.BeanDeserializerFactory; -import org.apache.axis.encoding.ser.BeanSerializerFactory; -import org.apache.axis.soap.SOAPConstants; -import org.apache.axis.utils.JavaUtils; import cokr.xit.interfaces.sntris.Descriptor; +import cokr.xit.interfaces.sntris.SntrisWSBindingStub; import cokr.xit.interfaces.sntris.StatusCodeWSDTO; -/** - * @Class Name : BugaWSSoapBindingStub.java - * @Description : 세외수입웹서비스 - * @Version 1.0 - * @Since 2019. 09. 03 - * @Author 박영수 - *
- *   수정일      수정자           수정내용
- *  -------    -------------    ----------------------
- * 
- */ -public class BugaWSSoapBindingStub extends Stub implements BugaWS { - private Vector cachedSerQNames = new Vector<>(); - private Vector> cachedSerClasses = new Vector<>(); - private Vector cachedSerFactories = new Vector<>(); - private Vector cachedDeserFactories = new Vector<>(); +public class BugaWSSoapBindingStub extends SntrisWSBindingStub implements BugaWS { + private static Descriptor descriptor = BugaWebService.descriptor(); private static final OperationDesc[] _operations; static { - Descriptor descriptor = BugaWebService.descriptor(); String name = ""; _operations = new OperationDesc[] { descriptor.operation( @@ -185,138 +156,43 @@ public class BugaWSSoapBindingStub extends Stub implements BugaWS { } public BugaWSSoapBindingStub(Service service) throws AxisFault { - if (service == null) { - super.service = new Service(); - } else { - super.service = service; - } - - ((Service)super.service).setTypeMappingVersion("1.2"); - - Descriptor descriptor = BugaWebService.descriptor(); - List.of( + init( + service, Bu04BugaExtWSDTO.class, Bu04BugaWSDTO.class, Bu04GyuljeInfoDTO.class, Bu04SemokWSDTO.class, Bu04SemokWSRACSDTO.class, Bu04SimpleBugaETCWSDTO.class, Bu04SimpleBugaWSDTO.class, Bu04UserInfoWSDTO.class, StatusCodeWSDTO.class - ).forEach(klass -> { - cachedSerQNames.add(descriptor.qname(klass.getSimpleName())); - cachedSerClasses.add(klass); - cachedSerFactories.add(BeanSerializerFactory.class); - cachedDeserFactories.add(BeanDeserializerFactory.class); - }); + ); } - protected Call createCall() throws RemoteException { - try { - Call _call = super._createCall(); - if (super.maintainSessionSet) { - _call.setMaintainSession(super.maintainSession); - } - if (super.cachedUsername != null) { - _call.setUsername(super.cachedUsername); - } - if (super.cachedPassword != null) { - _call.setPassword(super.cachedPassword); - } - if (super.cachedEndpoint != null) { - _call.setTargetEndpointAddress(super.cachedEndpoint); - } - if (super.cachedTimeout != null) { - _call.setTimeout(super.cachedTimeout); - } - if (super.cachedPortName != null) { - _call.setPortName(super.cachedPortName); - } - Enumeration keys = super.cachedProperties.keys(); - while (keys.hasMoreElements()) { - String key = (String) keys.nextElement(); - _call.setProperty(key, super.cachedProperties.get(key)); - } - // All the type mapping information is registered - // when the first call is made. - // The type mapping information is actually registered in - // the TypeMappingRegistry of the service, which - // is the reason why registration is only needed for the first call. - synchronized (this) { - if (firstCall()) { - // must set encoding style before registering serializers - _call.setEncodingStyle(null); - for (int i = 0; i < cachedSerFactories.size(); ++i) { - Class cls = cachedSerClasses.get(i); - QName qName = cachedSerQNames.get(i); - Object x = cachedSerFactories.get(i); - if (x instanceof Class sf) { - Class df = (Class)cachedDeserFactories.get(i); - _call.registerTypeMapping(cls, qName, sf, df, false); - } - else if (x instanceof SerializerFactory sf) { - DeserializerFactory df = (DeserializerFactory)cachedDeserFactories.get(i); - _call.registerTypeMapping(cls, qName, sf, df, false); - } - } - } - } - return _call; - } catch (Throwable _t) { - throw new AxisFault("Failure trying to get the Call object", _t); - } - } - - private T execute(OperationDesc oper, String soapActionURI, Object[] params) throws RemoteException { - if (super.cachedEndpoint == null) - throw new NoEndPointException(); - - Call _call = createCall(); - _call.setOperation(oper); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(soapActionURI); - _call.setEncodingStyle(null); - _call.setProperty(Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(BugaWebService.descriptor().qname(oper.getName())); - - setRequestHeaders(_call); - setAttachments(_call); - - Object _resp = _call.invoke(params); - if (_resp instanceof RemoteException re) - throw re; - - extractAttachments(_call); - Class returnType = oper.getReturnClass(); - - try { - return returnType.cast(_resp); - } catch (Exception _exception) { - return returnType.cast(JavaUtils.convert(_resp, returnType)); - } + @Override + protected Descriptor descriptor() { + return descriptor; } @Override public Bu04UserInfoWSDTO getUserInfo(String userId) throws RemoteException { - return execute(_operations[0], "", new Object[] {userId}); + return execute(_operations[0], "", userId); } @Override public Bu04SemokWSDTO[] getListSemokInfo(String siguCd, String buseoCd) throws RemoteException { - return execute(_operations[4], "", new Object[] {siguCd, buseoCd}); + return execute(_operations[4], "", siguCd, buseoCd); } @Override public Bu04SemokWSDTO getSemokInfo(String siguCd, String buseoCd, String semokCd) throws RemoteException { - return execute(_operations[3], "BugaSoapAction", new Object[] {siguCd, buseoCd, semokCd}); + return execute(_operations[3], "BugaSoapAction", siguCd, buseoCd, semokCd); } @Override public Bu04SemokWSRACSDTO getSemokInfoRACS(String siguCd, String buseoCd, String semokCd) throws RemoteException { - return execute(_operations[10], "", new Object[] {siguCd, buseoCd, semokCd}); + return execute(_operations[10], "", siguCd, buseoCd, semokCd); } @Override public String getNewTaxNo(String siguCd, String semokCd, String taxYm, String taxGubun) throws RemoteException { - return execute(_operations[2], "BugaSoapAction", new Object[] {siguCd, semokCd, taxYm, taxGubun}); + return execute(_operations[2], "BugaSoapAction", siguCd, semokCd, taxYm, taxGubun); } @Override diff --git a/src/main/java/cokr/xit/interfaces/sntris/fileoffer/SntrFileOfferWSBindingStub.java b/src/main/java/cokr/xit/interfaces/sntris/fileoffer/SntrFileOfferWSBindingStub.java index b2a58a8..0566d73 100644 --- a/src/main/java/cokr/xit/interfaces/sntris/fileoffer/SntrFileOfferWSBindingStub.java +++ b/src/main/java/cokr/xit/interfaces/sntris/fileoffer/SntrFileOfferWSBindingStub.java @@ -2,66 +2,51 @@ package cokr.xit.interfaces.sntris.fileoffer; import java.net.URL; import java.rmi.RemoteException; -import java.util.Enumeration; -import java.util.List; -import java.util.Vector; +import java.util.Map; -import javax.xml.namespace.QName; - -import org.apache.axis.AxisEngine; import org.apache.axis.AxisFault; -import org.apache.axis.NoEndPointException; -import org.apache.axis.client.Call; import org.apache.axis.client.Service; -import org.apache.axis.client.Stub; import org.apache.axis.description.OperationDesc; import org.apache.axis.description.ParameterDesc; -import org.apache.axis.encoding.DeserializerFactory; -import org.apache.axis.encoding.SerializerFactory; -import org.apache.axis.encoding.ser.BeanDeserializerFactory; -import org.apache.axis.encoding.ser.BeanSerializerFactory; -import org.apache.axis.soap.SOAPConstants; -import org.apache.axis.utils.JavaUtils; import cokr.xit.interfaces.sntris.Descriptor; -import cokr.xit.interfaces.sntris.prenotice.SntrPreNoticeWebService; - -public class SntrFileOfferWSBindingStub extends Stub implements SntrFileOfferWS { - private Vector cachedSerQNames = new Vector<>(); - private Vector> cachedSerClasses = new Vector<>(); - private Vector cachedSerFactories = new Vector<>(); - private Vector cachedDeserFactories = new Vector<>(); - - static final OperationDesc [] _operations; +import cokr.xit.interfaces.sntris.SntrisWSBindingStub; +public class SntrFileOfferWSBindingStub extends SntrisWSBindingStub implements SntrFileOfferWS { + private static Descriptor descriptor = SntrFileOfferWebService.descriptor(); + private static final Map operations; static { - Descriptor descriptor = SntrFileOfferWebService.descriptor(); - _operations = new OperationDesc[] { - descriptor.operation( - "webGwaseInfo004", Ye22SunapDTO[].class, descriptor.qname("", "result"), + String name = ""; + operations = Map.of( + name = "webGwaseInfo004", + descriptor.operation( + name, Ye22SunapDTO[].class, descriptor.qname("", "result"), desc -> new ParameterDesc[] { desc.param(desc.qname("", "Ye22InputDTO_1"), Ye22InputDTO.class, true) } ), + name = "webGwaseInfo005", descriptor.operation( - "webGwaseInfo005", Ye22ChenapDTO[].class, descriptor.qname("", "result"), + name, Ye22ChenapDTO[].class, descriptor.qname("", "result"), desc -> new ParameterDesc[] { desc.param(desc.qname("", "Ye22InputDTO_1"), Ye22InputDTO.class, true) } ), + name = "webGwaseInfo006", descriptor.operation( - "webGwaseInfo006", Ye22GwaseInfoDTO[].class, descriptor.qname("", "result"), + name, Ye22GwaseInfoDTO[].class, descriptor.qname("", "result"), desc -> new ParameterDesc[] { desc.param(desc.qname("", "Ye22InputDTO_1"), Ye22InputDTO.class, true) } ), + name = "webGwaseInfo007", descriptor.operation( - "webGwaseInfo007", Ye22NoticeInfoDTO[].class, descriptor.qname("", "result"), + name, Ye22NoticeInfoDTO[].class, descriptor.qname("", "result"), desc -> new ParameterDesc[] { desc.param(desc.qname("", "Ye22InputDTO_1"), Ye22InputDTO.class, true) } ) - }; + ); } public SntrFileOfferWSBindingStub() throws AxisFault { @@ -74,226 +59,35 @@ public class SntrFileOfferWSBindingStub extends Stub implements SntrFileOfferWS } public SntrFileOfferWSBindingStub(Service service) throws AxisFault { - if (service == null) { - super.service = new Service(); - } else { - super.service = service; - } - ((Service)super.service).setTypeMappingVersion("1.2"); - - Descriptor descriptor = SntrPreNoticeWebService.descriptor(); - List.of( + init( + service, Ye22ChenapDTO.class, Ye22GwaseInfoDTO.class, Ye22InputDTO.class, Ye22NoticeInfoDTO.class, Ye22SunapDTO.class - ).forEach(klass -> { - cachedSerQNames.add(descriptor.qname(klass.getSimpleName())); - cachedSerClasses.add(klass); - cachedSerFactories.add(BeanSerializerFactory.class); - cachedDeserFactories.add(BeanDeserializerFactory.class); - }); + ); } - protected Call createCall() throws RemoteException { - try { - Call _call = super._createCall(); - if (super.maintainSessionSet) { - _call.setMaintainSession(super.maintainSession); - } - if (super.cachedUsername != null) { - _call.setUsername(super.cachedUsername); - } - if (super.cachedPassword != null) { - _call.setPassword(super.cachedPassword); - } - if (super.cachedEndpoint != null) { - _call.setTargetEndpointAddress(super.cachedEndpoint); - } - if (super.cachedTimeout != null) { - _call.setTimeout(super.cachedTimeout); - } - if (super.cachedPortName != null) { - _call.setPortName(super.cachedPortName); - } - Enumeration keys = super.cachedProperties.keys(); - while (keys.hasMoreElements()) { - String key = (String) keys.nextElement(); - _call.setProperty(key, super.cachedProperties.get(key)); - } - // All the type mapping information is registered - // when the first call is made. - // The type mapping information is actually registered in - // the TypeMappingRegistry of the service, which - // is the reason why registration is only needed for the first call. - synchronized (this) { - if (firstCall()) { - // must set encoding style before registering serializers - _call.setEncodingStyle(null); - for (int i = 0; i < cachedSerFactories.size(); ++i) { - Class cls = cachedSerClasses.get(i); - QName qName = - cachedSerQNames.get(i); - Object x = cachedSerFactories.get(i); - if (x instanceof Class) { - Class sf = (Class) - cachedSerFactories.get(i); - Class df = (Class) - cachedDeserFactories.get(i); - _call.registerTypeMapping(cls, qName, sf, df, false); - } - else if (x instanceof SerializerFactory) { - SerializerFactory sf = (SerializerFactory) - cachedSerFactories.get(i); - DeserializerFactory df = (DeserializerFactory) - cachedDeserFactories.get(i); - _call.registerTypeMapping(cls, qName, sf, df, false); - } - } - } - } - return _call; - } - catch (Throwable _t) { - throw new AxisFault("Failure trying to get the Call object", _t); - } - } + @Override + protected Descriptor descriptor() { + return descriptor; + } @Override public Ye22SunapDTO[] webGwaseInfo004(Ye22InputDTO ye22InputDTO_1) throws RemoteException { - if (super.cachedEndpoint == null) { - throw new NoEndPointException(); - } - Call _call = createCall(); - _call.setOperation(_operations[0]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new QName("urn:SntrFileOfferWebService", "webGwaseInfo004")); - - setRequestHeaders(_call); - setAttachments(_call); - try { - Object _resp = _call.invoke(new Object[] {ye22InputDTO_1}); - - if (_resp instanceof RemoteException) { - throw (RemoteException)_resp; - } else { - extractAttachments(_call); - try { - return (Ye22SunapDTO[]) _resp; - } catch (Exception _exception) { - return (Ye22SunapDTO[]) JavaUtils.convert(_resp, Ye22SunapDTO[].class); - } - } - } catch (AxisFault axisFaultException) { - throw axisFaultException; - } + return execute(operations.get("webGwaseInfo004"), "", ye22InputDTO_1); } @Override public Ye22ChenapDTO[] webGwaseInfo005(Ye22InputDTO ye22InputDTO_1) throws RemoteException { - if (super.cachedEndpoint == null) { - throw new NoEndPointException(); - } - Call _call = createCall(); - _call.setOperation(_operations[1]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new QName("urn:SntrFileOfferWebService", "webGwaseInfo005")); - - setRequestHeaders(_call); - setAttachments(_call); - try { - Object _resp = _call.invoke(new Object[] {ye22InputDTO_1}); - - if (_resp instanceof RemoteException) { - throw (RemoteException)_resp; - } else { - extractAttachments(_call); - try { - return (Ye22ChenapDTO[]) _resp; - } catch (Exception _exception) { - return (Ye22ChenapDTO[]) JavaUtils.convert(_resp, Ye22ChenapDTO[].class); - } - } - } catch (AxisFault axisFaultException) { - throw axisFaultException; - } + return execute(operations.get("webGwaseInfo005"), "", ye22InputDTO_1); } @Override public Ye22GwaseInfoDTO[] webGwaseInfo006(Ye22InputDTO ye22InputDTO_1) throws RemoteException { - if (super.cachedEndpoint == null) { - throw new NoEndPointException(); - } - Call _call = createCall(); - _call.setOperation(_operations[2]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new QName("urn:SntrFileOfferWebService", "webGwaseInfo006")); - - setRequestHeaders(_call); - setAttachments(_call); - try { - Object _resp = _call.invoke(new Object[] {ye22InputDTO_1}); - - if (_resp instanceof RemoteException) { - throw (RemoteException)_resp; - } else { - extractAttachments(_call); - try { - return (Ye22GwaseInfoDTO[]) _resp; - } catch (Exception _exception) { - return (Ye22GwaseInfoDTO[]) JavaUtils.convert(_resp, Ye22GwaseInfoDTO[].class); - } - } - } catch (AxisFault axisFaultException) { - throw axisFaultException; - } + return execute(operations.get("webGwaseInfo006"), "", ye22InputDTO_1); } @Override public Ye22NoticeInfoDTO[] webGwaseInfo007(Ye22InputDTO ye22InputDTO_1) throws RemoteException { - if (super.cachedEndpoint == null) { - throw new NoEndPointException(); - } - Call _call = createCall(); - _call.setOperation(_operations[3]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI(""); - _call.setEncodingStyle(null); - _call.setProperty(Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new QName("urn:SntrFileOfferWebService", "webGwaseInfo007")); - - setRequestHeaders(_call); - setAttachments(_call); - try { - Object _resp = _call.invoke(new Object[] {ye22InputDTO_1}); - - if (_resp instanceof RemoteException) { - throw (RemoteException)_resp; - } else { - extractAttachments(_call); - try { - return (Ye22NoticeInfoDTO[]) _resp; - } catch (Exception _exception) { - return (Ye22NoticeInfoDTO[]) JavaUtils.convert(_resp, Ye22NoticeInfoDTO[].class); - } - } - } catch (AxisFault axisFaultException) { - throw axisFaultException; - } + return execute(operations.get("webGwaseInfo007"), "", ye22InputDTO_1); } } \ No newline at end of file diff --git a/src/main/java/cokr/xit/interfaces/sntris/prenotice/SntrPreNoticeWSBindingStub.java b/src/main/java/cokr/xit/interfaces/sntris/prenotice/SntrPreNoticeWSBindingStub.java index 4ed245b..ced9e6c 100644 --- a/src/main/java/cokr/xit/interfaces/sntris/prenotice/SntrPreNoticeWSBindingStub.java +++ b/src/main/java/cokr/xit/interfaces/sntris/prenotice/SntrPreNoticeWSBindingStub.java @@ -1,59 +1,45 @@ package cokr.xit.interfaces.sntris.prenotice; import java.rmi.RemoteException; -import java.util.Enumeration; -import java.util.List; -import java.util.Vector; +import java.util.Map; -import javax.xml.namespace.QName; - -import org.apache.axis.AxisEngine; import org.apache.axis.AxisFault; -import org.apache.axis.NoEndPointException; -import org.apache.axis.client.Call; import org.apache.axis.client.Service; -import org.apache.axis.client.Stub; import org.apache.axis.description.OperationDesc; import org.apache.axis.description.ParameterDesc; -import org.apache.axis.encoding.DeserializerFactory; -import org.apache.axis.encoding.SerializerFactory; -import org.apache.axis.encoding.ser.BeanDeserializerFactory; -import org.apache.axis.encoding.ser.BeanSerializerFactory; -import org.apache.axis.soap.SOAPConstants; -import org.apache.axis.utils.JavaUtils; import cokr.xit.interfaces.sntris.Descriptor; +import cokr.xit.interfaces.sntris.SntrisWSBindingStub; import cokr.xit.interfaces.sntris.StatusCodeWSDTO; -public class SntrPreNoticeWSBindingStub extends Stub implements SntrPreNoticeWS { - private Vector cachedSerQNames = new Vector<>(); - private Vector> cachedSerClasses = new Vector<>(); - private Vector cachedSerFactories = new Vector<>(); - private Vector cachedDeserFactories = new Vector<>(); - - static final OperationDesc [] _operations; +public class SntrPreNoticeWSBindingStub extends SntrisWSBindingStub implements SntrPreNoticeWS { + private static Descriptor descriptor = SntrPreNoticeWebService.descriptor(); + private static final Map operations; static { - Descriptor descriptor = SntrPreNoticeWebService.descriptor(); - _operations = new OperationDesc[] { - descriptor.operation( - "webInsertPreNoticeInfo", Bu18WebReturnInfoDTO.class, descriptor.qname("", "result"), + String name = ""; + operations = Map.of( + name = "webInsertPreNoticeInfo", + descriptor.operation( + name, Bu18WebReturnInfoDTO.class, descriptor.qname("", "result"), desc -> new ParameterDesc[] { desc.param(desc.qname("", "Bu18WebPreNoticeDTO_1"), Bu18WebPreNoticeDTO.class, true) } ), + name = "webInsertReturnResultInfo", descriptor.operation( - "webInsertReturnResultInfo", StatusCodeWSDTO.class, descriptor.qname("", "result"), + name, StatusCodeWSDTO.class, descriptor.qname("", "result"), desc -> new ParameterDesc[] { desc.param(desc.qname("", "Bu18WebReturnResultDTO_1"), Bu18WebReturnResultDTO.class, true) } ), + name = "webSMSResultInfo", descriptor.operation( - "webSMSResultInfo", StatusCodeWSDTO.class, descriptor.qname("", "result"), + name, StatusCodeWSDTO.class, descriptor.qname("", "result"), desc -> new ParameterDesc[] { desc.param(desc.qname("", "Bu18WebSMSResultDTO_1"), Bu18WebSMSResultDTO.class, true) } ) - }; + ); } public SntrPreNoticeWSBindingStub() throws AxisFault { @@ -66,192 +52,30 @@ public class SntrPreNoticeWSBindingStub extends Stub implements SntrPreNoticeWS } public SntrPreNoticeWSBindingStub(Service service) throws AxisFault { - if (service == null) { - super.service = new Service(); - } else { - super.service = service; - } - ((Service)super.service).setTypeMappingVersion("1.2"); - - Descriptor descriptor = SntrPreNoticeWebService.descriptor(); - List.of( + init( + service, Bu18WebPreNoticeDTO.class, Bu18WebReturnInfoDTO.class, Bu18WebReturnResultDTO.class, Bu18WebSMSResultDTO.class, StatusCodeWSDTO.class - ).forEach(klass -> { - cachedSerQNames.add(descriptor.qname(klass.getSimpleName())); - cachedSerClasses.add(klass); - cachedSerFactories.add(BeanSerializerFactory.class); - cachedDeserFactories.add(BeanDeserializerFactory.class); - }); + ); } - protected Call createCall() throws RemoteException { - try { - Call _call = super._createCall(); - if (super.maintainSessionSet) { - _call.setMaintainSession(super.maintainSession); - } - if (super.cachedUsername != null) { - _call.setUsername(super.cachedUsername); - } - if (super.cachedPassword != null) { - _call.setPassword(super.cachedPassword); - } - if (super.cachedEndpoint != null) { - _call.setTargetEndpointAddress(super.cachedEndpoint); - } - if (super.cachedTimeout != null) { - _call.setTimeout(super.cachedTimeout); - } - if (super.cachedPortName != null) { - _call.setPortName(super.cachedPortName); - } - Enumeration keys = super.cachedProperties.keys(); - while (keys.hasMoreElements()) { - String key = (String) keys.nextElement(); - _call.setProperty(key, super.cachedProperties.get(key)); - } - // All the type mapping information is registered - // when the first call is made. - // The type mapping information is actually registered in - // the TypeMappingRegistry of the service, which - // is the reason why registration is only needed for the first call. - synchronized (this) { - if (firstCall()) { - // must set encoding style before registering serializers - _call.setEncodingStyle(null); - for (int i = 0; i < cachedSerFactories.size(); ++i) { - Class cls = cachedSerClasses.get(i); - QName qName = - cachedSerQNames.get(i); - Object x = cachedSerFactories.get(i); - if (x instanceof Class) { - Class sf = (Class) - cachedSerFactories.get(i); - Class df = (Class) - cachedDeserFactories.get(i); - _call.registerTypeMapping(cls, qName, sf, df, false); - } - else if (x instanceof SerializerFactory) { - SerializerFactory sf = (SerializerFactory) - cachedSerFactories.get(i); - DeserializerFactory df = (DeserializerFactory) - cachedDeserFactories.get(i); - _call.registerTypeMapping(cls, qName, sf, df, false); - } - } - } - } - return _call; - } - catch (Throwable _t) { - throw new AxisFault("Failure trying to get the Call object", _t); - } - } + @Override + protected Descriptor descriptor() { + return descriptor; + } @Override public Bu18WebReturnInfoDTO webInsertPreNoticeInfo(Bu18WebPreNoticeDTO bu18WebPreNoticeDTO_1) throws RemoteException { - if (super.cachedEndpoint == null) { - throw new NoEndPointException(); - } - Call _call = createCall(); - _call.setOperation(_operations[0]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI("SntrPreNoticeSoapAction"); - _call.setEncodingStyle(null); - _call.setProperty(Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new QName("urn:SntrPreNoticeWebService", "webInsertPreNoticeInfo")); - - setRequestHeaders(_call); - setAttachments(_call); - try { Object _resp = _call.invoke(new Object[] {bu18WebPreNoticeDTO_1}); - - if (_resp instanceof RemoteException) { - throw (RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (Bu18WebReturnInfoDTO) _resp; - } catch (Exception _exception) { - return (Bu18WebReturnInfoDTO) JavaUtils.convert(_resp, Bu18WebReturnInfoDTO.class); - } - } - } catch (AxisFault axisFaultException) { - throw axisFaultException; -} + return execute(operations.get("webInsertPreNoticeInfo"), "SntrPreNoticeSoapAction", bu18WebPreNoticeDTO_1); } @Override public StatusCodeWSDTO webInsertReturnResultInfo(Bu18WebReturnResultDTO bu18WebReturnResultDTO_1) throws RemoteException { - if (super.cachedEndpoint == null) { - throw new NoEndPointException(); - } - Call _call = createCall(); - _call.setOperation(_operations[1]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI("SntrPreNoticeSoapAction"); - _call.setEncodingStyle(null); - _call.setProperty(Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new QName("urn:SntrPreNoticeWebService", "webInsertReturnResultInfo")); - - setRequestHeaders(_call); - setAttachments(_call); - try { Object _resp = _call.invoke(new Object[] {bu18WebReturnResultDTO_1}); - - if (_resp instanceof RemoteException) { - throw (RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (StatusCodeWSDTO) _resp; - } catch (Exception _exception) { - return (StatusCodeWSDTO) JavaUtils.convert(_resp, StatusCodeWSDTO.class); - } - } - } catch (AxisFault axisFaultException) { - throw axisFaultException; -} + return execute(operations.get("webInsertReturnResultInfo"), "SntrPreNoticeSoapAction", bu18WebReturnResultDTO_1); } @Override public StatusCodeWSDTO webSMSResultInfo(Bu18WebSMSResultDTO bu18WebSMSResultDTO_1) throws RemoteException { - if (super.cachedEndpoint == null) { - throw new NoEndPointException(); - } - Call _call = createCall(); - _call.setOperation(_operations[2]); - _call.setUseSOAPAction(true); - _call.setSOAPActionURI("SntrPreNoticeSoapAction"); - _call.setEncodingStyle(null); - _call.setProperty(Call.SEND_TYPE_ATTR, Boolean.FALSE); - _call.setProperty(AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE); - _call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS); - _call.setOperationName(new QName("urn:SntrPreNoticeWebService", "webSMSResultInfo")); - - setRequestHeaders(_call); - setAttachments(_call); - try { Object _resp = _call.invoke(new Object[] {bu18WebSMSResultDTO_1}); - - if (_resp instanceof RemoteException) { - throw (RemoteException)_resp; - } - else { - extractAttachments(_call); - try { - return (StatusCodeWSDTO) _resp; - } catch (Exception _exception) { - return (StatusCodeWSDTO) JavaUtils.convert(_resp, StatusCodeWSDTO.class); - } - } - } catch (AxisFault axisFaultException) { - throw axisFaultException; -} + return execute(operations.get("webSMSResultInfo"), "SntrPreNoticeSoapAction", bu18WebSMSResultDTO_1); } - } \ No newline at end of file diff --git a/src/main/wsdl/SntrFileOfferWebService.wsdl b/src/main/wsdl/SntrFileOfferWebService.wsdl new file mode 100644 index 0000000..d175669 --- /dev/null +++ b/src/main/wsdl/SntrFileOfferWebService.wsdl @@ -0,0 +1,431 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/wsdl/SntrPreNoticeWebService.wsdl b/src/main/wsdl/SntrPreNoticeWebService.wsdl new file mode 100644 index 0000000..8bd69b7 --- /dev/null +++ b/src/main/wsdl/SntrPreNoticeWebService.wsdl @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file