1

I created a couple of WCF services. One very robust one that can accept both SOAP and RESTful requests, and provide XML and JSON responses.

--EDIT: FYI: Enabling an SOAP endpoint to accept a RESTful request requires the use of [WebGet..., and as such, all input parameters must be of type string.

The other, a simple RESTful connector. The WSDL for the first service validates, however for the second, very simple RESTful connector - invalid.

I was using WSDL2Java to to complete the connection process, but fails, due to an invalid WSDL.

Am I mistaken in thinking that WSDL v2.0 is being generated?

Here is the WSDL from the service:

<?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>
John Saunders
  • 160,644
  • 26
  • 247
  • 397
ElHaix
  • 12,846
  • 27
  • 115
  • 203
  • Has anyone else encountered issues when trying to read a WSDL created for RESTful service with .Net v4.0? – ElHaix Nov 18 '11 at 17:10

1 Answers1

0

.NET does not support WSDL v2. This is WSDL 1.0.


According to XMLSpy:

attribute 'element' in message part 'parameters' (message 'IRESTService_GetXMLData_InputMessage') refers to element 'tns:GetXMLData' which is not defined within the WSDL file!

John Saunders
  • 160,644
  • 26
  • 247
  • 397
  • John, thanks... WSDL 1.0 was not able to handle RESTful definitions, so then I am guessing that would be why the WSDL is invalid, correct? – ElHaix Nov 18 '11 at 17:19