3

I want to call rest operation from jquery. I don't want to wait for the response, but instead,just confirm that it reached the server(status 202).

can I use [operationContarct(isOneWay="true"] in my IService ?

Is it as simple as calling any $.ajax to [operationContract([webInvoked(method="...")? Or do I need to apply further configurations... or maybe this kind of behavior is only suitable for request that are represented in soap messages.

What are my options (emphasis on performance: client/server)?

yoav barnea
  • 5,836
  • 2
  • 22
  • 27
  • Just because a WCF method has `IsOneWay=true` applied to it doesn't mean the caller isn't waiting for the call to be processed..... (it **will** wait - unless you have the async version of this call) – marc_s Feb 19 '12 at 17:00
  • what do you mean by async version of this call ? xml body for the request that looks like soap – yoav barnea Feb 19 '12 at 17:38
  • @marc_s maybe at crossed purposes here but IsOneWay=true means precisely that the client doesn't wait for a response. All it waits for is a TCP ACK that the packets were received - it doesn't wait for the message to be processed – Richard Blewett Feb 19 '12 at 19:43
  • @RichardBlewett: yes, that's what I meant - even with `IsOneWay=True`, the client still waits for an acknoledgement .... most folks believe the client returns immediately - not waiting for anything - but that's **NOT** the case..... – marc_s Feb 19 '12 at 20:46
  • the acknowledgement is the http status 202 i mentioned – yoav barnea Feb 20 '12 at 06:06

1 Answers1

0

My understanding is that oneway=true means that a 'void response object' will still be returned by the service when the method has processed, however it will not allow any fault exceptions to be returned to the caller.

Trevor Pilley
  • 16,156
  • 5
  • 44
  • 60
  • but does it need additional configuration in web.config for the server, special format for the body request +addition headers , or is it just working as any regular $.ajax() call from the client + the additional [operationContaract(IsOneWay="true")] attribute in wcf service and nothing more... – yoav barnea Feb 20 '12 at 11:15