autopulous / angular2-soap Goto Github PK
View Code? Open in Web Editor NEWAngular 2 SOAP client service (supports Angular 2 rc 4)
Angular 2 SOAP client service (supports Angular 2 rc 4)
Hello. I am trying to implement de the angular 2 soap in my ionic project. Unfortunality the compiler throws an error: Supplied parameters do not match any signature of call target.
In the tmp files the output is: get _SoapService_0_5():import4.SoapService {
if ((this.__SoapService_0_5 == (null as any))) { (this.__SoapService_0_5 = new import4.SoapService()); }
return this.__SoapService_0_5;
}
this is my whole home.ts file:
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import {SoapService} from "autopulous-angular2-soap/soap.service";
@component({
selector: 'page-home',
templateUrl: 'home.html',
providers: [SoapService]
})
export class Home {
private servicePort:string = 'http://172.16.62.111:8091';
private servicePath:string = '/your-application-ws/ws/';
private targetNamespace:string = '';
private responseJso:{} = null;
private soapService:SoapService;
constructor(public navCtrl: NavController) {
this.soapService = new SoapService(this.servicePort, this.servicePath, this.targetNamespace);
this.soapService.envelopeBuilder = this.envelopeBuilder;
this.soapService.jsoResponseHandler = (response:{}) => {this.responseJso = response};
this.soapService.localNameMode = true;
}
private username:string = '';
private password:string = '';
public login(username:string, password:string) {
var method:string = 'Login';
var parameters:{}[] = [];
this.username = username;
this.password = password;
parameters['LoginRequest xmlns="urn:application:security:messages:1:0"'] = Home.userLogin(username, password);
this.soapService.post(method, parameters);
}
private static userLogin(username, password):{}[] {
var parameters:{}[] = [];
parameters["UserName"] = username;
parameters['Password'] = password;
return parameters;
}
private envelopeBuilder(requestBody:string):string {
return "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
"<SOAP-ENV:Header>" +
"<wsse:Security SOAP-ENV:mustUnderstand=\"1\" xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\" soapenv =\"http://schemas.xmlsoap.org/soap/envelope/\">" +
"<wsse:UsernameToken wsu:ld=\"UsernameToken-104\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\" >" +
"<wsse:Username>" + this.username + "</wsse:Username>" +
"<wsse:Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText\">" + this.password + "</wsse:Password>" +
"</wsse:UsernameToken>" +
"</wsse:Security>" +
"</SOAP-ENV:Header>" +
"<SOAP-ENV:Body>" +
requestBody +
"</SOAP-ENV:Body>" +
"</SOAP-ENV:Envelope>";
}
}
Do you know how this error is caused?
Thank you in advance!
Jelle
How add basic authentification in header before send request
I'm using Angular 2 and my code is almost exactly like the example. The SOAP request is to a web service on a server other than what Node is running on. So this is a cross origin request.
Firefox tells me: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://192.168.208.19:1069/. This can be fixed by moving the resource to the same domain or enabling CORS.
I can see the preflight OPTIONS request. Returns with 200 OK. But in the console I see: TypeError: responseNodeList is null. Should handling be added for when user chosen options are not correct?
Creation of a fix for the new version of angular 2 with webpack
The module doesn't work anymore on this new version.
Hello @autopulous, I want to use this module with ionic framework 2. How i can integrate or install in my ionic v2 project. Thanks in advance.
can you please update to the latest version of angular2?
WARNING in ./~/autopulous-angular2-soap/soap.service.js
System.register is not supported by webpack.
@ ./src/app/app.service.ts 16:0-87
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts
As in example, found that providers: [SoapService]
used in user.authenticator.ts
So I did same in my demo application, but getting error like
"Uncaught TypeError: (void 0) is not a function", source: file:///android_asset/www/build/main.js (101810)" in android emulator
& while checked on chrome console I found below error
Failed to load resource: the server responded with a status of 404 (Not Found) xdom.js
Failed to load resource: the server responded with a status of 404 (Not Found) xdom2jso.js
Please help me out for this problem.
Hi
I've seen some of the other comments on integrating this module with ionic 2 which is AWESOME! but when trying to reference xdom2jso in index.html the file can't be found by the browser. I would really appreciate if you could have a look to see if there are any missing steps from your readme file as I have even run the watch-dev gulp task etc and still the problem is there. I could be missing something simple I will keep having a look but I would appreciate some feeback on your totally awesome module. Thanks again
Rocco
Hi @autopulous @Neoheurist ,
I installed npm package 'autopulous-xdom2jso', and imported service as well. But building my app throws me errors below. Please help in resolving this:
ERROR in [at-loader] src/app/services/soap.service.ts:6:18
TS2304: Cannot find name 'xdom2jso'.
ERROR in [at-loader] src/app/services/soap.service.ts:6:18
TS2503: Cannot find namespace 'xdom2jso'.
System.register(['@angular/core'], function(exports_1, context_1) { ...
This is not supported by webpack. Is there a workaround? Thanks.
Attempting to get this to run on Windows 10 using Visual Studio Code and built in Terminal- I confess extreme ignorance - but I followed your "Usage" directions 2 times - and always got the same errors in the log file.
Please advise - thanks!
npm-debug - Copy.txt
It is a nice start but it needs some error handling for when SOAP requests fail on the server. Currently adding my own.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.