我有一个运行在某个服务器上的soap web服务。
<wsdl:operation name="lookup">
<wsdl:input message="tns:LookupRequest" name="LookupRequest"> </wsdl:input>
<wsdl:output message="tns:LookupResponse" name="LookupResponse">
</wsdl:output>
</wsdl:operation>它将查找作为web服务,并且此web服务将LookupRequest对象作为输入。
所以我的问题是,如何使用apache camel调用此查找web服务,以及如何为此web服务提供输入,即:查找对象。
另外,我如何才能确定wheather是一个jax-ws,因为我只有wsdl文件,并且我想使用apache- camel为该web服务创建客户端。
LookupRequest类看起来像这样:
public class LookupRequest {
@XmlElement(name = "EntityReference")
protected List<EntityReference> references;
@XmlElement(name = "AttachmentReference")
protected List<AttachmentLookupReference> attachmentReferences;
@XmlAttribute(name = "countryCode")
protected String countryCode;
@XmlAttribute(name = "languageCode")
protected String languageCode;
}我是否需要创建lookupRequest对象并将其发送到服务器,或者我也可以发送字符串?
发布于 2019-02-03 14:43:12
首先,您需要在CXF wsdl2java的帮助下从WSDL生成客户端。然后,您可以利用camel-cxf组件将请求发送到您想要调用的服务器,这里是您可以查看的an example。
发布于 2019-02-06 23:43:32
您可以尝试发送xml请求:
首先设置两个头.setheader("operationNamespace",tns别名的名称空间) .setheader("operationName","lookup")
然后使用cfx组件"cxf:{{url}}?wsdlURL=someWsdlInclasspath.wsdl&dataFormat=payload“
然后,您可以将请求作为xml发送(在body中)
https://stackoverflow.com/questions/54478125
复制相似问题