0
從Spring集成客戶端調用Web服務時出現「無法爲此遠程調用找到匹配的操作」錯誤。彈簧集成Web服務客戶端不能正常工作
Web服務有多個操作,說過程1,過程2,process3等
如何調用有2場操作過程2。請打電話給我,下面的實施中缺少的是什麼。
Spring集成配置文件:
<bean id="jaxbMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
<property name="classesToBeBound">
<list>
<value>com.model.Request</value>
</list>
</property>
</bean>
<int:gateway id="ws" service-interface="com.gateway.WsGateway"
default-request-channel="inputChannel" />
<int-ws:outbound-gateway request-channel="inputChannel"
marshaller="jaxbMarshaller"
uri="wsdl_url" />
WsGateway.java
public interface WsGateway {
@Gateway(requestChannel = "inputChannel")
public void callWS(Request request);
}
Request.java
@XmlAccessorType(value = XmlAccessType.FIELD)
@XmlRootElement(name = "process2")
public class Request {
@XmlElement(name = "name")
private String name;
@XmlElement(name = "dept")
private String dept;
}
Main.java
Request req = new Request();
req.setName("foo");
req.setDept("xyz");
gateway.callWS(req);
感謝。它在添加命名空間url後工作。 –