简体   繁体   中英

How to call a webservice method for testing, e.g. from a browser

There is a dll webservice (made with Delphi) that has a method called List which returns a list of strings (widestring).

Is there any method for calling that service without having to write a client application for consuming it?.

Ex.: http://misitio.com:8080/miwebservice.dll?methodname=list

The Chrome App Postman can send SOAP requests. You just need to provide the Web Service URL, select POST, set the proper content-type header (text/xml, application/soap+xml, etc.), and provide the proper xml soap body in the request. Click Send.

Below is an example request which posts to a free weather web service .

在此处输入图片说明

Your request could be something like:

POST /WeatherWS/Weather.asmx/GetCityWeatherByZIP HTTP/1.1
Host: wsf.cdyne.com
Cache-Control: no-cache
Postman-Token: e5bc46a4-71ac-f357-78a7-c4b4de894afb
Content-Type: application/x-www-form-urlencoded

ZIP=90210

And the response will be:

<?xml version="1.0" encoding="utf-8"?>
<WeatherReturn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://ws.cdyne.com/WeatherWS/">
  <Success>true</Success>
  <ResponseText>City Found</ResponseText>
  <State>CA</State>
  <City>Beverly Hills</City>
  <WeatherStationCity>Van Nuys</WeatherStationCity>
  <WeatherID>4</WeatherID>
  <Description>Sunny</Description>
  <Temperature>68</Temperature>
  <RelativeHumidity>54</RelativeHumidity>
  <Wind>CALM</Wind>
  <Pressure>29.89R</Pressure>
  <Visibility />
  <WindChill />
  <Remarks />
</WeatherReturn>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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