用于 REST WCF 的 WSDL [英] WSDL for REST WCF

查看:36
本文介绍了用于 REST WCF 的 WSDL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过在 web.config 中指定 WebGET 和 WebHttpBinding 在 C# 中创建了一个 REST WCF.该服务通过 IE 运行良好.我的 wsdl 如下所示,它在 wsdl 中有肥皂.由于这是 REST,所以 wsdl 中不应该存在肥皂吗?

I've created a REST WCF in C# by specifying WebGET and WebHttpBinding in web.config. The service works fine through IE. My wsdl starts as below and it has soap in wsdl. Since this is REST, should'nt the soap be present in wsdl.

WSDL:

  <?xml version="1.0" encoding="utf-8" ?> 
 <wsdl:definitions name="ServiceImp" targetNamespace="http://tempuri.org/"    
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" 
    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
    xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" 
    xmlns:tns="http://tempuri.org/" 
    xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" 
    xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" 
    xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" 
    xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" 
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" 
    xmlns:wsa10="http://www.w3.org/2005/08/addressing" 
    xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex">

在上面的wsdl中,既然是HTTP,那么为什么SOAP内容会出现在REST服务中?

In the above wsdl, Since this is HTTP, why is the soap content coming in REST service?

谢谢,Vinoth Khanna.S

Thanks, Vinoth Khanna.S

推荐答案

WCF 无法描述 REST 服务.REST 服务可以用 WADL 或 WSDL 2.0 来描述,但 WCF 不支持任何这些描述语言.

WCF is not able to describe REST service. REST service can be described by WADL or WSDL 2.0 but WCF doesn't support any of these description languages.

这篇关于用于 REST WCF 的 WSDL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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