summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/soap/mdg/send/vendor-master/action.ts22
1 files changed, 17 insertions, 5 deletions
diff --git a/lib/soap/mdg/send/vendor-master/action.ts b/lib/soap/mdg/send/vendor-master/action.ts
index ae0c2c89..e0bd7009 100644
--- a/lib/soap/mdg/send/vendor-master/action.ts
+++ b/lib/soap/mdg/send/vendor-master/action.ts
@@ -624,7 +624,7 @@ export async function getVendorSendStatistics(): Promise<{
export async function sendTestVendorDataToMDG(formData: Record<string, string>): Promise<{
success: boolean;
message: string;
- responseData?: any;
+ responseData?: unknown;
}> {
try {
console.log('πŸ§ͺ ν…ŒμŠ€νŠΈμš© VENDOR 데이터 SOAP 솑신 μ‹œμž‘');
@@ -728,12 +728,24 @@ export async function sendVendorEnvelopeToMDG(envelope: string): Promise<{
// 직접 XML μ „μ†‘μ˜ 경우 κΈ°μ‘΄ fetch 방식 μœ μ§€
const MDG_ENDPOINT_URL = "http://shii8dvddb01.hec.serp.shi.samsung.net:50000/sap/xi/engine?type=entry&version=3.0&Sender.Service=P2038_D&Interface=http%3A%2F%2Fshi.samsung.co.kr%2FP2_MD%2FMDZ%5EP2MD3007_AO&QualityOfService=ExactlyOnce";
+ // 인증 헀더 μ€€λΉ„
+ const headers: Record<string, string> = {
+ 'Content-Type': 'text/xml; charset=utf-8',
+ 'SOAPAction': 'http://sap.com/xi/WebService/soap1.1',
+ };
+
+ // Basic Authentication 헀더 μΆ”κ°€
+ if (MDG_SOAP_USERNAME && MDG_SOAP_PASSWORD) {
+ const credentials = Buffer.from(`${MDG_SOAP_USERNAME}:${MDG_SOAP_PASSWORD}`).toString('base64');
+ headers['Authorization'] = `Basic ${credentials}`;
+ console.log('πŸ” Basic Authentication 헀더 μΆ”κ°€ μ™„λ£Œ');
+ } else {
+ console.warn('⚠️ MDG SOAP 인증 정보가 ν™˜κ²½λ³€μˆ˜μ— μ„€μ •λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€.');
+ }
+
const res = await fetch(MDG_ENDPOINT_URL, {
method: 'POST',
- headers: {
- 'Content-Type': 'text/xml; charset=utf-8',
- 'SOAPAction': 'http://sap.com/xi/WebService/soap1.1',
- },
+ headers,
body: envelope,
});