【发布时间】:2011-05-17 12:26:23
【问题描述】:
我通过在 web.config 中指定 WebGET 和 WebHttpBinding 在 C# 中创建了一个 REST WCF。该服务通过 IE 运行良好。我的 wsdl 开始如下,它在 wsdl 中有肥皂。由于这是 REST,soap 不应该出现在 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服务呢?
谢谢, Vinoth Khanna.S
【问题讨论】:
-
REST 没有 WSDL ..... 不完全确定 what 你在这里看......另外:REST 服务没有任何 SOAP 内容.....
-
你还没有发布你的整个 WSDL……
-
是的,我不会发布我的整个 wsdl。那么,当我在服务后提供 ?wsdl 时,它显示 wsdl 是怎么回事?
-
嗨...我刚刚创建了一个 REST 服务,就像我创建 WCF 一样。我应该遵循在 3.5 中创建 REST WCF 的任何其他方式吗?