我有基于 SOAP 的服务,它接受一些预定义的请求对象,
例如,AccountRequest 有一些字段。
示例代码
from("direct:test")
.routeId("account.get")
.process(exchange -> {
exchange.getIn().setBody(createAccountRequest());
})
.to("spring-ws:http://localhost:8090/AccountServices/AccountOverviewService")
.log("Got Request for account-detail");
}
上面的代码抛出错误
org.apache.camel.NoTypeConversionAvailableException:
No type converter available to convert from type:
com.test.AccountRequest to the required type:
javax.xml.transform.Source with value com.test.AccountRequest@4e1c1763
这是通过骆驼调用肥皂服务的正确方法吗?
依赖项
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring-boot-starter</artifactId>
<version>2.18.3</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring-ws</artifactId>
<version>2.18.3</version>
</dependency>