2015-09-30 3 views
1

Я новичок в интеграции Spring. Создание простой POC сказать привет мир код, как нижеВесна Интеграция не подвергается WSDL

web.xml
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?> 
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee  http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> 
    <description>ws:inbound-gateway sample</description> 

    <servlet> 
     <servlet-name>spring-ws</servlet-name> 
     <servlet- class>org.springframework.ws.transport.http.MessageDispatcherServlet</servlet- class> 
     <init-param> 
      <param-name>contextConfigLocation</param-name> 
      <param-value>WEB-INF/spring-ws-config.xml</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> 


<welcome-file-list> 
    <welcome-file>index.html</welcome-file> 
</welcome-file-list> 

весна-WS-config.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"> 

    <import resource="classpath:/META-INF/spring/integration/inbound- gateway-config.xml"/> 

    <!-- Ensures that all incoming requests will be routed to the  ws:inbound-gateway --> 
    <bean class="org.springframework.ws.server.endpoint.mapping.UriEndpointMapping"> 
     <property name="defaultEndpoint" ref="hello-world"/> 
    </bean> 

</beans> 

въездного-шлюз-конфигурации. xml

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

    <int:channel id="input"/> 

    <int-ws:inbound-gateway id="hello-world" request-channel="input"/> 

    <int:service-activator input-channel="input"> 
     <bean class="org.springframework.integration.samples.ws.HelloWorldWS"> 
      <property name="helloWorldBo" ref="HelloWorldBo" /> 
     </bean> 
    </int:service-activator> 

    <bean id="HelloWorldBo" class="org.springframework.integration.samples.bo.HelloWorldBoImpl" /> 
</beans> 

HelloWorldBo.java

package org.springframework.integration.samples.bo; 

import org.springframework.stereotype.Service; 

@Service 
public interface HelloWorldBo{ 


    String getHelloWorld(String str); 

} 

HelloWorldBoImpl.java

package org.springframework.integration.samples.bo; 



public class HelloWorldBoImpl implements HelloWorldBo{ 

    public String getHelloWorld(String str){ 
     return "JAX-WS + Spring! " + str; 
    } 

} 

HelloWorldWS.java

package org.springframework.integration.samples.ws; 

import org.springframework.integration.samples.bo.HelloWorldBo; 
import org.springframework.ws.server.endpoint.annotation.Endpoint; 



@Endpoint 
public class HelloWorldWS{ 


    HelloWorldBo helloWorldBo; 


    public void setHelloWorldBo(HelloWorldBo helloWorldBo) { 
     this.helloWorldBo = helloWorldBo; 
    } 

    public String getHelloWorld(String str) { 

     return helloWorldBo.getHelloWorld(str); 

    } 

} 

index.html

The web service has been successfully deployed. You may now issue SOAP requests. 

Эта программа работает, но не подвергая WSDL. Его отображающие содержимое HTML на следующую ссылку http://localhost:8080/hello-world/

Но не отображающие WSDL Я попытался следующие способы получения пустой страницы

  1. http://localhost:8080/hello-world/hello
  2. http://localhost:8080/hello-world/hello.wsdl
  3. http://localhost:8080/hello-world/hello?wsdl

ответ

0

Spring Integration WS конечные точки сидят верхняя часть Spring Web Services инфраструктуры.

См. Документацию о том, как открыть WSDL для вашего веб-сервиса. Spring Web Services.

+0

Спасибо, это ... :) – Aniket

Смежные вопросы