Commit 67cf34f1 authored by Quxl's avatar Quxl

x

parent a57cec34
package com.egolm.sso.clients;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
......@@ -18,7 +17,6 @@ import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
import org.apache.ws.security.handler.WSHandlerConstants;
import org.apache.wss4j.common.ext.WSPasswordCallback;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.system.ApplicationHome;
import org.springframework.stereotype.Component;
import com.egolm.sso.config.XRException;
......@@ -39,7 +37,7 @@ public class SAPServiceFactory {
assert wsdlLocation != null : "WebService wsdlLocation cannot be null";
assert serviceQName != null : "WebService serviceQName cannot be null";
try {
URL WSDL_URL = new URL(this.getAbsolutePath(wsdlLocation));
URL WSDL_URL = new URL("file:" + wsdlLocation);
Service dyService = Service.create(WSDL_URL, serviceQName);
T service = dyService.getPort(requiredType);
ClientProxy.getClient(service).getOutInterceptors().add(getWSS4JOutInterceptor());
......@@ -49,17 +47,16 @@ public class SAPServiceFactory {
}
}
private static String absolutePath = null;
private String getAbsolutePath(String WSDLPATH) {
if (absolutePath == null) {
ApplicationHome home = new ApplicationHome(getClass());
File jarFile = home.getSource();
File folder = jarFile.getParentFile();
absolutePath = folder.getAbsolutePath();
}
return "file:///" + absolutePath + "/" + WSDLPATH;
}
// private static String absolutePath = null;
// private String getAbsolutePath(String WSDLPATH) {
// if (absolutePath == null) {
// ApplicationHome home = new ApplicationHome(getClass());
// File jarFile = home.getSource();
// File folder = jarFile.getParentFile();
// absolutePath = folder.getAbsolutePath();
// }
// return "file:///" + absolutePath + "/" + WSDLPATH;
// }
private WSS4JOutInterceptor wss4JOutInterceptor = null;
......
......@@ -9,7 +9,7 @@ import javax.xml.bind.annotation.XmlSeeAlso;
/**
* 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
*
*/
......
......@@ -10,12 +10,12 @@ import javax.xml.ws.Service;
/**
* 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
*
*/
@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")
public class SI004INVENTORYSyncOutService extends Service {
......@@ -27,11 +27,11 @@ public class SI004INVENTORYSyncOutService extends Service {
static {
URL url = null;
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) {
java.util.logging.Logger.getLogger(SI004INVENTORYSyncOutService.class.getName())
.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;
}
......
......@@ -108,7 +108,7 @@ public class SI004INVENTORYSyncOutServiceTask {
traceNo = headerObject.getString("TRACE_NO");
Date INVENTORY_DATE = headerObject.getDate("INVENTORY_DATE");
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.setZSPART(headerObject.getString("MPG"));
INVENTORYRECORD.setHEADER(INVENTORYRECORD_HEADER);
......
......@@ -41,7 +41,7 @@ import javax.xml.bind.annotation.XmlType;
* </restriction>
* </simpleType>
* </element>
* <element name="NAME1">
* <element name="NAME">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <minLength value="35"/>
......@@ -270,7 +270,7 @@ public class ZDTSD004INVENTORYSENDING {
* </restriction>
* </simpleType>
* </element>
* <element name="NAME1">
* <element name="NAME">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <minLength value="35"/>
......@@ -516,7 +516,7 @@ public class ZDTSD004INVENTORYSENDING {
* </restriction>
* </simpleType>
* </element>
* <element name="NAME1">
* <element name="NAME">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <minLength value="35"/>
......@@ -685,7 +685,7 @@ public class ZDTSD004INVENTORYSENDING {
* </restriction>
* </simpleType>
* </element>
* <element name="NAME1">
* <element name="NAME">
* <simpleType>
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <minLength value="35"/>
......@@ -717,7 +717,7 @@ public class ZDTSD004INVENTORYSENDING {
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"kunnr",
"name1",
"name",
"zspart",
"zdate"
})
......@@ -725,8 +725,8 @@ public class ZDTSD004INVENTORYSENDING {
@XmlElement(name = "KUNNR", required = true)
protected String kunnr;
@XmlElement(name = "NAME1", required = true)
protected String name1;
@XmlElement(name = "NAME", required = true)
protected String name;
@XmlElement(name = "ZSPART", required = true)
protected String zspart;
@XmlElement(name = "ZDATE", required = true)
......@@ -757,27 +757,27 @@ public class ZDTSD004INVENTORYSENDING {
}
/**
* 获取name1属性的值。
* 获取name属性的值。
*
* @return
* possible object is
* {@link String }
*
*/
public String getNAME1() {
return name1;
public String getNAME() {
return name;
}
/**
* 设置name1属性的值。
* 设置name属性的值。
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setNAME1(String value) {
this.name1 = value;
public void setNAME(String 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