简体   繁体   English

通过WSDL调用Web服务

[英]Calling a web service via the WSDL

I have been following a tutorial to publish a web service which i have completed successfully 我一直在关注发布成功完成Web服务的教程

The wsdl can be found here - http://hotornot-hnwebservice.rhcloud.com/TomcatHotOrNot/messages?wsdl 该WSDL可以在这里找到- http://hotornot-hnwebservice.rhcloud.com/TomcatHotOrNot/messages?wsdl

The WSDL looks as follows; WSDL如下所示;

<!--
 Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.1-b03-. 
-->
<!--
 Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.1-b03-. 
-->
<definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://service.hotornot.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://service.hotornot.com/" name="ExposedFunctionsService">
<types>
<xsd:schema>
<xsd:import namespace="http://service.hotornot.com/" schemaLocation="http://hotornot-hnwebservice.rhcloud.com:80/TomcatHotOrNot/messages?xsd=1"/>
</xsd:schema>
</types>
<message name="addMessage">
<part name="parameters" element="tns:addMessage"/>
</message>
<message name="addMessageResponse">
<part name="parameters" element="tns:addMessageResponse"/>
</message>
<portType name="ExposedFunctions">
<operation name="addMessage">
<input message="tns:addMessage"/>
<output message="tns:addMessageResponse"/>
</operation>
</portType>
<binding name="ExposedFunctionsPortBinding" type="tns:ExposedFunctions">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="addMessage">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="ExposedFunctionsService">
<port name="ExposedFunctionsPort" binding="tns:ExposedFunctionsPortBinding">
<soap:address location="http://hotornot-hnwebservice.rhcloud.com:80/TomcatHotOrNot/messages"/>
</port>
</service>
</definitions>

Ideally i want to use android in order to invoke my web service. 理想情况下,我想使用android来调用我的Web服务。 My assumption that the WSDL should describe the service to give an indicator to how to call the web service. 我的假设是WSDL应该描述服务,从而为如何调用Web服务提供指示。

Can anyone help as to how i would call this web service from android? 任何人都可以帮助我如何从android调用此Web服务吗?

Thanks 谢谢

The WSDL describes the service ie its operations and structure. WSDL描述了服务,即其操作和结构。 It also specifies if it is available over HTTP etc. All this information is enough to call the service. 它还指定它是否可以通过HTTP等使用。所有这些信息足以调用该服务。 However you still need to go code the actual call to service. 但是,您仍然需要编写实际的服务调用代码。

Read this tutorial on how to call a web service from android. 阅读本教程 ,了解如何从android调用网络服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM