npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

ngx-soap-next

v0.20.2

Published

SOAP service for Angular

Readme

ngx-soap-next

npm version Angular

Simple SOAP client for Angular based on node-soap.

✨ Angular 20 Ready with full support for signals, standalone components, and modern features.

🔄 Backwards Compatible - Works with Angular 10+ (both NgModule and standalone).

Installation

npm install ngx-soap-next
npm install buffer concat-stream core-js crypto-js events lodash sax stream debug

Quick Start

Standalone Components (Angular 14+)

Recommended for new applications

// main.ts
import { bootstrapApplication } from '@angular/platform-browser';
import { provideHttpClient } from '@angular/common/http';
import { provideNgxSoap } from 'ngx-soap-next';

bootstrapApplication(AppComponent, {
  providers: [
    provideHttpClient(),
    provideNgxSoap()
  ]
});

NgModule-based Applications

For existing NgModule apps

import { NgModule } from '@angular/core';
import { NgxSoapModule } from 'ngx-soap-next';

@NgModule({
  imports: [NgxSoapModule]
})
export class AppModule { }

Usage Examples

Basic Usage (All Angular Versions)

import { Component, inject } from '@angular/core';
import { NgxSoapService, Client, ISoapMethodResponse } from 'ngx-soap-next';

@Component({
  selector: 'app-calculator',
  standalone: true
})
export class CalculatorComponent {
  private soap = inject(NgxSoapService);
  client: Client | null = null;

  async ngOnInit() {
    this.client = await this.soap.createClient('assets/calculator.wsdl');
  }

  calculate(a: number, b: number) {
    if (!this.client) return;
    
    (this.client as any).Add({ intA: a, intB: b })
      .subscribe((res: ISoapMethodResponse) => {
        console.log('Result:', res.result.AddResult);
      });
  }
}

Angular 20+ with Modern Features

import { Component, computed, model, inject, resource } from '@angular/core';
import { NgxSoapService, ISoapMethodResponse } from 'ngx-soap-next';

@Component({
  selector: 'app-calculator',
  standalone: true,
  template: `
    @if (soapClient.isLoading()) {
      <p>Loading...</p>
    }
    @if (soapClient.error()) {
      <p>Error: {{ soapClient.error()?.message }}</p>
    }
    @if (soapClient.value()) {
      <input type="number" [(ngModel)]="intA">
      <input type="number" [(ngModel)]="intB">
      <button (click)="calculate()" [disabled]="!isValid()">Calculate</button>
      <p>Result: {{ result() }}</p>
    }
  `
})
export class CalculatorComponent {
  private soap = inject(NgxSoapService);
  
  // 🆕 Angular 20 features
  intA = model<number>(0);
  intB = model<number>(0);
  result = signal('');
  
  isValid = computed(() => !isNaN(this.intA()) && !isNaN(this.intB()));
  
  soapClient = resource({
    loader: () => this.soap.createClient('assets/calculator.wsdl')
  });

  calculate() {
    const client = this.soapClient.value();
    if (!client) return;
    
    (client as any).Add({ intA: this.intA(), intB: this.intB() })
      .subscribe((res: ISoapMethodResponse) => {
        this.result.set(res.result.AddResult);
      });
  }
}

API Reference

provideNgxSoap()

Provider function for standalone applications.

provideNgxSoap(): EnvironmentProviders

NgxSoapModule

NgModule for traditional applications. Includes NgxSoapService and HttpClient.

NgxSoapService

Main service for creating SOAP clients.

createClient(wsdlUrl, options?, endpoint?): Promise<Client>

Creates a SOAP client from a WSDL URL.

Parameters:

  • wsdlUrl - URL to WSDL file (relative or absolute)
  • options - Optional configuration object
  • endpoint - Optional endpoint override

Returns: Promise that resolves to a SOAP Client

Example:

const client = await this.soap.createClient('assets/service.wsdl');

Configuration Options

Common options for createClient():

{
  endpoint: 'https://api.example.com/soap',  // Override WSDL endpoint
  forceSoap12Headers: false,                  // Use SOAP 1.2
  returnFault: true,                          // Return faults as data
  envelopeKey: 'soap',                        // Envelope prefix
  disableCache: true,                         // Disable WSDL cache
  exchangeId: 'custom-id'                     // Request tracking ID
}

See full options list.

Security

Basic Authentication

import { security } from 'ngx-soap-next';

const client = await this.soap.createClient('service.wsdl');
client.setSecurity(new security.BasicAuthSecurity('user', 'pass'));

Bearer Token

client.setSecurity(new security.BearerSecurity('your-token'));

WS-Security

const wsSecurity = new security.WSSecurity('user', 'pass', {
  passwordType: 'PasswordText',
  hasTimeStamp: true
});
client.setSecurity(wsSecurity);

See all security options: BasicAuthSecurity, BearerSecurity, WSSecurity, WSSecurityCert, WSSecurityCertWithToken, WSSecurityPlusCert.

Version History

This package version follows Angular versions:

  • 0.20.x = Angular 20
  • 0.19.x = Angular 19
  • 0.18.x = Angular 18

See CHANGELOG.md for details.

Development

# Install dependencies
npm install

# Run tests
npm test
npm run test:lib          # Library only
npm run test:coverage     # With coverage

# Build
npm run build:lib         # Build library
npm run build             # Build example app

# Dev server
npm start

See example app in src/app/ for full working demos.

Publishing (Maintainers)

# Version bump
npm run bump:patch        # 0.20.0 → 0.20.1
npm run bump:minor        # 0.20.0 → 0.21.0

# Build and publish
npm run build:lib:publish
# or
npm run build:lib:publish:dry-run

License

MIT

Links

Credits

Based on node-soap by vpulim.

Maintainers: