由wsdl2java生成的异步SOAP服务请求

时间:2015-02-02 15:36:48

标签: java web-services soap asynchronous wsdl

我按照这里的示例:http://cxf.apache.org/docs/developing-a-consumer.html(部分“异步调用模型”)

它们展示了如何使用port.greetMeSometimeAsync()调用生成的代码。是的,这是可能的,因为从WSDL的greetMeSometime操作创建了三个方法:

public Future<?> greetMeSometimeAsync(
  String requestType,
  AsyncHandler<org.myorg.types.GreetMeSometimeResponse> asyncHandler
);

public Response<org.myorg.types.GreetMeSometimeResponse> greetMeSometimeAsync(
   String requestType);

public java.lang.String greetMeSometime(
   String requestType
);

但是当我发送包含以下内容的SOAP请求时

<greetMeSometimeAsync>
   <requestType>some string</requestType>
</greetMeSometimeAsync>

返回SOAP错误:

Message part greetMeSometimeAsync was not recognized.  (Does it exist in service WSDL?)

当然不是。 greetMeSometimeAsync仅在生成的代码中。原始的非异步方法完美无缺:

<greetMeSometime>
   <requestType>some string</requestType>
</greetMeSometime>

有没有办法告诉wsdl2javagreetMeSometime视为异步方法,而不附加“Async”后缀?

或者是否有其他替代解决方案来提供由wsdl2java生成的异步SOAP UI?

0 个答案:

没有答案