Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Vinay Kumar T M
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • 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" />
- <wsdlperation name="TestOperation">
  <soap12peration soapAction="" />
- <wsdl:input>
  <soap12:body use="literal" namespace="http://danskenet.net/messages/RU/MR/Test" />
  </wsdl:input>
- <wsdlutput>
  <soap12:body use="literal" namespace="http://danskenet.net/messages/RU/MR/Test" />
  </wsdlutput>
  </wsdlperation>
  </wsdl:binding>
- <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>
- <wsdl:port name="TestRARUServiceV01Portsoap12" binding="targetns:TestBindingsoap12">
  <soap12:address location="REPLACED_BY_APP_SVR" />
  </wsdl:port>
  </wsdl:service>
  </wsdl:definitions>


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
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!