wood burning stoves 2.0*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes 1z0-897 exam quiz Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "1z0-897 exam quiz" Watch "1z0-897 exam quiz" New topic
Author

1z0-897 exam quiz

giuseppe frasca
Greenhorn

Joined: May 31, 2012
Posts: 4
Hi,
I have found this question online:

QUESTION NO: 103
A developer is writing a Web service method that needs to accept multiple types of requests.
Based on the request's content, the service performs time-consuming steps, such as verifying the
user's account, checking credit ratings, and building a list of offers. Which two approaches are
appropriate to use in this situation? (Choose two.)
A. A synchronous, document-style approach.
B. A synchronous, procedure-style approach.
C. An asynchronous, document-style approach.
D. An asynchronous, procedure-style approach.
E. HTTP and HTTPS.
F. SMTP or other asynchronous protocol.

Answer: C,F

My doubt is:
Why D is incorrect? The difference should be only from a schema veiwpoint. I mean that both rpc or document style web service could be used for asynchronous ws. For 'F' another example could be JMS?

Thank you in advance
Himai Minh
Ranch Hand

Joined: Jul 29, 2012
Posts: 767
The key word here is "accept multiple types of requests".
When you build a web service in RPC style, your web method (@Webmethod) can only accept primitive type arguments.
For document style, your web method can accept any object type arguments.

I am not sure if I am right since I am new to web service.
giuseppe frasca
Greenhorn

Joined: May 31, 2012
Posts: 4
Himai Minh wrote:The key word here is "accept multiple types of requests".
When you build a web service in RPC style, your web method (@Webmethod) can only accept primitive type arguments.
For document style, your web method can accept any object type arguments.

I am not sure if I am right since I am new to web service.


Thank you very much for your reply.
I am not sure that it is the point. If you have an RPC style in the wsdl you can use type attribute on a part element pointing to a type defined in a schema. Even if you would be right there are many primitive types and then the key word "accept multiple types of requests" wouldn't be meanignful.

Thank you again Himai
Himai Minh
Ranch Hand

Joined: Jul 29, 2012
Posts: 767
In Martin Kalin's Java Web Service Up and Running, p 56, there is a quote

Here are some downsides to the rpc style:

This style with its obvious link to the request/response pattern, encourages high coupling between the service and the client.....
This same point is sometimes made by noting that the rpc style has an inherently synchronous as opposed to asynchronous invocation idiom....


giuseppe frasca
Greenhorn

Joined: May 31, 2012
Posts: 4
Himai Minh wrote:In Martin Kalin's Java Web Service Up and Running, p 56, there is a quote

Here are some downsides to the rpc style:

This style with its obvious link to the request/response pattern, encourages high coupling between the service and the client.....
This same point is sometimes made by noting that the rpc style has an inherently synchronous as opposed to asynchronous invocation idiom....




Your post is very useful.
Thank you very much
Himai Minh
Ranch Hand

Joined: Jul 29, 2012
Posts: 767


A developer is writing a Web service method that needs to accept multiple types of requests.
Based on the request's content, the service performs time-consuming steps, such as verifying the
user's account, checking credit ratings, and building a list of offers. Which two approaches are
appropriate to use in this situation? (Choose two.)
A. A synchronous, document-style approach.
B. A synchronous, procedure-style approach.
C. An asynchronous, document-style approach.
D. An asynchronous, procedure-style approach.
E. HTTP and HTTPS.
F. SMTP or other asynchronous protocol.

Answer: C,F

My doubt is:
Why D is incorrect?

When I answered this question a year ago, I was not familiar with asynchronous web services.
Since I have already gained some knowledge about asynchronous services, I think C,D(maybe?),E,F are possible.
Reasons:
1. Asynchronous services means two one-ways request/response. The client sends a request and won't wait for the response. The service callback the client when the result is ready.
2. The question mentions "multiple types of requests", but it may necessarily mean objects ? It may mean primitives (int, double, float) and String as the method parameters? RPC style may be right ?
3. It does not matter what protocols we are using, HTTP/HTTPS/SMTP and etc because we can refactor a synchronous service into asynchronous services (two one-way request/response).

Any comments?
Himai Minh
Ranch Hand

Joined: Jul 29, 2012
Posts: 767
Let me answer my own question.

This mock quiz question is tricky.
The question never mentions that we should refactor the synchronous service into an asynchronous one (or two one ways request/response).
On Ivan's notes p.400, it says using RPC style when a synchronous protocol is used and using Document style when an asynchronous protocol is used.
So, HTTP/HTTPS is not the option since they are synchronous. The option is choose an asynchronous protocol, SMTP or JMS and use Document style.



Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1687
    
  25

On Ivan's notes p.400, it says using RPC style when a synchronous protocol is used and using Document style when an asynchronous protocol is used.

I have read that also, but I don't see any arguments backing that up. Maybe in the old days (JAX-RPC) there used to be a difference but in JAX-WS I don't see any difference at all (other than tight coupling). Any ideas?
 
GeeCON Prague 2014
 
subject: 1z0-897 exam quiz