• Post Reply Bookmark Topic Watch Topic
  • New Topic

Whizlabs Question doubt(UDDI)

 
Divya Gehlot
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Q->What is the output of the following JAXR code?
ConnectionFactory factory=ConnectionFactory.newInstance();
Properties props=new Properties();
props.put("javax.xml.registry.lifeCycleManagerURL","http://java.sun.com/uddi/publish");
Connection con=factory.createConnection();
System.out.println(factory.getProperties().get("javax.xml.registry.lifeCycleManagerURL"));
Options:
1-javax.xml.registry.lifeCycleManagerURL
2-null
3-http://java.sun.com/uddi/publish
4-http://java.sun.com/uddi/inquiry
5-none of the above

whizlabs ans-none of the above
Can any one clarify me why?
Thanks in advance.
 
Udaya Sankar Pillutla
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Divya Gehlot:
Hi,
Q->What is the output of the following JAXR code?
ConnectionFactory factory=ConnectionFactory.newInstance();
Properties props=new Properties();
props.put("javax.xml.registry.lifeCycleManagerURL","http://java.sun.com/uddi/publish");
Connection con=factory.createConnection();
System.out.println(factory.getProperties().get("javax.xml.registry.lifeCycleManagerURL"));
Options:
1-javax.xml.registry.lifeCycleManagerURL
2-null
3-http://java.sun.com/uddi/publish
4-http://java.sun.com/uddi/inquiry
5-none of the above

whizlabs ans-none of the above
Can any one clarify me why?
Thanks in advance.


Notice he did not do a factory.setProperties(props) after setting the property for lifeCycleManagerURL. You need to do that before you create the connection or the properties wont be set. So effectively nothing was set on the connection/factory anyways. Hence none of the above is the answer.

Cheers.
 
Divya Gehlot
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the explaination.
But in whizlabs they have given some other explaination
whizlabs Explaination:
The goal of this question to test your ability to recognize how JAXR handles mandatory and non-mandatory properties while creating JAXR connections to UDDI registeries.In other words,the "javax.xml.registry.queryManagerURL"
must always be specifed and must map to a valid query manager URI of a UDDI registry.Moreover only "javax.xml.registry.queryManagerURL" property is mandatory while "javax.xml.registry.lifeCycleManagerURL" property is not.However if later is not specified it must resolve the to the URL mapped to the "javax.xml.registry.queryManagerURL" property i.e."http://java.sun.com/uddi/inquiry".

So I got confused with that.
Can any one explain me what they want to say.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!