• 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

Publish a service using SOAPBinding.SOAP12HTTPBinding

 
Bartender
Posts: 2418
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to chapter 8 of MZ's notes, the implementation class of the web service must be bind to SOAPBinding.SOAP11HTTPBinding by default.



But if I tried this


It won't publish the service. Why?
 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Himai Minh wrote:
I tried this

It won't publish the service. Why?


Can you be more specific? What is the problem you're getting while trying to publish the above code?
Also, is the SIB annotated as using SOAP12HTTP_BINDING too? If not, it's using the default SOAP11HTTP_BINDING and you can't obviously publish it using a different binding at runtime.
 
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
Let me use the same Hello example, I was trying to publish the endpoint using SOAP 1.2 over HTTP.




I got a compilation error when I try to annotate HelloWS using the @BindingType.

 
a sarkar
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Himai Minh wrote:
I got a compilation error when I try to annotate HelloWS using the @BindingType.


I noticed that your SEI has a SOAPBinding import, albeit unused. @SOAPBinding is not allowed on SEI. Try cleaning up your imports and please post the compilation 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
I removed all those unused import statements:




I got an error message when I run the publisher. But if I change the binding to SOAPBinding.SOAP11HTTP_BINDING, it works.
 
a sarkar
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all, it's not a compilation problem. It's a publishing problem.
Second of all, if you posted the error earlier, you'd have got help quicker.

That being said, here's your problem.

JAX-WS spec 2.2, section 5.2.5.1


5.2.5.1 SEI-based Endpoints
For publishing to succeed, a SEI-based endpoint MUST have an associated contract.
If the wsdlLocation annotation element is the empty string, then a JAX-WS implementation must obey the following rules, depending on the binding used by the endpoint:

SOAP 1.1/HTTP Binding A JAX-WS implementation MUST generate a WSDL description for the end- point based on the rules in section 5.2.5.3 below.
SOAP 1.2/HTTP Binding A JAX-WS implementation MUST NOT generate a WSDL description for the endpoint.

 
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 for your quick response.
First , I removed the unused import, the @BindingType line in the SEI compiles.
Then, I published it and based on the JAX-WS 2.2 specification, it won't generate a WSDL if SOAP 1.2 over HTTP is used.
Why there is such a rule? Does it mean SOAP 1.2 is not supported yet?
 
a sarkar
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:Does it mean SOAP 1.2 is not supported yet?


It is supported but dynamic WSDL generation isn't supported. If you want to use SOAP 1.2, start from WSDL or generate it using wsgen tool.
 
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
Just adding this post reference here - in this post, solution is mentioned using wsgen command
https://coderanch.com/t/627212/java-Web-Services-SCDJWS/certification/SOAP-SOAP#2869971
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic