• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Bartender
Posts: 2418
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?


 
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Bartender
Posts: 2418
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 93
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic