@techspokes/typescript-wsdl-client 0.4.2 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"clientEmitter.d.ts","sourceRoot":"","sources":["../../src/emit/clientEmitter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,+BAA+B,CAAC;AAGnE,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,QAgWpE"}
1
+ {"version":3,"file":"clientEmitter.d.ts","sourceRoot":"","sources":["../../src/emit/clientEmitter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,+BAA+B,CAAC;AAGnE,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,QAuWpE"}
@@ -23,6 +23,10 @@ export function emitClient(outFile, compiled) {
23
23
  : `[${JSON.stringify(op.name)}]`;
24
24
  const inTypeName = op.inputElement ? pascal(op.inputElement.local) : undefined;
25
25
  const outTypeName = op.outputElement ? pascal(op.outputElement.local) : undefined;
26
+ if (!inTypeName && !outTypeName) {
27
+ console.warn(`Operation ${op.name} has no input or output type defined. Skipping method generation.`);
28
+ continue;
29
+ }
26
30
  const inTs = inTypeName ? `T.${inTypeName}` : `any`;
27
31
  const outTs = outTypeName ? `T.${outTypeName}` : `any`;
28
32
  const secHints = Array.isArray(op.security) && op.security.length ? op.security : [];
@@ -41,7 +45,8 @@ export function emitClient(outFile, compiled) {
41
45
  return this.call<${inTs}, ${outTs}, HeadersType>(
42
46
  args,
43
47
  ${JSON.stringify(m)},
44
- ${JSON.stringify(m)}
48
+ ${inTypeName ? JSON.stringify(inTypeName) : "undefined"},
49
+ ${outTypeName ? JSON.stringify(outTypeName) : "undefined"}
45
50
  );
46
51
  }`;
47
52
  methods.push(methodTemplate);
@@ -173,6 +178,7 @@ ${methodsBody}
173
178
  *
174
179
  * @param args - The request arguments/payload for the operation.
175
180
  * @param operation - The name of the SOAP operation to invoke.
181
+ * @param requestType - The metadata type name for request serialization.
176
182
  * @param responseType - The metadata type name for response deserialization.
177
183
  * @returns A promise resolving to the operation response containing data, headers, and raw XML.
178
184
  * @throws Error if the specified operation is not found on the SOAP client.
@@ -180,6 +186,7 @@ ${methodsBody}
180
186
  protected async call<RequestType, ResponseType, HeadersType>(
181
187
  args: RequestType,
182
188
  operation: string,
189
+ requestType: string,
183
190
  responseType: string
184
191
  ): Promise<${clientName}Response<ResponseType, HeadersType>> {
185
192
  const client = await this.soapClient();
@@ -187,7 +194,7 @@ ${methodsBody}
187
194
  throw new Error("Operation not found on SOAP client: " + operation);
188
195
  }
189
196
  // Convert TypeScript object to the format expected by node-soap
190
- const soapArgs = this.toSoapArgs(args, responseType);
197
+ const soapArgs = this.toSoapArgs(args, requestType);
191
198
  return new Promise((resolve, reject) => {
192
199
  client[operation](soapArgs, (err: any, result: any, rawResponse: string, soapHeader: any, rawRequest: string) => {
193
200
  if (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@techspokes/typescript-wsdl-client",
3
- "version": "0.4.2",
3
+ "version": "0.5.1",
4
4
  "description": "TypeScript WSDL → SOAP client generator with full xs:attribute support, complex types, sequences, inheritance, and namespace-collision merging.",
5
5
  "keywords": [
6
6
  "wsdl",