如何加载 Mule XML 配置
我试图遵循这个示例
在一个遗留项目上,然后我创建一个主类,其主方法像这样启动 spring (或者我认为这是怎么办它)
XmlBeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource(
"mule-config.xml"));
但是我然后远程登录到我的网络服务端口,但它不起作用!
- 它是否应该启动它自己的 Web 容器/服务器,或者我是否需要部署到 tomcat 或某些应用程序服务器才能使其工作
- 如果#1 的答案是需要部署,为什么在他们的示例中指定了一个绝对 URL会为您启动一个吗?
如何让它发挥作用?
这是我的xml..
<flow name="helloService">
<http:inbound-endpoint address="http://localhost:63081/enrollment" exchange-pattern="request-response">
<cxf:jaxws-service serviceClass="com.ifp.esb.integration.ingest.EnrollmentWS"/>
</http:inbound-endpoint>
<component>
<spring-object bean="enrollmentBean" />
</component>
</flow>
I was trying to follow this example
http://www.mulesoft.org/documentation/display/MULE3USER/Building+Web+Services+with+CXF
on a legacy project so then I create a main class with a main method that starts up spring like so(or I think this is how to do it)
XmlBeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource(
"mule-config.xml"));
but the I then telnet into the port I have for my webservice and it doesn't work!!!
- IS it supposed to start it's own web container/server or do I need to deploy to tomcat or some app server to make this work
- If the answer to #1 is need to deploy, why is there an absolute url specified in their example like it will start one for you?
How to get this to work?
Here is my xml..
<flow name="helloService">
<http:inbound-endpoint address="http://localhost:63081/enrollment" exchange-pattern="request-response">
<cxf:jaxws-service serviceClass="com.ifp.esb.integration.ingest.EnrollmentWS"/>
</http:inbound-endpoint>
<component>
<spring-object bean="enrollmentBean" />
</component>
</flow>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要使用 Mule 特定的 Spring 配置加载器:
You need to use the Mule-specific Spring config loader:
您也可以使用 Web 应用程序来启动 Mule 上下文。看到它被标记为在启动时加载。
这是 web.xml 的示例
You can use a webapp to start the mule context too. See that it is marked to load on startup.
Here's an example of a web.xml