From 83f67ed333f0237b434a41d1eceef417c0d48313 Mon Sep 17 00:00:00 2001 From: joonhoekim <26rote@gmail.com> Date: Mon, 25 Aug 2025 10:52:24 +0000 Subject: (김준회) 설정 변경 및 WSDL namespace 반영, 로그인 완료시 dashboard 이동 (콜백 없을 때) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/soap/sender.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'lib/soap/sender.ts') 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; + envelope: Record; soapAction?: string; timeout?: number; retryCount?: number; retryDelay?: number; + namespace?: string; // 네임스페이스를 동적으로 설정할 수 있도록 추가 } // 로깅 정보 타입 @@ -64,8 +65,8 @@ function createXmlBuilder() { // SOAP Envelope 생성 function createSoapEnvelope( namespace: string, - bodyContent: Record -): Record { + bodyContent: Record +): Record { return { 'soap:Envelope': { '@_xmlns:soap': 'http://schemas.xmlsoap.org/soap/envelope/', @@ -77,7 +78,7 @@ function createSoapEnvelope( // XML 생성 export async function generateSoapXml( - envelope: Record, + envelope: Record, xmlDeclaration: string = '\n' ): Promise { 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, + bodyContent: Record, 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, + bodyContent: Record, logInfo: SoapLogInfo, auth?: SoapAuthConfig ): Promise { @@ -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); -- cgit v1.2.3