3

I am writing a spring-boot application which I want to deploy in a Weblogic 12C. The application exposes a SOAP Webservice. When running the application in standalone mode (spring-boot runs it by using an embedded tomcat) everything works fine and I can access the wsdl by

http://localhost:8081/ws/springbootwstest.wsdl

But if I deploy the application-war-file in the Weblogic, the Webservice is not available while the application itself is deployed successfully.

I cannot access the wsdl. I already followed the instructions on http://docs.spring.io/spring-boot/docs/1.2.2.BUILD-SNAPSHOT/reference/htmlsingle/#howto-weblogic but still same result.

All sources can be found here: https://github.com/iljahell/springbootwstest.git

java version "1.7.0_67"

spring-boot 1.2.0.RELEASE

Weblogic 12.1.3.0.0

Ilja
  • 73
  • 2
  • 6
  • Why is `spring-boot-starter-ws` marked as provided in the pom? That'll make the classes in that jar and its dependencies unavailable to WebLogic which almost certainly isn't what you want. – Andy Wilkinson Jan 19 '15 at 15:26
  • See if this helps about navigating to your WSDL: http://stackoverflow.com/questions/27902435/what-is-the-full-wsdl-endpoint-url/27931145#27931145 – Display Name is missing Jan 19 '15 at 17:39
  • @AndyWilkinson Thanks, I corrected that but still not working – Ilja Jan 20 '15 at 11:24
  • @DisplayNameismissing The url of the application is localhost:7001/apiel-9.1.0-SNAPSHOT/ . Opening this URL returns a 403. Opening the service url http://localhost:7001/apiel-9.1.0-SNAPSHOT/ws/springbootwstest.wsdl returns a 404 – Ilja Jan 20 '15 at 11:27
  • For those coming here https://docs.spring.io/spring-boot/docs/current/reference/html/howto-traditional-deployment.html may help. I'm facing a similar problem but working with the ancient Web Logic 10.3.6. And followed everything. While I get REST and web pages, I still haven't been able to get SOAP endpoints working – David Bradley Jun 26 '17 at 03:15

2 Answers2

5

I've solved this today after much frustration with weblogic 12c. Weblogic still requires you to define the spring ws message dispatcher servlet in your web.xml like this. Make sure you add the spring boot legacy dependency to your pom too.

<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-legacy</artifactId>
        <version>1.0.2.RELEASE</version>
    </dependency>

Also, make sure you exclude the embedded tomcat from your spring boot ws dependency:

 <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web-services</artifactId>
        <exclusions>
            <exclusion>
                <groupId>org.apache.tomcat.embed</groupId>
                <artifactId>tomcat-embed-websocket</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

Then

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>au.gov.qld.ambulance.mtaworkflow.webservices.SpringWsApplication</param-value>
</context-param>

<listener>
    <listener-class>org.springframework.boot.legacy.context.web.SpringBootContextLoaderListener</listener-class>
</listener>

<servlet>
    <servlet-name>spring-ws</servlet-name>
    <servlet-class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet-class>
    <init-param>
        <param-name>transformWsdlLocations</param-name>
        <param-value>true</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>spring-ws</servlet-name>
    <url-pattern>/*</url-pattern>
</servlet-mapping>

</web-app>

Then add an empty servlet.xml matching your servlet name ie. spring-ws-servlet.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd">

</beans>

Finally, add a weblogic.xml with the following:

<wls:weblogic-web-app xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-
web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd 
http://xmlns.oracle.com/weblogic/weblogic-web-app 
http://xmlns.oracle.com/weblogic/weblogic-web-app/1.4/weblogic-web-app.xsd">
<wls:weblogic-version>12.1.1</wls:weblogic-version>
<wls:context-root>mtaworkflow</wls:context-root>
<wls:container-descriptor>
    <wls:prefer-application-packages>
        <wls:package-name>org.slf4j.*</wls:package-name>
        <wls:package-name>org.springframework.*</wls:package-name>
        <wls:package-name>javax.websocket.*</wls:package-name>
        <wls:package-name>javax.websocket.server.*</wls:package-name>
    </wls:prefer-application-packages>
</wls:container-descriptor>
</wls:weblogic-web-app>
Matthew Shaw
  • 108
  • 1
  • 7
0

Answer from Mathew actually works. Keep in mind that in case you use SpringBoot 2.X.. use spring-boot-legacy 2.1.X