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
b42b58c7
Commit
b42b58c7
authored
Aug 15, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
3bb9ec91
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
20 deletions
+36
-20
SAPServiceFactory.java
src/main/java/com/egolm/sso/clients/SAPServiceFactory.java
+16
-11
SI004INVENTORYSyncOutServiceTask.java
...TORY_SyncOutService/SI004INVENTORYSyncOutServiceTask.java
+4
-1
SI009SOCREATIONAsynOutServiceTask.java
...ION_AsynOutService/SI009SOCREATIONAsynOutServiceTask.java
+4
-1
SI011ACTUALSALESSyncOutServiceTask.java
...ES_SyncOutService/SI011ACTUALSALESSyncOutServiceTask.java
+4
-1
application.yml
src/main/resources/application.yml
+8
-6
No files found.
src/main/java/com/egolm/sso/clients/SAPServiceFactory.java
View file @
b42b58c7
...
...
@@ -42,27 +42,32 @@ public class SAPServiceFactory {
@Value
(
"${schneider.password}"
)
private
String
password
;
@Value
(
"${CLIENT
_
KEYSTORE.FILEPATH}"
)
@Value
(
"${CLIENT
.
KEYSTORE.FILEPATH}"
)
private
String
keyStoreFile
;
@Value
(
"${CLIENT
_
KEYSTORE.PASSWORD}"
)
@Value
(
"${CLIENT
.
KEYSTORE.PASSWORD}"
)
private
String
keyStorePassword
;
@Value
(
"${CLIENT.SSL}"
)
private
boolean
isOpenSSL
;
public
<
T
>
T
create
(
Class
<
T
>
requiredType
,
URL
wsdlLocation
,
QName
serviceQName
)
{
public
<
T
>
T
create
(
Class
<
T
>
requiredType
,
URL
wsdlLocation
,
QName
serviceQName
,
QName
portQName
)
{
assert
requiredType
!=
null
:
"WebService requiredType cannot be null"
;
assert
wsdlLocation
!=
null
:
"WebService wsdlLocation cannot be null"
;
assert
serviceQName
!=
null
:
"WebService serviceQName cannot be null"
;
Service
dyService
=
Service
.
create
(
wsdlLocation
,
serviceQName
);
T
service
=
dyService
.
getPort
(
requiredType
);
T
service
=
portQName
==
null
?
dyService
.
getPort
(
requiredType
)
:
dyService
.
getPort
(
portQName
,
requiredType
);
Client
client
=
ClientProxy
.
getClient
(
service
);
client
.
getOutInterceptors
().
add
(
this
.
getWSS4JOutInterceptor
());
HTTPConduit
httpConduit
=
(
HTTPConduit
)
client
.
getConduit
();
TLSClientParameters
tlsParams
=
httpConduit
.
getTlsClientParameters
();
tlsParams
=
tlsParams
==
null
?
new
TLSClientParameters
()
:
tlsParams
;
tlsParams
.
setSecureSocketProtocol
(
"SSL"
);
tlsParams
.
setKeyManagers
(
getKeyManagers
());
tlsParams
.
setTrustManagers
(
getTrustManagers
());
httpConduit
.
setTlsClientParameters
(
tlsParams
);
if
(
isOpenSSL
)
{
HTTPConduit
httpConduit
=
(
HTTPConduit
)
client
.
getConduit
();
TLSClientParameters
tlsParams
=
httpConduit
.
getTlsClientParameters
();
tlsParams
=
tlsParams
==
null
?
new
TLSClientParameters
()
:
tlsParams
;
tlsParams
.
setSecureSocketProtocol
(
"SSL"
);
tlsParams
.
setKeyManagers
(
getKeyManagers
());
tlsParams
.
setTrustManagers
(
getTrustManagers
());
httpConduit
.
setTlsClientParameters
(
tlsParams
);
}
return
service
;
}
...
...
src/main/java/com/egolm/sso/clients/SI_004_INVENTORY_SyncOutService/SI004INVENTORYSyncOutServiceTask.java
View file @
b42b58c7
...
...
@@ -56,6 +56,9 @@ public class SI004INVENTORYSyncOutServiceTask {
@Value
(
"${WSDL.N004}"
)
private
String
WSDLPATH
;
@Value
(
"${CLIENT.SSL}"
)
private
boolean
isOpenSSL
;
@Autowired
private
SAPServiceFactory
factory
;
...
...
@@ -65,7 +68,7 @@ public class SI004INVENTORYSyncOutServiceTask {
}
public
void
runTask
()
throws
MalformedURLException
{
SI004INVENTORYSyncOut
service
=
factory
.
create
(
SI004INVENTORYSyncOut
.
class
,
factory
.
getAbsoluteURL
(
WSDLPATH
),
SI004INVENTORYSyncOutService
.
SERVICE
);
SI004INVENTORYSyncOut
service
=
factory
.
create
(
SI004INVENTORYSyncOut
.
class
,
factory
.
getAbsoluteURL
(
WSDLPATH
),
SI004INVENTORYSyncOutService
.
SERVICE
,
isOpenSSL
?
SI004INVENTORYSyncOutService
.
HTTPSPort
:
SI004INVENTORYSyncOutService
.
HTTPPort
);
this
.
sendData
(
service
);
}
...
...
src/main/java/com/egolm/sso/clients/SI_009_SO_CREATION_AsynOutService/SI009SOCREATIONAsynOutServiceTask.java
View file @
b42b58c7
...
...
@@ -55,6 +55,9 @@ public class SI009SOCREATIONAsynOutServiceTask {
@Value
(
"${xmlRoot}"
)
private
String
xmlRoot
;
@Value
(
"${CLIENT.SSL}"
)
private
boolean
isOpenSSL
;
@Autowired
private
SAPServiceFactory
factory
;
...
...
@@ -64,7 +67,7 @@ public class SI009SOCREATIONAsynOutServiceTask {
}
public
void
runTask
()
throws
MalformedURLException
{
SI009SOCREATIONAsynOut
service
=
factory
.
create
(
SI009SOCREATIONAsynOut
.
class
,
factory
.
getAbsoluteURL
(
WSDLPATH
),
SI009SOCREATIONAsynOutService
.
SERVICE
);
SI009SOCREATIONAsynOut
service
=
factory
.
create
(
SI009SOCREATIONAsynOut
.
class
,
factory
.
getAbsoluteURL
(
WSDLPATH
),
SI009SOCREATIONAsynOutService
.
SERVICE
,
isOpenSSL
?
SI009SOCREATIONAsynOutService
.
HTTPSPort
:
SI009SOCREATIONAsynOutService
.
HTTPPort
);
this
.
sendData
(
service
);
}
...
...
src/main/java/com/egolm/sso/clients/SI_011_ACTUAL_SALES_SyncOutService/SI011ACTUALSALESSyncOutServiceTask.java
View file @
b42b58c7
...
...
@@ -56,6 +56,9 @@ public class SI011ACTUALSALESSyncOutServiceTask {
@Value
(
"${xmlRoot}"
)
private
String
xmlRoot
;
@Value
(
"${CLIENT.SSL}"
)
private
boolean
isOpenSSL
;
@Autowired
private
SAPServiceFactory
factory
;
...
...
@@ -65,7 +68,7 @@ public class SI011ACTUALSALESSyncOutServiceTask {
}
public
void
runTask
()
throws
MalformedURLException
{
SI011ACTUALSALESSyncOut
service
=
factory
.
create
(
SI011ACTUALSALESSyncOut
.
class
,
factory
.
getAbsoluteURL
(
WSDLPATH
),
SI011ACTUALSALESSyncOutService
.
SERVICE
);
SI011ACTUALSALESSyncOut
service
=
factory
.
create
(
SI011ACTUALSALESSyncOut
.
class
,
factory
.
getAbsoluteURL
(
WSDLPATH
),
SI011ACTUALSALESSyncOutService
.
SERVICE
,
isOpenSSL
?
SI011ACTUALSALESSyncOutService
.
HTTPSPort
:
SI011ACTUALSALESSyncOutService
.
HTTPPort
);
this
.
sendData
(
service
);
}
...
...
src/main/resources/application.yml
View file @
b42b58c7
CLIENT_KEYSTORE
:
FILEPATH
:
SSL/sap.keystore
PASSWORD
:
123456
isUsedTestController
:
true
xmlRoot
:
xml
systemId
:
system
CLIENT
:
SSL
:
true
KEYSTORE
:
FILEPATH
:
SSL/sap.keystore
PASSWORD
:
123456
CRON
:
N009
:
0 10 0 * * ?
N004
:
0 20 0 * * ?
...
...
@@ -12,6 +11,9 @@ WSDL:
N009
:
WSDL/SI_009_SO_CREATION_AsynOutService.wsdl
N004
:
WSDL/SI_004_INVENTORY_SyncOutService.wsdl
N011
:
WSDL/SI_011_ACTUAL_SALES_SyncOutService.wsdl
isUsedTestController
:
true
xmlRoot
:
xml
systemId
:
system
server
:
port
:
8080
tomcat
:
...
...
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