summaryrefslogtreecommitdiff
path: root/lib/soap/sender.ts
diff options
context:
space:
mode:
authorjoonhoekim <26rote@gmail.com>2025-08-25 10:52:24 +0000
committerjoonhoekim <26rote@gmail.com>2025-08-25 10:52:24 +0000
commit83f67ed333f0237b434a41d1eceef417c0d48313 (patch)
treeeb911edaccf778e78be5564416748ff577a8aa76 /lib/soap/sender.ts
parent780d56edd3772813b4e557061a3c90d9f7d1ddd0 (diff)
(김준회) 설정 변경 및 WSDL namespace 반영, 로그인 완료시 dashboard 이동 (콜백 없을 때)
Diffstat (limited to 'lib/soap/sender.ts')
-rw-r--r--lib/soap/sender.ts20
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/soap/sender.ts b/lib/soap/sender.ts
index 580d0c5a..5a61462e 100644
--- a/lib/soap/sender.ts
+++ b/lib/soap/sender.ts
@@ -12,11 +12,12 @@ export interface SoapAuthConfig {
// SOAP 전송 설정 타입
export interface SoapSendConfig {
endpoint: string;
- envelope: Record<string, any>;
+ envelope: Record<string, unknown>;
soapAction?: string;
timeout?: number;
retryCount?: number;
retryDelay?: number;
+ namespace?: string; // 네임스페이스를 동적으로 설정할 수 있도록 추가
}
// 로깅 정보 타입
@@ -64,8 +65,8 @@ function createXmlBuilder() {
// SOAP Envelope 생성
function createSoapEnvelope(
namespace: string,
- bodyContent: Record<string, any>
-): Record<string, any> {
+ bodyContent: Record<string, unknown>
+): Record<string, unknown> {
return {
'soap:Envelope': {
'@_xmlns:soap': 'http://schemas.xmlsoap.org/soap/envelope/',
@@ -77,7 +78,7 @@ function createSoapEnvelope(
// XML 생성
export async function generateSoapXml(
- envelope: Record<string, any>,
+ envelope: Record<string, unknown>,
xmlDeclaration: string = '<?xml version="1.0" encoding="UTF-8"?>\n'
): Promise<string> {
const builder = createXmlBuilder();
@@ -95,9 +96,10 @@ export async function sendSoapXml(
// 인증 정보 설정 (기본값 사용)
const authConfig = auth || getDefaultAuth();
- // XML 생성
+ // XML 생성 (네임스페이스를 동적으로 설정)
+ const namespace = config.namespace || 'http://shi.samsung.co.kr/P2_MD/MDZ';
const soapEnvelope = createSoapEnvelope(
- 'http://shi.samsung.co.kr/P2_MD/MDZ',
+ namespace,
config.envelope
);
@@ -249,7 +251,7 @@ export async function sendSoapXmlWithRetry(
// 간단한 SOAP 전송 함수 (기본 설정 사용)
export async function sendSimpleSoapXml(
endpoint: string,
- bodyContent: Record<string, any>,
+ bodyContent: Record<string, unknown>,
logInfo: SoapLogInfo,
options?: {
namespace?: string;
@@ -263,6 +265,7 @@ export async function sendSimpleSoapXml(
envelope: bodyContent,
soapAction: options?.soapAction,
timeout: options?.timeout || 30000, // 기본 30초
+ namespace: options?.namespace, // 네임스페이스 옵션 추가
};
const auth = options?.auth || getDefaultAuth();
@@ -272,7 +275,7 @@ export async function sendSimpleSoapXml(
// MDG 전용 SOAP 전송 함수 (기존 action.ts와 호환)
export async function sendMdgSoapXml(
- bodyContent: Record<string, any>,
+ bodyContent: Record<string, unknown>,
logInfo: SoapLogInfo,
auth?: SoapAuthConfig
): Promise<SoapSendResult> {
@@ -281,6 +284,7 @@ export async function sendMdgSoapXml(
envelope: bodyContent,
soapAction: 'http://sap.com/xi/WebService/soap1.1',
timeout: 60000, // MDG는 60초 타임아웃
+ namespace: 'http://shi.samsung.co.kr/P2_MD/MDZ', // MDG 전용 네임스페이스 명시
};
return await sendSoapXml(config, logInfo, auth);