WCF WebInvoke problem getting WSDL

I got webservicedefinition:

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

      

and service configuration like:

  <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 a WSDL file that should be possible with an HTTP GET request like this:

 http://localhost:8800/SearchService?wsdl

      

But all iam receiving is a message not allowed by wcf-service

What am I doing wrong? I want the WSDL information to display the structure of the request and response to the external client (so that it can prepare its function calls)

thank

+2


source to share


1 answer


Ok, if I read the binding correctly, you are using "webHttpBinding" which is a REST interface.

REST is n't doing something like a WSDL file - it's a SOAP thing.

REST is considered easier to use and easier to understand, but it lacks the amount of metadata that regular SOAP web services would have.

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



It looks like an effort is underway to come up with something similar to WSDL for REST called Web Application Description Language (WADL) , but I don't know how much that effort has brought, and as far as I know, the WCF REST starter kit does not yet support any of the them.

Check out some links for WADL:

Mark

+2


source







All Articles