node.js 中的 WCF Web 服务 [英] WCF web service in node.js

查看:31
本文介绍了node.js 中的 WCF Web 服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能帮我说说下面的代码有什么问题

Can anyone help me saying whats wrong with the below code

var BasicHttpBinding = require('wcf.js').BasicHttpBinding
, Proxy = require('wcf.js').Proxy
, binding = new BasicHttpBinding()
, proxy = new Proxy(binding,"http://www.restfulwebservices.net/wcf/WeatherForecastService.svc")
, message = '<Envelope xmlns=' +
        '"http://schemas.xmlsoap.org/soap/envelope/">' +
             '<Header />' +
               '<Body>' +
                 '<GetCitiesByCountry xmlns="http://www.restfulwebservices.net/ServiceContracts/2008/01">' +
                  '<Country>korea</Country>' +
                  '</GetCitiesByCountry>' +
                '</Body>' +
           '</Envelope>'

proxy.send(message, "http://www.restfulwebservices.net/ServiceContracts/2008/01/IWeatherForecastService/GetCitiesByCountry", function(response, ctx) {
console.log(response)
});

我收到以下错误

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault>  <faultcode xmlns:a="http://schemas.microsoft.com/ws/2005/05/addressing/none">a:ActionNotSupported</faultcode><faultstring xml:lang="en-US">The message with Action 'http://www.restfulwebservices.net/ServiceContracts/2008/01/IWeatherForecastService/GetCitiesByCountry' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver.  Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).</faultstring></s:Fault></s:Body></s:Envelope>

对此的任何帮助都会非常有帮助.

Any help on this will be really helpful.

谢谢

推荐答案

Wcf.js 仅支持soap 服务.您不能将 Wcf.js 用于 REST Web 服务.

Wcf.js supports only soap services. You cannot use Wcf.js for REST web services.

这篇关于node.js 中的 WCF Web 服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆