我知道我们可以在Angular
应用程序中使用Restful服务
,但我的客户给了我一个类似这样的web服务
http://123.618.196.10/WCFTicket/Service1.svc?wsdl
。我的问题是,我能在Angular
应用程序中使用它吗?我从未使用过它,有什么提示吗?
我知道我们可以在Angular
应用程序中使用Restful服务
,但我的客户给了我一个类似这样的web服务
http://123.618.196.10/WCFTicket/Service1.svc?wsdl
。我的问题是,我能在Angular
应用程序中使用它吗?我从未使用过它,有什么提示吗?
ngx-soap是一款非常优秀的库,我在我们的一个客户项目中使用过。
以下是使用此库的步骤。
第一步:安装ngx-soap及其依赖项。
npm install --save ngx-soap
npm install --save buffer concat-stream core-js crypto-js events lodash sax stream uuid
第二步:
import { NgxSoapModule } from 'ngx-soap';
...
@NgModule({
imports: [ ..., NgxSoapModule, ... ]
...
步骤三:在你的组件中注入NgxSoapService
...
import { NgxSoapService, Client, ISoapMethodResponse } from 'ngx-soap';
...
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
client: Client;
constructor(private soap: NgxSoapService) {
this.soap.createClient('http://123.618.196.10/WCFTicket/Service1.svc?wsdl').subscribe(client => this.client = client);
}
}
WSDL
服务的详细信息吗?当我在浏览器中打开它时,细节不清楚。例如,公开方法名称
,参数
等。例如:http://www.thomas-bayer.com/axis2/services/BLZService?wsdl - Sampath