This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Spring (boot) and SOAP versions

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a WSDL which defines a SOAP 1.2 endpoint.  However, when using Spring boot with Apache CXF the endpoint which is presented to me seems to offer a SOAP 1.1 and SOAP 1.2 endpoint at the same location!  Obviously this is not good and I don't want to the SOAP 1.1 endpoint at all.  Does anyone know how to get rid of it, i.e. only produce the SOAP 1.2 endpoint which is defined in the WSDL.

I've tried using annotations, which didn't work.  I could explicitly set the SOAP version when defining the endpoint configuration in code (which did work), but I'd rather use a bean/jaxws config file as this enables me to add different interceptors and amend the endpoint without amending the code.

Any suggestions / tutorials on the subject are most welcome

Cheers
 
matt andrews
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll add some more information.

My wsdl definition only has an endpoint for SOAP 1.2

<wsdl:service name="MyService">
 <wsdl:port name="IMyServicePort" binding="tns:IMyServiceBinding">
   <soap12:address location="http://localhost:8080/MyService/services/IMyServicePort"/>
 </wsdl:port>
</wsdl:service>


The web service beans file contains the following;

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:jaxws="http://cxf.apache.org/jaxws"
   xmlns:soap="http://cxf.apache.org/bindings/soap"
   xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
       http://cxf.apache.org/jaxws
       http://cxf.apache.org/schemas/jaxws.xsd
       http://cxf.apache.org/bindings/soap
       http://cxf.apache.org/schemas/configuration/soap.xsd
       http://www.springframework.org/schema/osgi
       http://www.springframework.org/schema/osgi/spring-osgi.xsd">

 <jaxws:endpoint id="HTTPEndpoint" implementor="#IMyServiceImpl" address="/services/myservice/v1" wsdlLocation="wsdl/MyService.wsdl">

   <jaxws:binding>
     <soap:soapBinding version="1.2" mtomEnabled="true" />
   </jaxws:binding>

   <jaxws:properties>
     <entry key="schema-validation-enabled" value="true" />
     <entry key="jaxb-validation-event-handler">
       <bean class="myservice.MySoapFaultInterceptor" />
     </entry>
   </jaxws:properties>
 </jaxws:endpoint>
</beans>


However, when I browse to the wsdl, I see both SOAP 1.1 and SOAP 1.2 endpoints


<wsdl:service name="MyService">
 <wsdl:port binding="tns:IMyServiceBinding" name="IMyServicePort">
   <soap12:address location="http://localhost:8080/services/services/myservice/v1"/>
 </wsdl:port>
</wsdl:service>
<wsdl:service name="IMyServiceService">
 <wsdl:port binding="tns:IMyServiceSoapBinding" name="IMyServicePort">
   <soap:address location="http://localhost:8080/services/services/myservice/v1"/>
 </wsdl:port>
</wsdl:service>


Annoyingly, there are both defined to be the same endpoint location, so I can't access the SOAP 1.2 endpoint, all requests are rejected with "A SOAP 1.2 message is not valid when sent to a SOAP 1.1 only endpoint."


I can get around this by defining the endpoint in Java (although I cannot figure out how to replicate the jaxb-validation-event-handler in Java code!), but I'd rather use XML configuration.

Does anyone have any suggestions to either only generate a SOAP 1.2 endpoint, or seperate out the endpoint locations?
 
There are 10 kinds of people in this world. Those that understand binary get this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!