aspose file tools*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes Publish a service using SOAPBinding.SOAP12HTTPBinding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Publish a service using SOAPBinding.SOAP12HTTPBinding" Watch "Publish a service using SOAPBinding.SOAP12HTTPBinding" New topic
Author

Publish a service using SOAPBinding.SOAP12HTTPBinding

Himai Minh
Ranch Hand

Joined: Jul 29, 2012
Posts: 736
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?
a sarkar
Ranch Hand

Joined: Aug 05, 2010
Posts: 92
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.


Abhijit
-------
SCJP 5, SCBCD 5, OCWCD 5, OCEWSD 6, CSM
Himai Minh
Ranch Hand

Joined: Jul 29, 2012
Posts: 736
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

Joined: Aug 05, 2010
Posts: 92
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
Ranch Hand

Joined: Jul 29, 2012
Posts: 736
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

Joined: Aug 05, 2010
Posts: 92
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
Ranch Hand

Joined: Jul 29, 2012
Posts: 736
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

Joined: Aug 05, 2010
Posts: 92
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.
Abhay Agarwal
Ranch Hand

Joined: Feb 29, 2008
Posts: 1086
    
    1

Just adding this post reference here - in this post, solution is mentioned using wsgen command
http://www.coderanch.com/t/627212/java-Web-Services-SCDJWS/certification/SOAP-SOAP#2869971
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Publish a service using SOAPBinding.SOAP12HTTPBinding