I am trying to set up SOAP on Spring WS and now i configure Spring beans with file like this:
我试图在Spring WS上设置SOAP,现在我用这样的文件配置Spring bean:
<?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:context="http://www.springframework.org/schema/context"
xmlns:sws="http://www.springframework.org/schema/web-services"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/web-services
http://www.springframework.org/schema/web-services/web-services-2.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<context:component-scan base-package="com.blog.samples.services" />
<sws:annotation-driven />
<!--
Our test service bean
-->
<bean id="AccountDetailsService" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition" lazy-init="true">
<property name="schemaCollection">
<bean class="org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection">
<property name="inline" value="true" />
<property name="xsds">
<list>
<value>schemas/AccountDetailsServiceOperations.xsd</value>
</list>
</property>
</bean>
</property>
<property name="portTypeName" value="AccountDetailsService"/>
<property name="serviceName" value="AccountDetailsServices" />
<property name="locationUri" value="/endpoints"/>
</bean>
</beans>
Unfortunatly i have not xsd, i have only wsdl which described my service. The question is : may i use somehow my wsdl in this spring configuration file? If yes - how (use wsdl instead of wsdl)? I know that i can extract xsd from wsdl, but would like to use only wsdl. Thank you.
不幸的是我没有xsd,我只有描述我服务的wsdl。问题是:我可以在这个Spring配置文件中以某种方式使用我的wsdl吗?如果是 - 如何(使用wsdl而不是wsdl)?我知道我可以从wsdl中提取xsd,但是只想使用wsdl。谢谢。
1 个解决方案
#1
You could use SimpleWsdl11Definition instead of DefaultWsdl11Definition:
您可以使用SimpleWsdl11Definition而不是DefaultWsdl11Definition:
Via XML:
<sws:static-wsdl id="operations" location="[your_location]/[your_wsdl].wsdl"/>
Via Java config:
通过Java配置:
@Bean(name = "operations")
public SimpleWsdl11Definition wsdl11Definition() {
SimpleWsdl11Definition s = new SimpleWsdl11Definition();
s.setWsdl(new ClassPathResource("[your_location]/[your_wsdl].wsdl"));
return s;
}
"id" respectively bean-name is the identifier on how your .wsdl can be accessed. In the case above:
“id”分别是bean-name是关于如何访问.wsdl的标识符。在上面的情况:
http://[your_server]/[url_mapping_from_message_dispatcher]/operations.wsdl
#1
You could use SimpleWsdl11Definition instead of DefaultWsdl11Definition:
您可以使用SimpleWsdl11Definition而不是DefaultWsdl11Definition:
Via XML:
<sws:static-wsdl id="operations" location="[your_location]/[your_wsdl].wsdl"/>
Via Java config:
通过Java配置:
@Bean(name = "operations")
public SimpleWsdl11Definition wsdl11Definition() {
SimpleWsdl11Definition s = new SimpleWsdl11Definition();
s.setWsdl(new ClassPathResource("[your_location]/[your_wsdl].wsdl"));
return s;
}
"id" respectively bean-name is the identifier on how your .wsdl can be accessed. In the case above:
“id”分别是bean-name是关于如何访问.wsdl的标识符。在上面的情况:
http://[your_server]/[url_mapping_from_message_dispatcher]/operations.wsdl