• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SOAPBinding gives an error "SIB must not contain JSR-181 annotations..."

 
Himai Minh
Ranch Hand
Posts: 1359
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This code works. However, if I move @SOAPBinding (...) to the SIB, it gives me a compilation error. Why it won't compile?


 
Abhay Agarwal
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is because you are using explicit SEI and SIB class.
You can put the @SOAPBinding annotation on the SEI and any of the SEI's methods.You can apply this annotation to a type or public methods in a client or server Service Endpoint Interface (SEI), or in a service endpoint implementation class for a Java beans endpoint.
So if you only specify SIB (do not define explict SEI) then you can use @SOAPBinding on SIB. Here, JSR 181 Processor shall create an implicit SEI from your SIB class and shall apply @SOApBinding on it.
If you remove implements clause from SIB definition, you shall not get this error.
 
Himai Minh
Ranch Hand
Posts: 1359
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
So, it seems like @SOAPBinding (...) should be applied to SEI if there is any. Or, it should be applied to SBI if there is no SEI.
But if I explicitly define a SBI implementing an SEI, then it won't work.
 
a sarkar
Ranch Hand
Posts: 93
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Himai Minh wrote:Thanks.
So, it seems like @SOAPBinding (...) should be applied to SEI if there is any. Or, it should be applied to SBI if there is no SEI.

That's exactly correct according to the JAX-WS metadata spec.
JSR 181 also allows you to specify a SOAPBinding annotation on an endpoint implementation or service endpoint interface.

I see you're using default values for the binding anyway. I'm curious why do you even need the annotation? It seems to be a deviation from convention over configuration principle.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic