1

I have a REST web service which has a method like this:

[OperationContract]
[WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Xml,
  BodyStyle = WebMessageBodyStyle.Bare,
  UriTemplate = "?T={TransmissionReference}&ID={CustomerId}")]
ResponseArray DoLookup(string TransmissionReference, string CustomerId);

In my web.config file, I have set up a service:

<services>
  <service name="PropertyWS.Service">
    <endpoint address="http://localhost:51173/Service.svc/DoLookup"
              behaviorConfiguration="webBehavior"
              binding="webHttpBinding"
              bindingConfiguration="webHttpBindingConfig"
              bindingNamespace="urn:mdWebServiceProperty"
              contract="PropertyWS.IService"
              name="PropertyWSRESTEndpoint"/>
  </service>
</services>

However, this is clumsy, as it forces my IIS guy to 'fix' the endpoint address when he installs it to IIS. Ideally, I want my WebInvoke's UriTemplate to be:

/DoLookup?T={TransmissionReference}&ID={CustomerId}

and my web.config endpoint address to be "". This works for the XML and SOAP versions of the same web service, but not for REST. Instead I get an "Endpoint not Found" WCF page.

4

0 回答 0