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;
}
/**
......
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="SI_004_INVENTORY_SyncOut" targetNamespace="http://distributors.edi.digital.cn.se.com" xmlns:p1="http://distributors.edi.digital.cn.se.com" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:documentation/>
<wsp:UsingPolicy wsdl:required="true"/>
<wsp:Policy wsu:Id="OP_SI_004_INVENTORY_SyncOut"/>
<wsdl:types>
<xsd:schema targetNamespace="http://distributors.edi.digital.cn.se.com" xmlns="http://distributors.edi.digital.cn.se.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="MT_004_INVENTORY" type="Z_DT_SD_004_INVENTORY_SENDING"/>
<xsd:complexType name="Z_DT_SD_004_INVENTORY_SENDING">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/VersionID">f344fec3be4811e99e5c0000004c9fd3</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="RECORD">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">583b0660bb2c11db8853001641a70fb2</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="INVENTORYRECORD">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">583b0661bb2c11db98ee001641a70fb2</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="HEADER">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">583b0662bb2c11db81ca001641a70fb2</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="KUNNR">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">583b0663bb2c11db9962001641a70fb2</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="10"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="NAME">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">583b0664bb2c11dbc3ab001641a70fb2</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="35"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ZSPART">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">583b0665bb2c11dbbdf0001641a70fb2</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="10"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ZDATE">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">583b0666bb2c11dba210001641a70fb2</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="8"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="ITEM" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">583d7760bb2c11db9f7b001641a70fb2</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="POSNR">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">583d7761bb2c11dbafd8001641a70fb2</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="6"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="MATNR">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">583d7762bb2c11db904e001641a70fb2</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="18"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="MAKTX">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">583d7763bb2c11dbc432001641a70fb2</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="40"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="MENGE">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">583d7764bb2c11dbb4c6001641a70fb2</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="15"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ZPRIC">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">583d7765bb2c11dbbc9b001641a70fb2</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="15"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ZVALU">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">583d7766bb2c11db96d0001641a70fb2</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="15"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="REVENUE_RATIO">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">583d7767bb2c11db9266001641a70fb2</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="HEADER">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">583d7768bb2c11dbad7c001641a70fb2</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="KUNNR">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">583d7769bb2c11db92d6001641a70fb2</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="10"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="NAME">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">583d776abb2c11dbbb88001641a70fb2</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="35"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="RNAME">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">583d776bbb2c11dba118001641a70fb2</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="40"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ERDATE">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">583d776cbb2c11db9aa3001641a70fb2</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="8"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="ITEM" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">583d776dbb2c11dbcd8d001641a70fb2</xsd:appinfo>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="VENDORNAME">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">583d776ebb2c11dbba39001641a70fb2</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="50"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="RATIO">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">583d776fbb2c11dba4eb001641a70fb2</xsd:appinfo>
</xsd:annotation>
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="15"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="MT_004_INVENTORY">
<wsdl:documentation/>
<wsdl:part name="MT_004_INVENTORY" element="p1:MT_004_INVENTORY"/>
</wsdl:message>
<wsdl:portType name="SI_004_INVENTORY_SyncOut">
<wsdl:documentation/>
<wsdl:operation name="SI_004_INVENTORY_SyncOut">
<wsdl:documentation/>
<wsp:Policy>
<wsp:PolicyReference URI="#OP_SI_004_INVENTORY_SyncOut"/>
</wsp:Policy>
<wsdl:input message="p1:MT_004_INVENTORY"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="SI_004_INVENTORY_SyncOutBinding" type="p1:SI_004_INVENTORY_SyncOut">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
<wsdl:operation name="SI_004_INVENTORY_SyncOut">
<soap:operation soapAction="http://sap.com/xi/WebService/soap1.1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
<wsdl:input>
<soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
</wsdl:input>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="SI_004_INVENTORY_SyncOutService">
<wsdl:port name="HTTP_Port" binding="p1:SI_004_INVENTORY_SyncOutBinding">
<soap:address location="http://sapdpo00.cn.schneider-electric.com:50000/XISOAPAdapter/MessageServlet?senderParty=&amp;senderService=BC_DISTRIBUTORS_EDI&amp;receiverParty=&amp;receiverService=&amp;interface=SI_004_INVENTORY_SyncOut&amp;interfaceNamespace=http%3A%2F%2Fdistributors.edi.digital.cn.se.com" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
</wsdl:port>
<wsdl:port name="HTTPS_Port" binding="p1:SI_004_INVENTORY_SyncOutBinding">
<soap:address location="https://sapdpo00.cn.schneider-electric.com:50001/XISOAPAdapter/MessageServlet?senderParty=&amp;senderService=BC_DISTRIBUTORS_EDI&amp;receiverParty=&amp;receiverService=&amp;interface=SI_004_INVENTORY_SyncOut&amp;interfaceNamespace=http%3A%2F%2Fdistributors.edi.digital.cn.se.com" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
\ No newline at end of file
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