Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 来自.Net 4.0 Framework的RESTful WSDL v2.0无效_Asp.net_Wcf_Wsdl_Wcf Rest_Wsdl2java - Fatal编程技术网

Asp.net 来自.Net 4.0 Framework的RESTful WSDL v2.0无效

Asp.net 来自.Net 4.0 Framework的RESTful WSDL v2.0无效,asp.net,wcf,wsdl,wcf-rest,wsdl2java,Asp.net,Wcf,Wsdl,Wcf Rest,Wsdl2java,我创建了两个WCF服务。一个非常健壮的应用程序,可以接受SOAP和RESTful请求,并提供XML和JSON响应 --编辑:仅供参考:启用SOAP端点以接受RESTful请求需要使用[WebGet…,因此,所有输入参数必须为string类型 另一个是简单的RESTful连接器。第一个服务的WSDL验证第二个非常简单的RESTful连接器-无效 我使用WSDL2Java来完成连接过程,但由于WSDL无效而失败 我是否错误地认为正在生成WSDLV2.0 以下是来自服务的WSDL: <?xml

我创建了两个WCF服务。一个非常健壮的应用程序,可以接受SOAP和RESTful请求,并提供XML和JSON响应

--编辑:仅供参考:启用SOAP端点以接受RESTful请求需要使用[WebGet…,因此,所有输入参数必须为string类型

另一个是简单的RESTful连接器。第一个服务的WSDL验证第二个非常简单的RESTful连接器-无效

我使用WSDL2Java来完成连接过程,但由于WSDL无效而失败

我是否错误地认为正在生成WSDLV2.0

以下是来自服务的WSDL:

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions name="RESTService" targetNamespace="http://antennasoftware.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:tns="http://antennasoftware.com" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
    <wsdl:types>
        <xsd:schema targetNamespace="http://antennasoftware.com/Imports">
            <xsd:import schemaLocation="http://localhost/VRPCWebServices/RestService.svcxsd=xsd0" namespace="http://antennasoftware.com"/>
            <xsd:import schemaLocation="http://localhost/VRPCWebServices/RestService.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
        </xsd:schema>
    </wsdl:types>
    <wsdl:message name="IRESTService_GetXMLData_InputMessage">
        <wsdl:part name="parameters" element="tns:GetXMLData"/>
    </wsdl:message>
    <wsdl:message name="IRESTService_GetXMLData_OutputMessage">
        <wsdl:part name="parameters" element="tns:GetXMLDataResponse"/>
    </wsdl:message>
    <wsdl:message name="IRESTService_GetJSONData_InputMessage">
        <wsdl:part name="parameters" element="tns:GetJSONData"/>
    </wsdl:message>
    <wsdl:message name="IRESTService_GetJSONData_OutputMessage">
        <wsdl:part name="parameters" element="tns:GetJSONDataResponse"/>
    </wsdl:message>
    <wsdl:portType name="IRESTService">
        <wsdl:operation name="GetXMLData">
            <wsdl:input wsaw:Action="http://antennasoftware.com/IRESTService/GetXMLData" message="tns:IRESTService_GetXMLData_InputMessage"/>
            <wsdl:output wsaw:Action="http://antennasoftware.com/IRESTService/GetXMLDataResponse" message="tns:IRESTService_GetXMLData_OutputMessage"/>
        </wsdl:operation>
        <wsdl:operation name="GetJSONData">
            <wsdl:input wsaw:Action="http://antennasoftware.com/IRESTService/GetJSONData" message="tns:IRESTService_GetJSONData_InputMessage"/>
            <wsdl:output wsaw:Action="http://antennasoftware.com/IRESTService/GetJSONDataResponse" message="tns:IRESTService_GetJSONData_OutputMessage"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:service name="RESTService"/>
</wsdl:definitions>

.NET不支持WSDL v2。这是WSDL 1.0


据XMLSpy称:

消息部分“参数”(消息)中的属性“元素” “IRESTService_GetXMLData_InputMessage”)指的是元素 “tns:GetXMLData”未在WSDL文件中定义


其他人在尝试使用.NETV4.0读取为RESTful服务创建的WSDL时是否遇到问题?John,谢谢……WSDL1.0无法处理RESTful定义,所以我猜这就是WSDL无效的原因,对吗?