Commit 67cf34f1 authored by Quxl's avatar Quxl

x

parent a57cec34
package com.egolm.sso.clients; package com.egolm.sso.clients;
import java.io.File;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.util.HashMap; import java.util.HashMap;
...@@ -18,7 +17,6 @@ import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor; ...@@ -18,7 +17,6 @@ import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
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 org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.system.ApplicationHome;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import com.egolm.sso.config.XRException; import com.egolm.sso.config.XRException;
...@@ -39,7 +37,7 @@ public class SAPServiceFactory { ...@@ -39,7 +37,7 @@ public class SAPServiceFactory {
assert wsdlLocation != null : "WebService wsdlLocation cannot be null"; assert wsdlLocation != null : "WebService wsdlLocation cannot be null";
assert serviceQName != null : "WebService serviceQName cannot be null"; assert serviceQName != null : "WebService serviceQName cannot be null";
try { try {
URL WSDL_URL = new URL(this.getAbsolutePath(wsdlLocation)); URL WSDL_URL = new URL("file:" + wsdlLocation);
Service dyService = Service.create(WSDL_URL, serviceQName); Service dyService = Service.create(WSDL_URL, serviceQName);
T service = dyService.getPort(requiredType); T service = dyService.getPort(requiredType);
ClientProxy.getClient(service).getOutInterceptors().add(getWSS4JOutInterceptor()); ClientProxy.getClient(service).getOutInterceptors().add(getWSS4JOutInterceptor());
...@@ -49,17 +47,16 @@ public class SAPServiceFactory { ...@@ -49,17 +47,16 @@ public class SAPServiceFactory {
} }
} }
private static String absolutePath = null; // private static String absolutePath = null;
// private String getAbsolutePath(String WSDLPATH) {
private String getAbsolutePath(String WSDLPATH) { // if (absolutePath == null) {
if (absolutePath == null) { // ApplicationHome home = new ApplicationHome(getClass());
ApplicationHome home = new ApplicationHome(getClass()); // File jarFile = home.getSource();
File jarFile = home.getSource(); // File folder = jarFile.getParentFile();
File folder = jarFile.getParentFile(); // absolutePath = folder.getAbsolutePath();
absolutePath = folder.getAbsolutePath(); // }
} // return "file:///" + absolutePath + "/" + WSDLPATH;
return "file:///" + absolutePath + "/" + WSDLPATH; // }
}
private WSS4JOutInterceptor wss4JOutInterceptor = null; private WSS4JOutInterceptor wss4JOutInterceptor = null;
......
...@@ -9,7 +9,7 @@ import javax.xml.bind.annotation.XmlSeeAlso; ...@@ -9,7 +9,7 @@ import javax.xml.bind.annotation.XmlSeeAlso;
/** /**
* This class was generated by Apache CXF 3.2.9 * This class was generated by Apache CXF 3.2.9
* 2019-08-14T11:19:22.231+08:00 * 2019-08-14T15:56:19.723+08:00
* Generated source version: 3.2.9 * Generated source version: 3.2.9
* *
*/ */
......
...@@ -10,12 +10,12 @@ import javax.xml.ws.Service; ...@@ -10,12 +10,12 @@ import javax.xml.ws.Service;
/** /**
* This class was generated by Apache CXF 3.2.9 * This class was generated by Apache CXF 3.2.9
* 2019-08-14T11:19:22.272+08:00 * 2019-08-14T15:56:19.754+08:00
* Generated source version: 3.2.9 * Generated source version: 3.2.9
* *
*/ */
@WebServiceClient(name = "SI_004_INVENTORY_SyncOutService", @WebServiceClient(name = "SI_004_INVENTORY_SyncOutService",
wsdlLocation = "file:SI_004_INVENTORY_SyncOutService.wsdl", wsdlLocation = "file:/D:/eclipse-workspace/egolm.com/default/sap-service/src/main/resources/wsdl/SI_004_INVENTORY_SyncOutServiceV1.wsdl",
targetNamespace = "http://distributors.edi.digital.cn.se.com") targetNamespace = "http://distributors.edi.digital.cn.se.com")
public class SI004INVENTORYSyncOutService extends Service { public class SI004INVENTORYSyncOutService extends Service {
...@@ -27,11 +27,11 @@ public class SI004INVENTORYSyncOutService extends Service { ...@@ -27,11 +27,11 @@ public class SI004INVENTORYSyncOutService extends Service {
static { static {
URL url = null; URL url = null;
try { try {
url = new URL("file:SI_004_INVENTORY_SyncOutService.wsdl"); url = new URL("file:/D:/eclipse-workspace/egolm.com/default/sap-service/src/main/resources/wsdl/SI_004_INVENTORY_SyncOutServiceV1.wsdl");
} catch (MalformedURLException e) { } catch (MalformedURLException e) {
java.util.logging.Logger.getLogger(SI004INVENTORYSyncOutService.class.getName()) java.util.logging.Logger.getLogger(SI004INVENTORYSyncOutService.class.getName())
.log(java.util.logging.Level.INFO, .log(java.util.logging.Level.INFO,
"Can not initialize the default wsdl from {0}", "file:SI_004_INVENTORY_SyncOutService.wsdl"); "Can not initialize the default wsdl from {0}", "file:/D:/eclipse-workspace/egolm.com/default/sap-service/src/main/resources/wsdl/SI_004_INVENTORY_SyncOutServiceV1.wsdl");
} }
WSDL_LOCATION = url; WSDL_LOCATION = url;
} }
......
...@@ -108,7 +108,7 @@ public class SI004INVENTORYSyncOutServiceTask { ...@@ -108,7 +108,7 @@ public class SI004INVENTORYSyncOutServiceTask {
traceNo = headerObject.getString("TRACE_NO"); traceNo = headerObject.getString("TRACE_NO");
Date INVENTORY_DATE = headerObject.getDate("INVENTORY_DATE"); Date INVENTORY_DATE = headerObject.getDate("INVENTORY_DATE");
INVENTORYRECORD_HEADER.setKUNNR(headerObject.getString("DIS_CODE")); INVENTORYRECORD_HEADER.setKUNNR(headerObject.getString("DIS_CODE"));
INVENTORYRECORD_HEADER.setNAME1(headerObject.getString("DIS_NAME")); INVENTORYRECORD_HEADER.setNAME(headerObject.getString("DIS_NAME"));
INVENTORYRECORD_HEADER.setZDATE(DateUtil.formatDate(INVENTORY_DATE, "yyyyMMdd")); INVENTORYRECORD_HEADER.setZDATE(DateUtil.formatDate(INVENTORY_DATE, "yyyyMMdd"));
INVENTORYRECORD_HEADER.setZSPART(headerObject.getString("MPG")); INVENTORYRECORD_HEADER.setZSPART(headerObject.getString("MPG"));
INVENTORYRECORD.setHEADER(INVENTORYRECORD_HEADER); INVENTORYRECORD.setHEADER(INVENTORYRECORD_HEADER);
......
...@@ -41,7 +41,7 @@ import javax.xml.bind.annotation.XmlType; ...@@ -41,7 +41,7 @@ import javax.xml.bind.annotation.XmlType;
* </restriction> * </restriction>
* </simpleType> * </simpleType>
* </element> * </element>
* <element name="NAME1"> * <element name="NAME">
* <simpleType> * <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}string"> * <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <minLength value="35"/> * <minLength value="35"/>
...@@ -270,7 +270,7 @@ public class ZDTSD004INVENTORYSENDING { ...@@ -270,7 +270,7 @@ public class ZDTSD004INVENTORYSENDING {
* </restriction> * </restriction>
* </simpleType> * </simpleType>
* </element> * </element>
* <element name="NAME1"> * <element name="NAME">
* <simpleType> * <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}string"> * <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <minLength value="35"/> * <minLength value="35"/>
...@@ -516,7 +516,7 @@ public class ZDTSD004INVENTORYSENDING { ...@@ -516,7 +516,7 @@ public class ZDTSD004INVENTORYSENDING {
* </restriction> * </restriction>
* </simpleType> * </simpleType>
* </element> * </element>
* <element name="NAME1"> * <element name="NAME">
* <simpleType> * <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}string"> * <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <minLength value="35"/> * <minLength value="35"/>
...@@ -685,7 +685,7 @@ public class ZDTSD004INVENTORYSENDING { ...@@ -685,7 +685,7 @@ public class ZDTSD004INVENTORYSENDING {
* </restriction> * </restriction>
* </simpleType> * </simpleType>
* </element> * </element>
* <element name="NAME1"> * <element name="NAME">
* <simpleType> * <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}string"> * <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <minLength value="35"/> * <minLength value="35"/>
...@@ -717,7 +717,7 @@ public class ZDTSD004INVENTORYSENDING { ...@@ -717,7 +717,7 @@ public class ZDTSD004INVENTORYSENDING {
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = { @XmlType(name = "", propOrder = {
"kunnr", "kunnr",
"name1", "name",
"zspart", "zspart",
"zdate" "zdate"
}) })
...@@ -725,8 +725,8 @@ public class ZDTSD004INVENTORYSENDING { ...@@ -725,8 +725,8 @@ public class ZDTSD004INVENTORYSENDING {
@XmlElement(name = "KUNNR", required = true) @XmlElement(name = "KUNNR", required = true)
protected String kunnr; protected String kunnr;
@XmlElement(name = "NAME1", required = true) @XmlElement(name = "NAME", required = true)
protected String name1; protected String name;
@XmlElement(name = "ZSPART", required = true) @XmlElement(name = "ZSPART", required = true)
protected String zspart; protected String zspart;
@XmlElement(name = "ZDATE", required = true) @XmlElement(name = "ZDATE", required = true)
...@@ -757,27 +757,27 @@ public class ZDTSD004INVENTORYSENDING { ...@@ -757,27 +757,27 @@ public class ZDTSD004INVENTORYSENDING {
} }
/** /**
* 获取name1属性的值。 * 获取name属性的值。
* *
* @return * @return
* possible object is * possible object is
* {@link String } * {@link String }
* *
*/ */
public String getNAME1() { public String getNAME() {
return name1; return name;
} }
/** /**
* 设置name1属性的值。 * 设置name属性的值。
* *
* @param value * @param value
* allowed object is * allowed object is
* {@link String } * {@link String }
* *
*/ */
public void setNAME1(String value) { public void setNAME(String value) {
this.name1 = value; this.name = value;
} }
/** /**
......
This diff is collapsed.
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