Re: Explicit response required from WS methods?
Nice answer, thanks Guy. I will have need for some asynchronous requests** but this particular request (deleteEmployee) would definitely be synchronous. ** and I'm asuming that I can mix and match sycn and async in the same service, though I haven't yet worked out how to indicate that to java2wsdl, and suspect that I'll have to manually edit the generated wsdl. From: Guy Rixon <[EMAIL PROTECTED]> Reply-To: axis-user@ws.apache.org To: axis-user@ws.apache.org Subject: Re: Explicit response required from WS methods? Date: Wed, 31 Aug 2005 17:15:26 +0100 (BST) Hi, void is fine, and saves a little parsing on the return. If it works, then the service returns an HTTP 200 with a SOAP body that doesn't need deserializing; the client stub returns quietly. If it goes wrong, then the client stub chucks an Exception in which the detail states the HTTP status-code. Architecturally, there's a deeper point. Suppose that your service could return an HTTP 200 with no body; i.e. suppose you could implement a one-way operation which Axis 2 supports and Axis 1 doesn't. Would this be a good equivalent to a method returning void? Yes, in the sense that less XML handling would be involved. No, in the sense that the 200 might come back before the service had processed the request; i.e. the work would be asynchronous. An asynchronous request to a service is not a good match to a method returning void. On Wed, 31 Aug 2005, Jarmo Doc wrote: > Let's say that I have a WS method like so: > > deleteEmployee(int empid) throws SOAPException > { > } > > Is it sensible for this method to have a void return type or should it > always return something, for example the empid just deleted (for client > correlation purposes, amongst other things)? > > I ask because it's not clear to me what's going on under the covers. I > could imagine, for example, that void would be OK because any kind of > problem explicitly detected by the web service method would throw a > SOAPException and any kind of network issue (e.g. request not even making it > to the web service) or a failure of the service to execute the method might > cause the underlying infrastructure itself to throw a SOAPException > (because, for example, HTTP 200 OK was never seen by the client). So the > absence of a SOAPException might reasonably imply success and hence no > return type was required. > > Thanks. > > _ > Dont just search. Find. Check out the new MSN Search! > http://search.msn.click-url.com/go/onm00200636ave/direct/01/ > Guy Rixon [EMAIL PROTECTED] Institute of Astronomy Tel: +44-1223-337542 Madingley Road, Cambridge, UK, CB3 0HA Fax: +44-1223-337523 _ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
RE: Explicit response required from WS methods?
So if the WSDL for my method were as follows: message="impl:deleteEmployeeRequest"/> message="impl:deleteEmployeeResponse"/> then that's an indication that I'm using a synchronous request/response and therefore my method itself does *not* need to return anything (even though it might be advisable to do so, the question here is one of necessity). From: "Chris Nappin" <[EMAIL PROTECTED]> Reply-To: axis-user@ws.apache.org To: Subject: RE: Explicit response required from WS methods? Date: Wed, 31 Aug 2005 16:48:14 +0100 Have a look at the various scenarios in the WS-I Usage Scenarios spec http://www.ws-i.org/SampleApplications/SupplyChainManagement/2003-12/Usa geScenarios-1.01.pdf - (not as scary as it sounds). If you care about whether the operation really happened, or you want to be able to receive a fault if anything went wrong, then use the synchronous request/response scenario. If you don't care (known as a "fire and forget" message) then use the "one way" scenario. -Original Message- From: Jarmo Doc [mailto:[EMAIL PROTECTED] Sent: 31 August 2005 16:39 To: axis-user@ws.apache.org Subject: Explicit response required from WS methods? Let's say that I have a WS method like so: deleteEmployee(int empid) throws SOAPException { } Is it sensible for this method to have a void return type or should it always return something, for example the empid just deleted (for client correlation purposes, amongst other things)? I ask because it's not clear to me what's going on under the covers. I could imagine, for example, that void would be OK because any kind of problem explicitly detected by the web service method would throw a SOAPException and any kind of network issue (e.g. request not even making it to the web service) or a failure of the service to execute the method might cause the underlying infrastructure itself to throw a SOAPException (because, for example, HTTP 200 OK was never seen by the client). So the absence of a SOAPException might reasonably imply success and hence no return type was required. Thanks. _ Don't just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/ CONFIDENTIALITY & PRIVILEGE NOTICE This e-mail is confidential to its intended recipient. It may also be privileged. Neither the confidentiality nor any privilege attaching to this e-mail is waived lost or destroyed by reason that it has been mistakenly transmitted to a person or entity other than its intended recipient. If you are not the intended recipient please notify us immediately by telephone or fax at the numbers provided above or e-mail by Reply To Author and return the printed e-mail to us by post at our expense. We believe, but do not warrant, that this e-mail and any attachments are virus-free, but you should check. We may monitor traffic data of both business and personal e-mails. We are not liable for any opinions expressed by the sender where this is a non-business e-mail. If you do not receive all the message, or if you have difficulty with the transmission, please telephone us immediately. _ On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement
Re: Explicit response required from WS methods?
Hi, void is fine, and saves a little parsing on the return. If it works, then the service returns an HTTP 200 with a SOAP body that doesn't need deserializing; the client stub returns quietly. If it goes wrong, then the client stub chucks an Exception in which the detail states the HTTP status-code. Architecturally, there's a deeper point. Suppose that your service could return an HTTP 200 with no body; i.e. suppose you could implement a one-way operation which Axis 2 supports and Axis 1 doesn't. Would this be a good equivalent to a method returning void? Yes, in the sense that less XML handling would be involved. No, in the sense that the 200 might come back before the service had processed the request; i.e. the work would be asynchronous. An asynchronous request to a service is not a good match to a method returning void. On Wed, 31 Aug 2005, Jarmo Doc wrote: > Let's say that I have a WS method like so: > > deleteEmployee(int empid) throws SOAPException > { > } > > Is it sensible for this method to have a void return type or should it > always return something, for example the empid just deleted (for client > correlation purposes, amongst other things)? > > I ask because it's not clear to me what's going on under the covers. I > could imagine, for example, that void would be OK because any kind of > problem explicitly detected by the web service method would throw a > SOAPException and any kind of network issue (e.g. request not even making it > to the web service) or a failure of the service to execute the method might > cause the underlying infrastructure itself to throw a SOAPException > (because, for example, HTTP 200 OK was never seen by the client). So the > absence of a SOAPException might reasonably imply success and hence no > return type was required. > > Thanks. > > _ > Don?t just search. Find. Check out the new MSN Search! > http://search.msn.click-url.com/go/onm00200636ave/direct/01/ > Guy Rixon [EMAIL PROTECTED] Institute of Astronomy Tel: +44-1223-337542 Madingley Road, Cambridge, UK, CB3 0HA Fax: +44-1223-337523
Re: Explicit response required from WS methods?
Sorry Jarmo, I was supposing your client would expect a true/false response.On 8/31/05, Jarmo Doc <[EMAIL PROTECTED] > wrote:The implementation would probably be something like this:void deleteEmployee(int empid) throws SOAPException { try {// delete employee here } catch (Exception exx) {throw new SOAPException(exc); }}>From: Rogério Luz < [EMAIL PROTECTED]>>Reply-To: axis-user@ws.apache.org>To: axis-user@ws.apache.org>Subject: Re: Explicit response required from WS methods? >Date: Wed, 31 Aug 2005 12:54:09 -0300>>Depends on what service.deleteEmployee() method do. If you have a try/catch>there and an Exception is thrown you'll never know if your delete really>happaned. Certainly if line 2 executes, line 1 was executed or at least was >called.>>On 8/31/05, Jarmo Doc <[EMAIL PROTECTED]> wrote:> >> > OK, but is it actually required? If my client executes the following: > >> > 1. service.deleteEmployee(5);> > 2. System.out.println("deleted empid 5");> >> > Is execution of line 2 a guarantee that line 1 succeeded?> > > >> > >From: Rogério Luz <[EMAIL PROTECTED]>> > >Reply-To: axis-user@ws.apache.org > > >To: axis-user@ws.apache.org> > >Subject: Re: Explicit response required from WS methods?> > >Date: Wed, 31 Aug 2005 12:43:41 -0300 > > >> > >I think it would be a good practice return at least a boolean to ensure> > >your> > >deleteEmployee method really deleted an employee.> > >> > >On 8/31/05, Jarmo Doc < [EMAIL PROTECTED]> wrote:> > > >> > > > Let's say that I have a WS method like so:> > > >> > > > deleteEmployee(int empid) throws SOAPException > > > > {> > > > }> > > >> > > > Is it sensible for this method to have a void return type or should>it> > > > always return something, for example the empid just deleted (for > > client> > > > correlation purposes, amongst other things)?> > > >> > > > I ask because it's not clear to me what's going on under the covers.>I> > > > could imagine, for example, that void would be OK because any kind >of> > > > problem explicitly detected by the web service method would throw a> > > > SOAPException and any kind of network issue (e.g. request not even> > >making> > > > it > > > > to the web service) or a failure of the service to execute the>method> > > > might> > > > cause the underlying infrastructure itself to throw a SOAPException > > > > (because, for example, HTTP 200 OK was never seen by the client). So> > the> > > > absence of a SOAPException might reasonably imply success and hence>no> > > > return type was required. > > > >> > > > Thanks.> > > >> > > > _> > > > Don't just search. Find. Check out the new MSN Search! > > > > http://search.msn.click-url.com/go/onm00200636ave/direct/01/> > > >> > > >> > > > > >> > >--> > >[]´s> > >> > >Rogério Luz> >> > _> > Express yourself instantly with MSN Messenger! Download today - it's >FREE!> > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/> >> >>>>-- >[]´s>>Rogério Luz_Don't just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/-- []´sRogério Luz
Re: Explicit response required from WS methods?
The implementation would probably be something like this: void deleteEmployee(int empid) throws SOAPException { try { // delete employee here } catch (Exception exx) { throw new SOAPException(exc); } } From: Rogério Luz <[EMAIL PROTECTED]> Reply-To: axis-user@ws.apache.org To: axis-user@ws.apache.org Subject: Re: Explicit response required from WS methods? Date: Wed, 31 Aug 2005 12:54:09 -0300 Depends on what service.deleteEmployee() method do. If you have a try/catch there and an Exception is thrown you'll never know if your delete really happaned. Certainly if line 2 executes, line 1 was executed or at least was called. On 8/31/05, Jarmo Doc <[EMAIL PROTECTED]> wrote: > > OK, but is it actually required? If my client executes the following: > > 1. service.deleteEmployee(5); > 2. System.out.println("deleted empid 5"); > > Is execution of line 2 a guarantee that line 1 succeeded? > > > >From: Rogério Luz <[EMAIL PROTECTED]> > >Reply-To: axis-user@ws.apache.org > >To: axis-user@ws.apache.org > >Subject: Re: Explicit response required from WS methods? > >Date: Wed, 31 Aug 2005 12:43:41 -0300 > > > >I think it would be a good practice return at least a boolean to ensure > >your > >deleteEmployee method really deleted an employee. > > > >On 8/31/05, Jarmo Doc <[EMAIL PROTECTED]> wrote: > > > > > > Let's say that I have a WS method like so: > > > > > > deleteEmployee(int empid) throws SOAPException > > > { > > > } > > > > > > Is it sensible for this method to have a void return type or should it > > > always return something, for example the empid just deleted (for > client > > > correlation purposes, amongst other things)? > > > > > > I ask because it's not clear to me what's going on under the covers. I > > > could imagine, for example, that void would be OK because any kind of > > > problem explicitly detected by the web service method would throw a > > > SOAPException and any kind of network issue (e.g. request not even > >making > > > it > > > to the web service) or a failure of the service to execute the method > > > might > > > cause the underlying infrastructure itself to throw a SOAPException > > > (because, for example, HTTP 200 OK was never seen by the client). So > the > > > absence of a SOAPException might reasonably imply success and hence no > > > return type was required. > > > > > > Thanks. > > > > > > _ > > > Don't just search. Find. Check out the new MSN Search! > > > http://search.msn.click-url.com/go/onm00200636ave/direct/01/ > > > > > > > > > > > >-- > >[]´s > > > >Rogério Luz > > _ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > -- []´s Rogério Luz _ Dont just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/
RE: Explicit response required from WS methods?
Nice link, thanks a lot Chris. From: "Chris Nappin" <[EMAIL PROTECTED]> Reply-To: axis-user@ws.apache.org To: Subject: RE: Explicit response required from WS methods? Date: Wed, 31 Aug 2005 16:48:14 +0100 Have a look at the various scenarios in the WS-I Usage Scenarios spec http://www.ws-i.org/SampleApplications/SupplyChainManagement/2003-12/Usa geScenarios-1.01.pdf - (not as scary as it sounds). If you care about whether the operation really happened, or you want to be able to receive a fault if anything went wrong, then use the synchronous request/response scenario. If you don't care (known as a "fire and forget" message) then use the "one way" scenario. -Original Message- From: Jarmo Doc [mailto:[EMAIL PROTECTED] Sent: 31 August 2005 16:39 To: axis-user@ws.apache.org Subject: Explicit response required from WS methods? Let's say that I have a WS method like so: deleteEmployee(int empid) throws SOAPException { } Is it sensible for this method to have a void return type or should it always return something, for example the empid just deleted (for client correlation purposes, amongst other things)? I ask because it's not clear to me what's going on under the covers. I could imagine, for example, that void would be OK because any kind of problem explicitly detected by the web service method would throw a SOAPException and any kind of network issue (e.g. request not even making it to the web service) or a failure of the service to execute the method might cause the underlying infrastructure itself to throw a SOAPException (because, for example, HTTP 200 OK was never seen by the client). So the absence of a SOAPException might reasonably imply success and hence no return type was required. Thanks. _ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Re: Explicit response required from WS methods?
Depends on what service.deleteEmployee() method do. If you have a try/catch there and an Exception is thrown you'll never know if your delete really happaned. Certainly if line 2 executes, line 1 was executed or at least was called.On 8/31/05, Jarmo Doc <[EMAIL PROTECTED]> wrote: OK, but is it actually required? If my client executes the following:1. service.deleteEmployee(5);2. System.out.println("deleted empid 5");Is execution of line 2 a guarantee that line 1 succeeded? >From: Rogério Luz <[EMAIL PROTECTED]>>Reply-To: axis-user@ws.apache.org>To: axis-user@ws.apache.org>Subject: Re: Explicit response required from WS methods?>Date: Wed, 31 Aug 2005 12:43:41 -0300>>I think it would be a good practice return at least a boolean to ensure >your>deleteEmployee method really deleted an employee.>>On 8/31/05, Jarmo Doc <[EMAIL PROTECTED]> wrote:> >> > Let's say that I have a WS method like so: > >> > deleteEmployee(int empid) throws SOAPException> > {> > }> >> > Is it sensible for this method to have a void return type or should it> > always return something, for example the empid just deleted (for client > > correlation purposes, amongst other things)?> >> > I ask because it's not clear to me what's going on under the covers. I> > could imagine, for example, that void would be OK because any kind of > > problem explicitly detected by the web service method would throw a> > SOAPException and any kind of network issue (e.g. request not even>making> > it> > to the web service) or a failure of the service to execute the method > > might> > cause the underlying infrastructure itself to throw a SOAPException> > (because, for example, HTTP 200 OK was never seen by the client). So the> > absence of a SOAPException might reasonably imply success and hence no > > return type was required.> >> > Thanks.> >> > _> > Don't just search. Find. Check out the new MSN Search! > > http://search.msn.click-url.com/go/onm00200636ave/direct/01/> >> >>>>-->[]´s> >Rogério Luz_Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/-- []´sRogério Luz
RE: Explicit response required from WS methods?
Have a look at the various scenarios in the WS-I Usage Scenarios spec http://www.ws-i.org/SampleApplications/SupplyChainManagement/2003-12/Usa geScenarios-1.01.pdf - (not as scary as it sounds). If you care about whether the operation really happened, or you want to be able to receive a fault if anything went wrong, then use the synchronous request/response scenario. If you don't care (known as a "fire and forget" message) then use the "one way" scenario. -Original Message- From: Jarmo Doc [mailto:[EMAIL PROTECTED] Sent: 31 August 2005 16:39 To: axis-user@ws.apache.org Subject: Explicit response required from WS methods? Let's say that I have a WS method like so: deleteEmployee(int empid) throws SOAPException { } Is it sensible for this method to have a void return type or should it always return something, for example the empid just deleted (for client correlation purposes, amongst other things)? I ask because it's not clear to me what's going on under the covers. I could imagine, for example, that void would be OK because any kind of problem explicitly detected by the web service method would throw a SOAPException and any kind of network issue (e.g. request not even making it to the web service) or a failure of the service to execute the method might cause the underlying infrastructure itself to throw a SOAPException (because, for example, HTTP 200 OK was never seen by the client). So the absence of a SOAPException might reasonably imply success and hence no return type was required. Thanks. _ Don't just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/ CONFIDENTIALITY & PRIVILEGE NOTICE This e-mail is confidential to its intended recipient. It may also be privileged. Neither the confidentiality nor any privilege attaching to this e-mail is waived lost or destroyed by reason that it has been mistakenly transmitted to a person or entity other than its intended recipient. If you are not the intended recipient please notify us immediately by telephone or fax at the numbers provided above or e-mail by Reply To Author and return the printed e-mail to us by post at our expense. We believe, but do not warrant, that this e-mail and any attachments are virus-free, but you should check. We may monitor traffic data of both business and personal e-mails. We are not liable for any opinions expressed by the sender where this is a non-business e-mail. If you do not receive all the message, or if you have difficulty with the transmission, please telephone us immediately.
Re: Explicit response required from WS methods?
OK, but is it actually required? If my client executes the following: 1. service.deleteEmployee(5); 2. System.out.println("deleted empid 5"); Is execution of line 2 a guarantee that line 1 succeeded? From: Rogério Luz <[EMAIL PROTECTED]> Reply-To: axis-user@ws.apache.org To: axis-user@ws.apache.org Subject: Re: Explicit response required from WS methods? Date: Wed, 31 Aug 2005 12:43:41 -0300 I think it would be a good practice return at least a boolean to ensure your deleteEmployee method really deleted an employee. On 8/31/05, Jarmo Doc <[EMAIL PROTECTED]> wrote: > > Let's say that I have a WS method like so: > > deleteEmployee(int empid) throws SOAPException > { > } > > Is it sensible for this method to have a void return type or should it > always return something, for example the empid just deleted (for client > correlation purposes, amongst other things)? > > I ask because it's not clear to me what's going on under the covers. I > could imagine, for example, that void would be OK because any kind of > problem explicitly detected by the web service method would throw a > SOAPException and any kind of network issue (e.g. request not even making > it > to the web service) or a failure of the service to execute the method > might > cause the underlying infrastructure itself to throw a SOAPException > (because, for example, HTTP 200 OK was never seen by the client). So the > absence of a SOAPException might reasonably imply success and hence no > return type was required. > > Thanks. > > _ > Don't just search. Find. Check out the new MSN Search! > http://search.msn.click-url.com/go/onm00200636ave/direct/01/ > > -- []´s Rogério Luz _ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Re: Explicit response required from WS methods?
I think it would be a good practice return at least a boolean to ensure your deleteEmployee method really deleted an employee.On 8/31/05, Jarmo Doc <[EMAIL PROTECTED]> wrote: Let's say that I have a WS method like so: deleteEmployee(int empid) throws SOAPException { }Is it sensible for this method to have a void return type or should italways return something, for example the empid just deleted (for clientcorrelation purposes, amongst other things)? I ask because it's not clear to me what's going on under the covers. Icould imagine, for example, that void would be OK because any kind ofproblem explicitly detected by the web service method would throw aSOAPException and any kind of network issue ( e.g. request not even making itto the web service) or a failure of the service to execute the method mightcause the underlying infrastructure itself to throw a SOAPException(because, for example, HTTP 200 OK was never seen by the client). So the absence of a SOAPException might reasonably imply success and hence noreturn type was required.Thanks._Don't just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/-- []´sRogério Luz