• 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 ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

JAX-WS - hosting the same service as SOAP 1.1 and SOAP 1.2

Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I have a java class annotated with @WebServiceProvider(wsdllocation=pointing to wsdl) which implements implements Provider<Source>.

It works fine as SOAP 1.1. SOAPUI creates a SOAP 1.1 requests(soap namespace, contenttype etc) looking at the wsdl.

I changed the WSDL to soap12 namespace, bindings to soap 12, and annotated the class with @BindingType(value=SOAPBinding.SOAP12HTTP_BINDING). SOAPUI creats SOAP 1.2 requests looking at the wsdl and all works fine until now.

I changed the WSDL to have both SOAP 1.1 bindings and 1.2 bindings, and changed to the service to have two ports, pointing to 1.1 and 1.2 bindings. I removed the @BindingType annotation. The EAR file was deployed to Websphere application server 8.5.  

WSDL looks like below.

When the service is deployed, The WSDL from the link is seen as below. Meaning that , this service as soap12 is not hosted. if it was hosted the address REPLACED_BY_APP_SVR would have been resolved to endpoint. There were no errors or warning while deploying. I assume Axis2 engine has hosted this as soap1.1 service and ignored the SOAP 12 bindings in WSDL.

- <wsdl:binding name="TestBindingsoap12" type="targetns:TestPortType">
 <soap12:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="TestOperation">
 <soap12:operation soapAction="" />
- <wsdl:input>
 <soap12:body use="literal" namespace="http://danskenet.net/messages/RU/MR/Test" />
- <wsdl:output>
 <soap12:body use="literal" namespace="http://danskenet.net/messages/RU/MR/Test" />
- <wsdl:service name="TestRARUServiceV01">
- <wsdl:port name="TestRARUServiceV01Port" binding="targetns:TestBinding">
 <soap:address location="http://we7300.danskenet.net:9080/services/RU/MR/Test/TestRARUServiceV01/WebService" />
- <wsdl:port name="TestRARUServiceV01Portsoap12" binding="targetns:TestBindingsoap12">
 <soap12:address location="REPLACED_BY_APP_SVR" />

I added the annotation @BindingType(value=SOAPBinding.SOAP12HTTP_BINDING) and tried to deploy. While deploying I get the below error.

JAX-WS Service Descriptions could not be correctly built because of the following error: javax.xml.ws.WebServiceException: The ServiceDescription failed to validate due to the following errors -- Validation Phase 2 failure:  :: Endpoint failed validation ::  :: There is a mismatch between the wsdl and annotation information.  Please make sure both use the same binding namespace.  The wsdl is [SOAP 1.1 HTTP Binding]namespace = {http://schemas.xmlsoap.org/wsdl/soap/}.  The annotation is [SOAP 1.2 HTTP Binding]namespace = {http://www.w3.org/2003/05/soap/bindings/HTTP/}., Failing composite: org.apache.axis2.jaxws.description.builder.DescriptionBuilderComposite@91c33343

WSDL has both SOAP 1.1 and 1.2 binding but the web service engine complain about this. I'm I doing something wrong here ?. Or, is it not possible to expose this class as both Soap 1.1 and 1.2 service ?. (If yes, is this limitation only in bottom up approach ?).

Please help me with your knowledge. Thanks in advance.
Vinay Kumar T M
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One more point.

When I made the WSDL as only SOAP 1.2 I got the below warning in Rational application developer 8.5

WS-I BP 1.1: (BP2402) The service does not contain any binding that users a SOAP 1.1 binding.

I dont understand what it says. Is it saying a service exposed as SOAP 1.2 should always support SOAP 1.1 ?. I tried to call the SOAP 1.2 service with SOAP 1.1 request, however I get the version mismatch.
    Bookmark Topic Watch Topic
  • New Topic