开发者

Retrieving WSDL for a single operation

开发者 https://www.devze.com 2023-03-20 12:57 出处:网络
Im a Newbie in wsdl parsing and my information about WSDL is very limited. I have a scenario in which there is a wsdl file with multiple operations and i wa开发者_开发问答nt to get the wsdl for a spe

Im a Newbie in wsdl parsing and my information about WSDL is very limited. I have a scenario in which there is a wsdl file with multiple operations and i wa开发者_开发问答nt to get the wsdl for a specific operation from that. Is there any libs in java or JS to accomplish such a task . Or am i missing something.

Please correct me if there is anything wrong in the question ,

Thanks in Advance Bijesh


WSDLs represent a single service with specific operations. Those operations belong to the service can't be separated from the service itself. In order to simply invoke one method you'll have to bind against the entire service (and all other operations and defined types). If you are publishing the operation, you'll have to bind and publish all operations and types defined in the service. There isn't really a way around that.

Now, in your case if you are using java and if you are acting as a client, you can do what Alfredo O alluded to and use a SOAP framework's tooling to generate all of the java client code for you. From there it's just a matter of using the actual service class and invoking the method on that class that corresponds to the method you want to call. You'll have to use the entire wsdl, but from the perspective of your code you won't have to worry about calling any other methods than the one that interests you.

Popular choices for generating a java client for a SOAP service are:

  • Apache CXF
  • Metro
  • Apache Axis2


You can use Axis 2 to auto-generate the java code needed to invoke those operations. Use the wsdl2java tool provided by Axis 2.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号