wsdl java,使用Java中的WSDL访问Web服务的最快方法

本文介绍了如何通过Java调用具有WSDL的Web服务。首先,使用wsimport工具生成服务客户端代码。然后,创建服务类的实例并获取端点以调用操作。虽然过程中遇到SOAP1.2绑定警告,但不清楚是否会导致实际问题。
摘要由CSDN通过智能技术生成

I need to access a webservice from Java. The service has a WSDL. Now how do I get to calling its operations?

I've already used wsimport on it, but that only generates XML objects for the operations/responses, nothing to actually call them.

I've looked at Spring-WS but it doesn't look like it's completely what I want (even though it might be part of the solution). The word "wsdl" doesn't appear in that page at all.

解决方案

wsimport does not only generate the Objects needed for communication with the service but also a service client. Create an instance of the class MSaleService and fetch the port with getMSaleServiceSoap(). That's it.

There might be some problems though. wsimport complained about

[WARNING] SOAP port "MSaleServiceSoap12": uses a non-standard SOAP 1.2 binding.

line 530 of http://vas.mikro-odeme.com/services/msaleservice.asmx?wsdl

but I don't know if this poses real problems.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值