Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on the answer of the Whizlab Diagnostic Exam #33

 
Helen Ge
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a question regarding the answer of the Whizlab Simulator #33 Diagnostic Exam:

The Stub instance returned by a call to javax.xml.rpc.Service.getPort() may be configured further by the client to customize other service level features.


Answer : false


My question - Then how do we explain the _stub.setProperty() method? Is this a 'Client-Level' feature?



Thanks
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Helen,

If you have a quick look at the API for the Service.getPort() method, you can read the following:

The returned Stub instance should not be reconfigured by the client.


Furthermore, in section 5.3.3 of Sun's blueprints, it is stated that:

J2EE client developers should avoid setting properties other than the javax.xml.rpc.endpoint.address property.

Avoid setting nonstandard properties if it is important to achieve portability among JAX-RPC runtimes. Nonstandard properties are those whose property names are not preceded by javax.xml.rpc.

Avoid using javax.xml.rpc.session.maintain property. This property pertains to a service's ability to support sessions. Unless you have control over the development of both the client and the endpoint, such as when both are developed within the same organization, you cannot be sure that the Web service endpoints support sessions, and you may get into trouble if you set this property incorrectly.


I hope this clears your doubts.
 
Helen Ge
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Valentin,

Thanks for your explaination on my last question.

but how would the web service client to indicate whether or not it wants to particaipate in a sesion with a service endpoint that is iniciated by the web service endpoint? (as the simulator question #44 asked for)- I bet the client side still have to set up the javax.xml.rpc.session.maintain property.

Is my understanding correct?
 
Helen Ge
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the Blueprint says 'avoid to configure......'. But it does not totally restric to use the stub._setPropertis() or call.setProperties(). It only restrict to couple particular property setting. You can still set up other preperence properties on your own.

So I think this Whizlab quesion is not really good.
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right again, the question is not well formulated. Actually, this restriction only applies to J2EE client developers since the application server is taking care of configuring those properties on behalf of the client. J2SE client developers have to configure those properties.

So let's rephrase the question statement as follows and that should clear things up:

Question:
The Stub instance returned by a call to javax.xml.rpc.Service.getPort() may be configured further by J2EE client developers to customize other service level features.

Answer:
The Stub returned by the call to Service.getPort() should not be configured further as the JAX-RPC runtime (application server, etc.) takes care of everything after instantiating the Stub. Note that this is only valid for J2EE client developers as J2SE client developers have to take care of all the configuration issues by themselves.

I hope this clears your doubts.
 
Helen Ge
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Valentin,

Thanks again for your explanation. Unfortunately, it's still not making me cleared my doubt - I know the J2SE client has to set up the stubs on their own, my doubt is not on this part. My real doubt is even the J2EE client, they may configure some of the stub properties after they get the stub instance and before they call the service endpoint. For example, they can still set up properties for endpoint address, set up properties showing the willing to participate with the endpoint session maintain ( if they are in the same enterprise and client knows the endpoint does maintain session).
The J2EE server just set up the javax.xml.auth.username/ password stuff.

That is my real doubt. Can you explain more? Bear with me, I am totally new with the web services and have zero real experience with it.
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My real doubt is even the J2EE client, they may configure some of the stub properties after they get the stub instance and before they call the service endpoint. For example, they can still set up properties for endpoint address,

No, since the endpoint address is specified in the WSDL, it is usually the underlying application server that sets this property when generating the static stubs from the WSDL.

set up properties showing the willing to participate with the endpoint session maintain ( if they are in the same enterprise and client knows the endpoint does maintain session).

This brings me back to the blueprints (5.3.3) which states that you should not configure the javax.xml.rpc.session.maintain unless you control both the client and the server part.

The J2EE server just set up the javax.xml.auth.username/ password stuff.

True, but apart from that there are not many other standard properties to set up (the ones that start with javax.xml.rpc)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic