在Win32中开始使用SOAP for Delphi

时间:2022-07-08 09:59:34

I have a server process built in Delphi/C++Builder with RemObjects SDK which claims to support SOAP requests.

我有一个使用RemObjects SDK在Delphi / C ++ Builder中构建的服务器进程,声称支持SOAP请求。

What's the quickest and easiest way of testing out the SOAP support? I'd prefer not to have to learn a new language/install a new IDE/spend more than a day...

测试SOAP支持的最快捷,最简单的方法是什么?我不想学习新语言/安装新的IDE /花费超过一天......

To clarify this, I'm already connecting to the server happily using the RO native protocol, and have SOAP enabled, but I want to test how systems NOT based on the RO SDK can use it. Using RO SOAP for both client and server doesn't accomplish this...

为了澄清这一点,我已经使用RO本机协议愉快地连接到服务器,并启用了SOAP,但我想测试不基于RO SDK的系统如何使用它。为客户端和服务器使用RO SOAP无法实现此目的......

4 个解决方案

#1


5  

I haven't tried it with RemObjects, but if the server already supports SOAP, I can't think of an easier way to test it than to simply consume the web service using Delphi and call each of the methods. It's surprisingly straight forward.

我没有尝试使用RemObjects,但如果服务器已经支持SOAP,我想不出更容易测试它的方法,而不是简单地使用Delphi使用Web服务并调用每个方法。这是令人惊讶的直截了当。

  • Create a new application.
  • 创建一个新的应用程序

  • In File|New|Other|WebServices choose WSDL Importer.
  • 在File | New | Other | WebServices中选择WSDL Importer。

  • Enter the server's WSDL page. A wrapper unit is created for you with all of the web service methods and any additional classes/enumerations the web service uses.
  • 输入服务器的WSDL页面。使用所有Web服务方法以及Web服务使用的任何其他类/枚举为您创建包装器单元。

Just above the Implementation section, you will see a method to return an instance of your web service class:

在Implementation部分的上方,您将看到一个返回Web服务类实例的方法:

function GetMyServerSoap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): MyServerSoap;

Instantiate it with the defaults and start calling methods.

使用默认值实例化它并开始调用方法。

If you want/need to see the XML being sent and received, supply your own HTTPRIO component and use the OnBeforeExecute and OnExecute events.

如果您希望/需要查看正在发送和接收的XML,请提供您自己的HTTPRIO组件并使用OnBeforeExecute和OnExecute事件。

#2


4  

Try soapUI - it is a free SOAP toolkit which makes it easy to analyze and test SOAP services.

尝试soapUI - 它是一个免费的SOAP工具包,可以轻松分析和测试SOAP服务。

soapUI is a free and open source desktop application for

soapUI是一个免费的开源桌面应用程序

* inspecting Web Services
* invoking Web Services
* developing Web Services
* Web Services Simulation and Mocking
* Functional, Load and Compliance testing of Web Services

It is mainly aimed at developers and testers providing or consuming WSDL or REST based Web Services (Java, .net, etc). Functional and Load Testing can be done both interactively in soapUI or within an automated build or integration process using the soapUI command line tools.

它主要针对提供或使用基于WSDL或REST的Web服务(Java,.net等)的开发人员和测试人员。功能和负载测试可以在soapUI中交互式完成,也可以使用soapUI命令行工具在自动构建或集成过程中完成。

#3


2  

Follow the tutorials on their web site. That worked for me.

按照他们网站上的教程进行操作。这对我有用。

#4


1  

Just publish your service with TROSOAPMessage, like others message formats like TROBinMessage, that it.

只需使用TROSOAPMessage发布您的服务,就像其他消息格式一样,如TROBinMessage。

Check the RO website tutorials about the subject

查看RO网站有关该主题的教程

#1


5  

I haven't tried it with RemObjects, but if the server already supports SOAP, I can't think of an easier way to test it than to simply consume the web service using Delphi and call each of the methods. It's surprisingly straight forward.

我没有尝试使用RemObjects,但如果服务器已经支持SOAP,我想不出更容易测试它的方法,而不是简单地使用Delphi使用Web服务并调用每个方法。这是令人惊讶的直截了当。

  • Create a new application.
  • 创建一个新的应用程序

  • In File|New|Other|WebServices choose WSDL Importer.
  • 在File | New | Other | WebServices中选择WSDL Importer。

  • Enter the server's WSDL page. A wrapper unit is created for you with all of the web service methods and any additional classes/enumerations the web service uses.
  • 输入服务器的WSDL页面。使用所有Web服务方法以及Web服务使用的任何其他类/枚举为您创建包装器单元。

Just above the Implementation section, you will see a method to return an instance of your web service class:

在Implementation部分的上方,您将看到一个返回Web服务类实例的方法:

function GetMyServerSoap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): MyServerSoap;

Instantiate it with the defaults and start calling methods.

使用默认值实例化它并开始调用方法。

If you want/need to see the XML being sent and received, supply your own HTTPRIO component and use the OnBeforeExecute and OnExecute events.

如果您希望/需要查看正在发送和接收的XML,请提供您自己的HTTPRIO组件并使用OnBeforeExecute和OnExecute事件。

#2


4  

Try soapUI - it is a free SOAP toolkit which makes it easy to analyze and test SOAP services.

尝试soapUI - 它是一个免费的SOAP工具包,可以轻松分析和测试SOAP服务。

soapUI is a free and open source desktop application for

soapUI是一个免费的开源桌面应用程序

* inspecting Web Services
* invoking Web Services
* developing Web Services
* Web Services Simulation and Mocking
* Functional, Load and Compliance testing of Web Services

It is mainly aimed at developers and testers providing or consuming WSDL or REST based Web Services (Java, .net, etc). Functional and Load Testing can be done both interactively in soapUI or within an automated build or integration process using the soapUI command line tools.

它主要针对提供或使用基于WSDL或REST的Web服务(Java,.net等)的开发人员和测试人员。功能和负载测试可以在soapUI中交互式完成,也可以使用soapUI命令行工具在自动构建或集成过程中完成。

#3


2  

Follow the tutorials on their web site. That worked for me.

按照他们网站上的教程进行操作。这对我有用。

#4


1  

Just publish your service with TROSOAPMessage, like others message formats like TROBinMessage, that it.

只需使用TROSOAPMessage发布您的服务,就像其他消息格式一样,如TROBinMessage。

Check the RO website tutorials about the subject

查看RO网站有关该主题的教程