views:

121

answers:

1

I have to admit that I am pretty confused how annotations work in java (SOAP) webservices.

What does adding a tag do? I think that maybe adding a tag generates some xml or maybe a wsdl? When I build should I see a difference in those files?

Any description or link would be great. I have done a lot of searching but I think maybe I am searching for the wrong things. For example when I search for:

@securityDomain

I just get garbadge results. I am having difficulty finding a good description of what specific tags do as well as how tags in general work.

Update:

So is it safe to say that you can either use annotations or you can write your own xml/wdsl?

+2  A: 

@nnotations are defined by the Java language. An Annotation is a class. When you mark something with an annotation, the compiler and runtime arrange for an object of that class to be visible at runtime via java reflection.

The JAX-WS and JAX-B standards each define a raft of annotations. At runtime, or at java2ws(dl) time, they look at those annotations to decide what to do.

It looks to me as if @SecurityDomain in particular is part of JBoss, not any global standard, so you have to read the JBoss documentation to find out what it does.

I found this.

bmargulies
So is it safe to say that you can either use annotations or you can write your own xml/wdsl?
sixtyfootersdude
Sort of. In some cases you combine the two, and in some other cases you can use some other XML instead of @. Roughly, though, 'java-first' implies @nnotations, 'contract-first' implies writing xml.
bmargulies