Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
sap-service
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
sap-service
Commits
cbe7bd81
Commit
cbe7bd81
authored
Aug 13, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
fdda0922
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
33 deletions
+33
-33
SAPServiceFactory.java
src/main/java/com/egolm/sso/clients/SAPServiceFactory.java
+21
-3
SI004INVENTORYSyncOutServiceTask.java
...TORY_SyncOutService/SI004INVENTORYSyncOutServiceTask.java
+4
-11
SI009SOCREATIONAsynOutServiceTask.java
...ION_AsynOutService/SI009SOCREATIONAsynOutServiceTask.java
+2
-9
SI011ACTUALSALESSyncOutServiceTask.java
...ES_SyncOutService/SI011ACTUALSALESSyncOutServiceTask.java
+2
-9
application.yml
src/main/resources/application.yml
+4
-1
No files found.
src/main/java/com/egolm/sso/clients/SAPServiceFactory.java
View file @
cbe7bd81
package
com
.
egolm
.
sso
.
clients
;
import
java.io.File
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
java.util.HashMap
;
...
...
@@ -15,6 +16,7 @@ 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
;
...
...
@@ -29,12 +31,12 @@ public class SAPServiceFactory {
private
String
password
;
public
<
T
>
T
create
(
Class
<
T
>
requiredType
,
String
wsdlLocation
,
QName
serviceQName
,
QName
portQName
)
{
public
<
T
>
T
create
(
Class
<
T
>
requiredType
,
String
WSDLPATH
,
QName
serviceQName
,
QName
portQName
)
{
assert
requiredType
!=
null
:
"WebService requiredType cannot be null"
;
assert
wsdlLocation
!=
null
:
"WebService wsdlLocation
cannot be null"
;
assert
WSDLPATH
!=
null
:
"WebService WSDLPATH
cannot be null"
;
assert
serviceQName
!=
null
:
"WebService serviceQName cannot be null"
;
try
{
URL
WSDL_URL
=
new
URL
(
wsdlLocation
);
URL
WSDL_URL
=
new
URL
(
this
.
getAbsolutePath
(
WSDLPATH
)
);
Service
dyService
=
Service
.
create
(
WSDL_URL
,
serviceQName
);
T
service
=
portQName
==
null
?
dyService
.
getPort
(
requiredType
)
:
dyService
.
getPort
(
portQName
,
requiredType
);
ClientProxy
.
getClient
(
service
).
getOutInterceptors
().
add
(
getWSS4JOutInterceptor
());
...
...
@@ -44,6 +46,22 @@ public class SAPServiceFactory {
}
}
private
static
String
absolutePath
=
null
;
private
String
getAbsolutePath
(
String
WSDLPATH
)
{
if
(
absolutePath
==
null
)
{
synchronized
(
absolutePath
)
{
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
;
public
WSS4JOutInterceptor
getWSS4JOutInterceptor
()
{
...
...
src/main/java/com/egolm/sso/clients/SI_004_INVENTORY_SyncOutService/SI004INVENTORYSyncOutServiceTask.java
View file @
cbe7bd81
package
com
.
egolm
.
sso
.
clients
.
SI_004_INVENTORY_SyncOutService
;
import
java.io.File
;
import
java.math.BigInteger
;
import
java.net.MalformedURLException
;
import
java.util.ArrayList
;
...
...
@@ -12,7 +11,6 @@ import org.apache.commons.logging.Log;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.system.ApplicationHome
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
...
...
@@ -52,12 +50,12 @@ public class SI004INVENTORYSyncOutServiceTask {
@Value
(
"${schneider.password}"
)
private
String
password
;
@Value
(
"${WSDLPATH}"
)
private
String
WSDLPATH
;
@Value
(
"${xmlRoot}"
)
private
String
xmlRoot
;
@Value
(
"${WSDL.N004}"
)
private
String
WSDLPATH
;
@Autowired
private
SAPServiceFactory
factory
;
...
...
@@ -67,12 +65,7 @@ public class SI004INVENTORYSyncOutServiceTask {
}
public
void
runTask
()
throws
MalformedURLException
{
ApplicationHome
home
=
new
ApplicationHome
(
getClass
());
File
jarFile
=
home
.
getSource
();
File
folder
=
jarFile
.
getParentFile
();
String
absolutePath
=
folder
.
getAbsolutePath
();
String
wsdlLocation
=
"file:///"
+
absolutePath
+
"/"
+
WSDLPATH
+
"/SI_004_INVENTORY_SyncOutService.wsdl"
;
SI004INVENTORYSyncOut
service
=
factory
.
create
(
SI004INVENTORYSyncOut
.
class
,
wsdlLocation
,
SI004INVENTORYSyncOutService
.
SERVICE
,
SI004INVENTORYSyncOutService
.
HTTPPort
);
SI004INVENTORYSyncOut
service
=
factory
.
create
(
SI004INVENTORYSyncOut
.
class
,
WSDLPATH
,
SI004INVENTORYSyncOutService
.
SERVICE
,
SI004INVENTORYSyncOutService
.
HTTPPort
);
this
.
sendData
(
service
);
}
...
...
src/main/java/com/egolm/sso/clients/SI_009_SO_CREATION_AsynOutService/SI009SOCREATIONAsynOutServiceTask.java
View file @
cbe7bd81
package
com
.
egolm
.
sso
.
clients
.
SI_009_SO_CREATION_AsynOutService
;
import
java.io.File
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
...
...
@@ -11,7 +10,6 @@ import org.apache.commons.logging.Log;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.system.ApplicationHome
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
...
...
@@ -50,7 +48,7 @@ public class SI009SOCREATIONAsynOutServiceTask {
@Value
(
"${schneider.password}"
)
private
String
password
;
@Value
(
"${WSDL
PATH
}"
)
@Value
(
"${WSDL
.N009
}"
)
private
String
WSDLPATH
;
@Value
(
"${xmlRoot}"
)
...
...
@@ -65,12 +63,7 @@ public class SI009SOCREATIONAsynOutServiceTask {
}
public
void
runTask
()
{
ApplicationHome
home
=
new
ApplicationHome
(
getClass
());
File
jarFile
=
home
.
getSource
();
File
folder
=
jarFile
.
getParentFile
();
String
absolutePath
=
folder
.
getAbsolutePath
();
String
wsdlLocation
=
"file:///"
+
absolutePath
+
"/"
+
WSDLPATH
+
"/SI_009_SO_CREATION_AsynOutService.wsdl"
;
SI009SOCREATIONAsynOut
service
=
factory
.
create
(
SI009SOCREATIONAsynOut
.
class
,
wsdlLocation
,
SI009SOCREATIONAsynOutService
.
SERVICE
,
SI009SOCREATIONAsynOutService
.
HTTPPort
);
SI009SOCREATIONAsynOut
service
=
factory
.
create
(
SI009SOCREATIONAsynOut
.
class
,
WSDLPATH
,
SI009SOCREATIONAsynOutService
.
SERVICE
,
SI009SOCREATIONAsynOutService
.
HTTPPort
);
this
.
sendData
(
service
);
}
...
...
src/main/java/com/egolm/sso/clients/SI_011_ACTUAL_SALES_SyncOutService/SI011ACTUALSALESSyncOutServiceTask.java
View file @
cbe7bd81
package
com
.
egolm
.
sso
.
clients
.
SI_011_ACTUAL_SALES_SyncOutService
;
import
java.io.File
;
import
java.math.BigInteger
;
import
java.util.ArrayList
;
import
java.util.Date
;
...
...
@@ -11,7 +10,6 @@ import org.apache.commons.logging.Log;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.system.ApplicationHome
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
...
...
@@ -51,7 +49,7 @@ public class SI011ACTUALSALESSyncOutServiceTask {
@Value
(
"${schneider.password}"
)
private
String
password
;
@Value
(
"${WSDL
PATH
}"
)
@Value
(
"${WSDL
.N011
}"
)
private
String
WSDLPATH
;
@Value
(
"${xmlRoot}"
)
...
...
@@ -66,12 +64,7 @@ public class SI011ACTUALSALESSyncOutServiceTask {
}
public
void
runTask
()
{
ApplicationHome
home
=
new
ApplicationHome
(
getClass
());
File
jarFile
=
home
.
getSource
();
File
folder
=
jarFile
.
getParentFile
();
String
absolutePath
=
folder
.
getAbsolutePath
();
String
wsdlLocation
=
"file:///"
+
absolutePath
+
"/"
+
WSDLPATH
+
"/SI_011_ACTUAL_SALES_SyncOutService.wsdl"
;
SI011ACTUALSALESSyncOut
service
=
factory
.
create
(
SI011ACTUALSALESSyncOut
.
class
,
wsdlLocation
,
SI011ACTUALSALESSyncOutService
.
SERVICE
,
SI011ACTUALSALESSyncOutService
.
HTTPPort
);
SI011ACTUALSALESSyncOut
service
=
factory
.
create
(
SI011ACTUALSALESSyncOut
.
class
,
WSDLPATH
,
SI011ACTUALSALESSyncOutService
.
SERVICE
,
SI011ACTUALSALESSyncOutService
.
HTTPPort
);
this
.
sendData
(
service
);
}
...
...
src/main/resources/application.yml
View file @
cbe7bd81
isUsedTestController
:
true
xmlRoot
:
xml
systemId
:
system
WSDLPATH
:
WSDL
WSDL
:
N009
:
WSDL/SI_009_SO_CREATION_AsynOutService.wsdl
N004
:
WSDL/SI_004_INVENTORY_SyncOutService.wsdl
N011
:
WSDL/SI_011_ACTUAL_SALES_SyncOutService.wsdl
server
:
port
:
8080
spring
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment