WCF REST Webサービスは、次の形式でルックアップを提供します。
https://mysite/mycontract/search/{searchtext}
helloまたはhello%20worldの検索テキストであり、サービスは正しく実行されます。ただし、https:// mysite / mycontract / search / hello%20のように空白で終わるテキストを使用すると、サービスは404で失敗します。カスタムルーティングはありません。
wcfルーティングのどのような制限がこれを引き起こし、どのような回避策(理想的にはURI構造の変更以外)が利用可能ですか?
追加の実装情報を使用して編集します。
契約する
[ServiceContract(SessionMode = SessionMode.NotAllowed)]
public interface IPointOfSale
{
.......
[WebInvoke(UriTemplate = "search/{SKU}", Method = "GET")]
System.Xml.Linq.XElement ProductLookup(string SKU);
}
方法
public XElement ProductLookup(string SKU)
{
//product search here.
}