views:

459

answers:

1

Hi,

i got a webservicedefinition like this:

    [OperationContract]
    [FaultContract(typeof(Exception))]
    [WebInvoke(ResponseFormat = WebMessageFormat.Xml,
            BodyStyle = WebMessageBodyStyle.Wrapped,
            RequestFormat = WebMessageFormat.Xml)]
    SearchResponse SearchXML(SearchRequest req);

and a Service config like this:

  <service name="SearchEngine.SearchService" behaviorConfiguration="HTTPGetBehavior">
    <endpoint address="SearchEngine.SearchService" behaviorConfiguration="ajaxBehavior" binding="webHttpBinding" contract="SearchEngine.ISearchInterface" />
    <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8800/SearchService" />
      </baseAddresses>
    </host>
  </service>

and i want to get the WSDL file, which should be possible with a HTTP-GET request like this:

 http://localhost:8800/SearchService?wsdl

But all iam getting is a "method not allowed message by the wcf-service"

What am i doing wrong? I want the WSDL information to show the structure of request and response to an external client ( so that he can prepare his function calls )

Thanks

+2  A: 

Well, if I read the binding correctly, you're using the "webHttpBinding" which is a REST interface.

REST does not have anything like the WSDL file - that's a SOAP thing.

REST is considered easier to use and simpler to understand - but it doesn't have the amount of metadata that a typical SOAP web service will have.

So basically, if you stick with REST (webHttpBinding), you can't have a WSDL - you have to find another way to communicate your service methods exposed and the possible parameters they expect.

There seem to be efforts under way to come up with something similar to a WSDL for REST called Web Application Description Language (WADL) but I don't know how far that effort has come, and as far as I know, the WCF REST starter kit doesn't support any of that just yet.

Check out some links for WADL:

Marc

marc_s
Yes, i did that already, so it's just missing in the code above... any other ideas?
David