I'm trying to create a WCF client to send XML messages to a CGI script. The script functions in a request-response pattern, where the contents of the XML message will determine the action to invoke.
I've starting by creating a service contract to represent the defined set of documents the CGI script will accept:
[ServiceContract]
public interface ICgiService
{
[OperationContract(Name="request1")]
[WebInvoke(BodyStyle = WebMessageBodyStyle.Bare)]
ServiceResponse SubmitRequest(Request1 request);
[OperationContract(Name="request2")]
[WebInvoke(BodyStyle = WebMessageBodyStyle.Bare)]
ServiceResponse SubmitRequest(Request2 request);
[OperationContract(Name="request3")]
[WebInvoke(BodyStyle = WebMessageBodyStyle.Bare)]
ServiceResponse SubmitRequest(Request3 request);
}
I have generated a proxy client from this interface and configured the endpoint with the address to the CGI script and to use HTTP Transport.
When a request is made, the default behaviour of the WCF runtime is to append the operation name to the endpoint address to make the URI http://server/script.cgi/request1
.
How do I modify this behaviour so all requests are sent to the endpoint address without any changes to the URI (e.g http://server/script.cgi
)?