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
46ffeabe
Commit
46ffeabe
authored
Jul 26, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
2b3c1ba0
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
16 additions
and
10 deletions
+16
-10
ServiceFactory.java
src/main/java/com/egolm/sso/util/ServiceFactory.java
+9
-2
ZMISD009SOCREATIONTask.java
...ava/com/schneider_distributor/ZMISD009SOCREATIONTask.java
+1
-2
ConfirmQuotationTest.java
src/test/java/test/ConfirmQuotationTest.java
+1
-1
DeletionServiceTest.java
src/test/java/test/DeletionServiceTest.java
+1
-1
MaterialMasterServiceTest.java
src/test/java/test/MaterialMasterServiceTest.java
+1
-1
PrformaInvoiceServiceTest.java
src/test/java/test/PrformaInvoiceServiceTest.java
+1
-1
PriceListServiceTest.java
src/test/java/test/PriceListServiceTest.java
+1
-1
ShippingNotificationTest.java
src/test/java/test/ShippingNotificationTest.java
+1
-1
No files found.
src/main/java/com/egolm/sso/util/ServiceFactory.java
View file @
46ffeabe
...
@@ -19,12 +19,16 @@ import com.egolm.sso.config.XRException;
...
@@ -19,12 +19,16 @@ import com.egolm.sso.config.XRException;
public
class
ServiceFactory
{
public
class
ServiceFactory
{
public
static
<
T
>
T
create
(
Class
<
T
>
requiredType
,
String
wsdlLocation
,
String
namespace
,
String
serviceName
,
String
username
,
String
password
,
String
passwordType
)
{
public
static
<
T
>
T
create
(
Class
<
T
>
requiredType
,
String
wsdlLocation
,
String
namespace
,
String
serviceName
,
String
username
,
String
password
)
{
return
create
(
requiredType
,
wsdlLocation
,
namespace
,
serviceName
,
username
,
password
,
PasswordType
.
PasswordText
);
}
public
static
<
T
>
T
create
(
Class
<
T
>
requiredType
,
String
wsdlLocation
,
String
namespace
,
String
serviceName
,
String
username
,
String
password
,
PasswordType
passwordType
)
{
try
{
try
{
Map
<
String
,
Object
>
pro
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
pro
=
new
HashMap
<
String
,
Object
>();
pro
.
put
(
WSHandlerConstants
.
ACTION
,
WSHandlerConstants
.
USERNAME_TOKEN
);
pro
.
put
(
WSHandlerConstants
.
ACTION
,
WSHandlerConstants
.
USERNAME_TOKEN
);
pro
.
put
(
WSHandlerConstants
.
USER
,
username
);
pro
.
put
(
WSHandlerConstants
.
USER
,
username
);
pro
.
put
(
WSHandlerConstants
.
PASSWORD_TYPE
,
passwordType
);
pro
.
put
(
WSHandlerConstants
.
PASSWORD_TYPE
,
passwordType
==
null
?
PasswordType
.
PasswordText
.
name
()
:
passwordType
.
name
()
);
pro
.
put
(
WSHandlerConstants
.
PW_CALLBACK_REF
,
new
CallbackHandler
()
{
pro
.
put
(
WSHandlerConstants
.
PW_CALLBACK_REF
,
new
CallbackHandler
()
{
public
void
handle
(
Callback
[]
callbacks
)
{
public
void
handle
(
Callback
[]
callbacks
)
{
for
(
int
i
=
0
;
i
<
callbacks
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
callbacks
.
length
;
i
++)
{
...
@@ -44,4 +48,7 @@ public class ServiceFactory {
...
@@ -44,4 +48,7 @@ public class ServiceFactory {
}
}
}
}
public
enum
PasswordType
{
PasswordText
,
PasswordNone
,
PasswordDigest
}
}
}
src/main/java/com/schneider_distributor/ZMISD009SOCREATIONTask.java
View file @
46ffeabe
...
@@ -7,7 +7,6 @@ import java.util.Date;
...
@@ -7,7 +7,6 @@ import java.util.Date;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
org.apache.ws.security.WSConstants
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.system.ApplicationHome
;
import
org.springframework.boot.system.ApplicationHome
;
...
@@ -44,7 +43,7 @@ public class ZMISD009SOCREATIONTask {
...
@@ -44,7 +43,7 @@ public class ZMISD009SOCREATIONTask {
File
folder
=
jarFile
.
getParentFile
();
File
folder
=
jarFile
.
getParentFile
();
String
absolutePath
=
folder
.
getAbsolutePath
();
String
absolutePath
=
folder
.
getAbsolutePath
();
String
wsdlLocation
=
"file:///"
+
absolutePath
+
"/WSDL/Z_MI_SD_009_SO_CREATION.wsdl"
;
String
wsdlLocation
=
"file:///"
+
absolutePath
+
"/WSDL/Z_MI_SD_009_SO_CREATION.wsdl"
;
ZMISD009SOCREATIONService
service
=
ServiceFactory
.
create
(
ZMISD009SOCREATIONService
.
class
,
wsdlLocation
,
"http://schneider-distributor.com/"
,
"Z_MI_SD_009_SO_CREATIONService"
,
username
,
password
,
WSConstants
.
PW_TEXT
);
ZMISD009SOCREATIONService
service
=
ServiceFactory
.
create
(
ZMISD009SOCREATIONService
.
class
,
wsdlLocation
,
"http://schneider-distributor.com/"
,
"Z_MI_SD_009_SO_CREATIONService"
,
username
,
password
);
this
.
sendData
(
service
.
getZMISD009SOCREATIONPort
());
this
.
sendData
(
service
.
getZMISD009SOCREATIONPort
());
}
}
...
...
src/test/java/test/ConfirmQuotationTest.java
View file @
46ffeabe
...
@@ -12,7 +12,7 @@ public class ConfirmQuotationTest {
...
@@ -12,7 +12,7 @@ public class ConfirmQuotationTest {
String
wsdlLocation
=
"http://localhost:8080/api/services/confirm_quotation?wsdl"
;
String
wsdlLocation
=
"http://localhost:8080/api/services/confirm_quotation?wsdl"
;
String
namespace
=
"http://confirm_quotation.sso.egolm.com"
;
String
namespace
=
"http://confirm_quotation.sso.egolm.com"
;
String
serviceName
=
"ConfirmQuotationService"
;
String
serviceName
=
"ConfirmQuotationService"
;
ConfirmQuotationService
service
=
ServiceFactory
.
create
(
ConfirmQuotationService
.
class
,
wsdlLocation
,
namespace
,
serviceName
,
"test"
,
""
,
"PasswordText"
);
ConfirmQuotationService
service
=
ServiceFactory
.
create
(
ConfirmQuotationService
.
class
,
wsdlLocation
,
namespace
,
serviceName
,
"test"
,
""
,
null
);
String
XML
=
StringUtil
.
readText
(
"D:/data/sso/008-1.XML"
);
String
XML
=
StringUtil
.
readText
(
"D:/data/sso/008-1.XML"
);
Z_MT_SD_008_SO_CONFIRM_QUOTATION
Z_MT_SD_008_SO_CONFIRM_QUOTATION
=
XMLUtil
.
toBeanByJxab
(
XML
,
Z_MT_SD_008_SO_CONFIRM_QUOTATION
.
class
);
Z_MT_SD_008_SO_CONFIRM_QUOTATION
Z_MT_SD_008_SO_CONFIRM_QUOTATION
=
XMLUtil
.
toBeanByJxab
(
XML
,
Z_MT_SD_008_SO_CONFIRM_QUOTATION
.
class
);
service
.
execute
(
Z_MT_SD_008_SO_CONFIRM_QUOTATION
);
service
.
execute
(
Z_MT_SD_008_SO_CONFIRM_QUOTATION
);
...
...
src/test/java/test/DeletionServiceTest.java
View file @
46ffeabe
...
@@ -12,7 +12,7 @@ public class DeletionServiceTest {
...
@@ -12,7 +12,7 @@ public class DeletionServiceTest {
String
wsdlLocation
=
"http://localhost:8080/api/services/dn_deletion?wsdl"
;
String
wsdlLocation
=
"http://localhost:8080/api/services/dn_deletion?wsdl"
;
String
namespace
=
"http://dn_deletion.sso.egolm.com"
;
String
namespace
=
"http://dn_deletion.sso.egolm.com"
;
String
serviceName
=
"DNDeletionService"
;
String
serviceName
=
"DNDeletionService"
;
DNDeletionService
service
=
ServiceFactory
.
create
(
DNDeletionService
.
class
,
wsdlLocation
,
namespace
,
serviceName
,
"test"
,
""
,
"PasswordText"
);
DNDeletionService
service
=
ServiceFactory
.
create
(
DNDeletionService
.
class
,
wsdlLocation
,
namespace
,
serviceName
,
"test"
,
""
,
null
);
String
XML
=
StringUtil
.
readText
(
"D:/data/sso/010.XML"
);
String
XML
=
StringUtil
.
readText
(
"D:/data/sso/010.XML"
);
DELETED_DOCUMENTS
DELETED_DOCUMENTS
=
XMLUtil
.
toBeanByJxab
(
XML
,
DELETED_DOCUMENTS
.
class
);
DELETED_DOCUMENTS
DELETED_DOCUMENTS
=
XMLUtil
.
toBeanByJxab
(
XML
,
DELETED_DOCUMENTS
.
class
);
service
.
execute
(
DELETED_DOCUMENTS
);
service
.
execute
(
DELETED_DOCUMENTS
);
...
...
src/test/java/test/MaterialMasterServiceTest.java
View file @
46ffeabe
...
@@ -12,7 +12,7 @@ public class MaterialMasterServiceTest {
...
@@ -12,7 +12,7 @@ public class MaterialMasterServiceTest {
String
wsdlLocation
=
"http://10.204.15.9:8080/api/services/material_master?wsdl"
;
String
wsdlLocation
=
"http://10.204.15.9:8080/api/services/material_master?wsdl"
;
String
namespace
=
"http://material_master.sso.egolm.com"
;
String
namespace
=
"http://material_master.sso.egolm.com"
;
String
serviceName
=
"MaterialMasterService"
;
String
serviceName
=
"MaterialMasterService"
;
MaterialMasterService
service
=
ServiceFactory
.
create
(
MaterialMasterService
.
class
,
wsdlLocation
,
namespace
,
serviceName
,
"test"
,
""
,
"PasswordText"
);
MaterialMasterService
service
=
ServiceFactory
.
create
(
MaterialMasterService
.
class
,
wsdlLocation
,
namespace
,
serviceName
,
"test"
,
""
,
null
);
String
XML
=
StringUtil
.
readText
(
"D:/data/sso/001.XML"
);
String
XML
=
StringUtil
.
readText
(
"D:/data/sso/001.XML"
);
Z_MT_SD_001_MATERIAL_MASTER
Z_MT_SD_001_MATERIAL_MASTER
=
XMLUtil
.
toBeanByJxab
(
XML
,
Z_MT_SD_001_MATERIAL_MASTER
.
class
);
Z_MT_SD_001_MATERIAL_MASTER
Z_MT_SD_001_MATERIAL_MASTER
=
XMLUtil
.
toBeanByJxab
(
XML
,
Z_MT_SD_001_MATERIAL_MASTER
.
class
);
service
.
execute
(
Z_MT_SD_001_MATERIAL_MASTER
);
service
.
execute
(
Z_MT_SD_001_MATERIAL_MASTER
);
...
...
src/test/java/test/PrformaInvoiceServiceTest.java
View file @
46ffeabe
...
@@ -12,7 +12,7 @@ public class PrformaInvoiceServiceTest {
...
@@ -12,7 +12,7 @@ public class PrformaInvoiceServiceTest {
String
wsdlLocation
=
"http://localhost:8080/api/services/prforma_invoice?wsdl"
;
String
wsdlLocation
=
"http://localhost:8080/api/services/prforma_invoice?wsdl"
;
String
namespace
=
"http://prforma_invoice.sso.egolm.com"
;
String
namespace
=
"http://prforma_invoice.sso.egolm.com"
;
String
serviceName
=
"PrformaInvoiceService"
;
String
serviceName
=
"PrformaInvoiceService"
;
PrformaInvoiceService
service
=
ServiceFactory
.
create
(
PrformaInvoiceService
.
class
,
wsdlLocation
,
namespace
,
serviceName
,
"test"
,
""
,
"PasswordText"
);
PrformaInvoiceService
service
=
ServiceFactory
.
create
(
PrformaInvoiceService
.
class
,
wsdlLocation
,
namespace
,
serviceName
,
"test"
,
""
);
String
XML
=
StringUtil
.
readText
(
"D:/data/sso/005.XML"
);
String
XML
=
StringUtil
.
readText
(
"D:/data/sso/005.XML"
);
Z_MT_SD_005_PERFORM_INVOICE
Z_MT_SD_005_PERFORM_INVOICE
=
XMLUtil
.
toBeanByJxab
(
XML
,
Z_MT_SD_005_PERFORM_INVOICE
.
class
);
Z_MT_SD_005_PERFORM_INVOICE
Z_MT_SD_005_PERFORM_INVOICE
=
XMLUtil
.
toBeanByJxab
(
XML
,
Z_MT_SD_005_PERFORM_INVOICE
.
class
);
service
.
execute
(
Z_MT_SD_005_PERFORM_INVOICE
);
service
.
execute
(
Z_MT_SD_005_PERFORM_INVOICE
);
...
...
src/test/java/test/PriceListServiceTest.java
View file @
46ffeabe
...
@@ -12,7 +12,7 @@ public class PriceListServiceTest {
...
@@ -12,7 +12,7 @@ public class PriceListServiceTest {
String
wsdlLocation
=
"http://localhost:8080/api/services/price_list?wsdl"
;
String
wsdlLocation
=
"http://localhost:8080/api/services/price_list?wsdl"
;
String
namespace
=
"http://price_list.sso.egolm.com"
;
String
namespace
=
"http://price_list.sso.egolm.com"
;
String
serviceName
=
"PriceListService"
;
String
serviceName
=
"PriceListService"
;
PriceListService
service
=
ServiceFactory
.
create
(
PriceListService
.
class
,
wsdlLocation
,
namespace
,
serviceName
,
"test"
,
""
,
"PasswordText"
);
PriceListService
service
=
ServiceFactory
.
create
(
PriceListService
.
class
,
wsdlLocation
,
namespace
,
serviceName
,
"test"
,
""
);
String
XML
=
StringUtil
.
readText
(
"D:/data/sso/002.XML"
);
String
XML
=
StringUtil
.
readText
(
"D:/data/sso/002.XML"
);
Z_MT_SD_002_PRICE_LIST
Z_MT_SD_002_PRICE_LIST
=
XMLUtil
.
toBeanByJxab
(
XML
,
Z_MT_SD_002_PRICE_LIST
.
class
);
Z_MT_SD_002_PRICE_LIST
Z_MT_SD_002_PRICE_LIST
=
XMLUtil
.
toBeanByJxab
(
XML
,
Z_MT_SD_002_PRICE_LIST
.
class
);
service
.
execute
(
Z_MT_SD_002_PRICE_LIST
);
service
.
execute
(
Z_MT_SD_002_PRICE_LIST
);
...
...
src/test/java/test/ShippingNotificationTest.java
View file @
46ffeabe
...
@@ -12,7 +12,7 @@ public class ShippingNotificationTest {
...
@@ -12,7 +12,7 @@ public class ShippingNotificationTest {
String
wsdlLocation
=
"http://localhost:8080/api/services/shipping_notification?wsdl"
;
String
wsdlLocation
=
"http://localhost:8080/api/services/shipping_notification?wsdl"
;
String
namespace
=
"http://shipping_notfirmation.sso.egolm.com"
;
String
namespace
=
"http://shipping_notfirmation.sso.egolm.com"
;
String
serviceName
=
"ShippingNotificationService"
;
String
serviceName
=
"ShippingNotificationService"
;
ShippingNotificationService
service
=
ServiceFactory
.
create
(
ShippingNotificationService
.
class
,
wsdlLocation
,
namespace
,
serviceName
,
"test"
,
""
,
"PasswordText"
);
ShippingNotificationService
service
=
ServiceFactory
.
create
(
ShippingNotificationService
.
class
,
wsdlLocation
,
namespace
,
serviceName
,
"test"
,
""
);
String
XML
=
StringUtil
.
readText
(
"D:/data/sso/007.XML"
);
String
XML
=
StringUtil
.
readText
(
"D:/data/sso/007.XML"
);
Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE
Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE
=
XMLUtil
.
toBeanByJxab
(
XML
,
Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE
.
class
);
Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE
Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE
=
XMLUtil
.
toBeanByJxab
(
XML
,
Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE
.
class
);
service
.
execute
(
Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE
);
service
.
execute
(
Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE
);
...
...
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