lula / ngx-soap

Simple SOAP client for Angular
MIT License
66 stars 61 forks source link

Upload Attachment MTOM,I want achieve along with document and xml. #49

Closed swaminathanmca closed 4 years ago

swaminathanmca commented 5 years ago

import { NgxSoapService, Client, ISoapMethodResponse } from 'ngx-soap'; import { from } from 'rxjs' constructor(private soap: NgxSoapService) { const promise = this.soap.createClient('serviceimplPort') from(promise).subscribe(client => this.client = client); } fileChange(event) { const fileList: FileList = event.target.files; this.fileName = fileList[0].name; this.selectedFile = event.target.files[0]; } onSubmit(document) { const token = wsse({ username: this.userName, password: this.password });

const body = {
  file: this.selectedFile
};

'' + ''+this.userName+'</wsse:Username>' + '' + token.getPasswordDigest() + '</wsse:Password>' + token.getNonceBase64() + '</wsse:Nonce>' + token.getCreated() + '</wsu:Created></wsse:UsernameToken></wsse:Security>' + '</soapenv:Header>' + '' + ''+ ''+ document + '</wsdl:DocumentType>'+ ' '+ this.fileName+ '</wsdl:Subject>'+ ' '+ ' cid:'+ this.fileName+ '</wsdl:href>'+ ' </wsdl:PayloadName>'+ ' '+ ' ?</wsdl:href>'+ ' </wsdl:AttachmentFile>'+ ' </wsdl:SubmitMessageRequest>'+ ' </wsdl:MessageSubmission>'+ '</soapenv:Body>' + '</soapenv:Envelope>'; (this.client).Add(body).subscribe((res: ISoapMethodResponse) => console.log(res.result.AddResult)); }

err

lula commented 4 years ago

MTOM support has been added, with #70 , thanks to @kverhoef.