问题描述
我正尝试使用通过遵循ule子文档中的教程而产生的Web服务.能够成功构建Web服务,但是在使用Web服务时遇到了问题.我有两个Java Clasess"HelloWorld"和"HelloWorldImpl".这是我的流程
I am trying to consume a webservice produced on by following the tutorials in the mule Documentation. have been able to build the webservice successfully, but having issues consuming it. I have two Java Clasess "HelloWorld" and "HelloWorldImpl". This is my flow
<flow name="helloService" doc:name="helloService">
<http:inbound-endpoint address="http://localhost:63081/hello" exchange-pattern="request-response" doc:name="HTTP">
<cxf:jaxws-service serviceClass="com.test.HelloWorld"/>
</http:inbound-endpoint>
<component class="com.test.HelloWorldImpl" doc:name="Java"/>
<cxf:jaxws-client serviceClass="com.test.HelloWorld" operation="sayHi" doc:name="SOAP" />
<outbound-endpoint address="http://localhost:63081/services/greeter" doc:name="Generic"/>
</flow>
我在做什么错了?
当我访问出站端点时,我得到
When I access the outbound endpoint I get
Cannot bind to address "http://activate.adobe.com:63081/services/greeter" No component registered on that endpoint
推荐答案
第一个问题:如何在本地主机的同一端口(63081)上运行两个服务.
First issue: How can there be two services running on the same port (63081) on your localhost.
http://localhost:63081/hello
http://localhost:63081/services/greeter
还如您的帖子所述,您创建的Web服务是带有端点的Hello服务
Also As mentioned in your post, the web-service you have created is Hello service with the endpoint
http://localhost:63081/hello
因此您的网络服务应如下.
So you web sevice should be as follows.
<flow name="helloService" doc:name="helloService">
<http:inbound-endpoint address="http://localhost:63081/hello" exchange-pattern="request-response" doc:name="HTTP">
<cxf:jaxws-service serviceClass="com.test.HelloWorld"/>
</http:inbound-endpoint>
<component class="com.test.HelloWorldImpl" doc:name="Java"/>
</flow>
为了消耗,您可以编写另一个具有cxf:jaxws-client
In order to consume you can write another flow which has got the cxf:jaxws-client
<flow name="helloclient" >
<some inbound endpoint. >
....
<cxf:jaxws-client serviceClass="com.test.HelloWorld" operation="sayHi" doc:name="SOAP" />
<outbound-endpoint address="http://localhost:63081/hello" doc:name="Generic"/>
.....
</flow>
希望这会有所帮助.
这篇关于使用Mule 3.4消耗Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!