diff options
Diffstat (limited to 'lib/soap/sender.ts')
| -rw-r--r-- | lib/soap/sender.ts | 20 |
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); |
