none
Custom Verb in WCF RRS feed

  • Question

  • Hi to everyone,

    OPTIONS is a unique HTTP methods which implies the server itself, if the request URI is *.  How to create a custom verb with same features as OPTIONS in WCF service.

    Kindly share us any link.


    MIB

    • Moved by Sabah ShariqMVP Tuesday, May 16, 2017 11:21 AM Moved From Visual C#
    Tuesday, May 16, 2017 10:57 AM

All replies

  • Hi,

    This is Visual C# forum. As your issue is related to service I am moving your thread to WCF forum for getting quick response.

    Your understanding and cooperation will be grateful.

    Thanks,
    Sabah Shariq

    [If a post helps to resolve your issue, please click the "Mark as Answer" of that post or click Answered "Vote as helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]

    Tuesday, May 16, 2017 11:20 AM
  • In my option, * is only supported in OPTIONS, we may not able to custom a verb like OPTIONS and there is no specific function with “*”.

    An OPTIONS request with an asterisk ("*") as the request-target(Section 5.3 of [RFC7230]) applies to the server in general rather than to a specific resource.  Since a server's communication options typically depend on the resource, the "*" request is only useful as a "ping" or "no-op" type of method; it does nothing beyond allowing the client to test the capabilities of the server.

    Reference: https://tools.ietf.org/html/rfc7231#section-4.3.7

    >> VERB * HTTP/1.1 with WCF self hosted rest service

    In above similar thread, you will find this op send request with CustomVerb *, he got “HTTP Error 400. The request URL is invalid”.

    400 Bad Request

    The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, too large size, invalid request message framing, or deceptive request routing)

    Per to this, it is client error. We could not custom it in server side. And I think this is valid by HTTP protocol, we could not custom this behavior.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, May 17, 2017 2:22 AM