转换WsdlLocations &
当我在 web.xml 中:
<param-name>transformWsdlLocations</param-name>
<param-value>true</param-value>
并且
<servlet-mapping>
<servlet-name>personWS</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
自动生成的 WSDL 包含正确的 URL:
<soap:address location="http://localhost:8888/MyWSApp/getPerson/"/>
因此,当我在 SoapUI 中基于 wsdl 创建新项目时,EndPoint 设置为正确的 url (http://localhost:8888/MyWSApp/getPerson/)
但是当我将 url-pattern 更改为:
<url-pattern>/something/*</url-pattern>
自动生成的 wsdl 仍然包含与之前相同的 URL:
<soap:address location="http://localhost:8888/MyWSApp/getPerson/"/>
但这是错误的,该服务现在正在运行:
<soap:address location="http://localhost:8888/MyWSApp/service/getPerson/"/>
我也尝试在 servlet 定义中更改我的 portTypeName,但没有成功:
<bean id="personService" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition">
<property name="schema" ref="personServiceSchema"/>
<!-- <property name="portTypeName" value="getPerson"/> -->
<property name="portTypeName" value="something/getPerson"/>
<property name="locationUri" value="/getPerson/"/>
<property name="targetNamespace" value="http://www.geonis.com/geonis/delivery_site"/>
</bean>
请问您知道我该如何解决它吗?
When I have in web.xml:
<param-name>transformWsdlLocations</param-name>
<param-value>true</param-value>
and
<servlet-mapping>
<servlet-name>personWS</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
auto-generated WSDL contains right URL:
<soap:address location="http://localhost:8888/MyWSApp/getPerson/"/>
So when I create new project based on wsdl in SoapUI, EndPoint is set to right url (http://localhost:8888/MyWSApp/getPerson/)
But when I change url-pattern to:
<url-pattern>/something/*</url-pattern>
auto generated wsdl still contains the same URL like before:
<soap:address location="http://localhost:8888/MyWSApp/getPerson/"/>
but it is wrong, the service is running now on:
<soap:address location="http://localhost:8888/MyWSApp/service/getPerson/"/>
I have also tried change my portTypeName in servlet definition, but without success:
<bean id="personService" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition">
<property name="schema" ref="personServiceSchema"/>
<!-- <property name="portTypeName" value="getPerson"/> -->
<property name="portTypeName" value="something/getPerson"/>
<property name="locationUri" value="/getPerson/"/>
<property name="targetNamespace" value="http://www.geonis.com/geonis/delivery_site"/>
</bean>
Please, do you have idea how can I fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
转换仅影响 URL 的服务器和端口部分,因此对于其他修改(例如添加到路径),您必须手动更新 WSDL。
基本上,URL 只会适应方括号中检测到的值:
The transformation only affects the server and port portion of the URL, so for other modifications, like adding to the path, you will have to update your WSDL manually.
Basically, the URL will only adapt to detected values in the square brackets: