This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Web Service in UML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Web Service in UML" Watch "Web Service in UML" New topic

Web Service in UML

John Ip
Ranch Hand

Joined: Mar 04, 2004
Posts: 45
Hi all,

I am currently working on the part 2 assignment and have some trouble with showing web services in my Class diagram. I have a stateless session bean which is also a web service endpoint and I dunno how to model this in a UML class diagram. I am thinking of doing this but not sure is it the right way.

<<WSDL service>>
<<statesless session bean>>

Can I simply put a sterotype <<webservice endpoint>> in the session bean class element?? Also I have an adapter class which is a client of an external web service. What sterotype should I use for that class? Do you guys know any tutorial on the internet about modeling web service with UML?

Thanks in advance.

sivan jai
Ranch Hand

Joined: Feb 24, 2010
Posts: 115
You should be able to do with a implements approach right - usually you have a SLSB that implements a interface that is annotated with @WebService. If you can show that on the UML it would work?
John Ip
Ranch Hand

Joined: Mar 04, 2004
Posts: 45
Thank you for your reply. Perhaps my question should be how to show a EJB 3.0 webservice endpoint in a class diagram and component diagram.

Any help will be much appreciated.
Dmitri Ericsson
Ranch Hand

Joined: Feb 16, 2010
Posts: 109
Why don't use @WebService stereotype? It's not standard, but the new SCEA book suggests using some annotations as stereotypes

SCEA 5, SCJP 6 My SCEA Experience
Vlad Varnica
Ranch Hand

Joined: Dec 28, 2002
Posts: 40
You can either use stereotypes and then get EJB3 annotations in your code see an example I found at : or just keywords.
The stereotype is live synchronized with the code, I mean that if you enter Entity as a stereotype in your class diagram then you get @Entity in the code of the java class. You can also set association one to one, one to many etc....

I recommend keywords because more simple and let development team to implement java annotation that I still personally don't fully understand

[Thumbnail for keywords.png]

I agree. Here's the link:
subject: Web Service in UML
It's not a secret anymore!