Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

use of urn in soap service?

 
william kane
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When a urn is supposed to the a UNIQUE name for a resource how do i ensure that the urn i give when creating a webservice in my server is unique over the web?
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you can't be 100% sure because you can't control what other people type into their WSDL files...
However, you can be somewhat certain about uniqueness if you follow some basic principles. One of them is to include the company's domain name in the URN (e.g. "urn:mycompany.com-webservices-stockquote"). I remember stumbling onto a longer list of these "principles" but I can't remember where...
 
william kane
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Lasse Koskela:
Well, you can't be 100% sure because you can't control what other people type into their WSDL files...

Hi koskela,
Is there a standard registry where i can register my urn and be rest assured that it cannot be duplicated?
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't think of any standard registry for URNs except ICANN, which manages the URLs.
 
Ramesh Nagappan
Author
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by william kane:
When a urn is supposed to the a UNIQUE name for a resource how do i ensure that the urn i give when creating a webservice in my server is unique over the web?

"urn:" is typically used to specify namespace URI of the service. If you use JAX-RPC, it clearly distinguishes where you use URL endpoint and Namespace URI. I did'nt find any confusion !
For example, To invoke a service using JAX-RPC Dynamic proxy, I set the following:
String UrlString = "http://localhost:80/MyHelloService/MyHelloService?WSDL";
String nameSpaceUri = "urn:MyHelloService/wsdl";
String serviceName = "MyHelloService";
String portName = "MyHelloServiceRPCPort";

URL helloWsdlUrl = new URL(UrlString);
ServiceFactory serviceFactory =
ServiceFactory.newInstance();
Service helloService = serviceFactory.createService(helloWsdlUrl, new QName(nameSpaceUri, serviceName));

MyHelloServiceRPC myProxy = (MyHelloServiceRPC) helloService.getPort(new QName(nameSpaceUri, portName), MyHelloServiceRPC.class);
System.out.println(myProxy.sayHello("Buzz"));
You may take a look at:
http://java.sun.com/j2ee/1.3/docs/tutorial/doc/JAXRPC4.html
- Ramesh
 
Ramesh Nagappan
Author
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by william kane:

Hi koskela,
Is there a standard registry where i can register my urn and be rest assured that it cannot be duplicated?

If you are trying registering the service using its WSDL, you may think of registering the service using ebXMLRR (which compliments UDDI) and use JAXR API to register and find services.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic