开发者

Web Service in Delphi 5

开发者 https://www.devze.com 2023-01-10 07:32 出处:网络
By u开发者_JAVA百科sing Delphi 5, can I call a function in web service which is developed in VB.Net and has some parameters and returns an XML? If yes, then what components will I use to call the web

By u开发者_JAVA百科sing Delphi 5, can I call a function in web service which is developed in VB.Net and has some parameters and returns an XML? If yes, then what components will I use to call the web service function and the XML that will be returned by that function?


I think that web services (SOAP) support was introduced in Delphi 6.
Upgrading to a newer Delphi version would certainly be the easiest way to get going.

If you can't, then you need an external library that implements SOAP support.

You can all the way to the HTTP protocol (in essence, SOAP web services are sending a specific form of XML over HTTP or HTTPS), but that is a lot of work.

You might be lucky with RemObjects SDK: it supports SOAP in Delphi, but I'm not sure it supports Delphi 5.

Give the RemObjects people a call or e-mail: they are really helpful, and you might be lucky.

--jeroen


we are tackling a similar problem here. However our solution to the problem may not be what you are looking for.

We have a fairly complex set of web services that we must make use and will require some amount of configuration and tweeking. So not to impact the development of the Delphi side of our system (very long cycles to release) we have created a series of hooks that divert the calls to a DLL, also in Delphi.

This DLL has the very simple task of forwarding the information received from the function call, format it a little and push it though an almost bare TCP socket.

From there the information goes to an interface engine where we can toy around the mappings and miscellaneous transformations that must be done prior to calling the services. The actual web service wrapping and calling is done in the engine native environment (Java).

Having a socket connection to call the engine allows a much simpler and lighter deployment environment where we do not have to worry about com/dcom or jni.

This sounds fairly complex but it turns out it simplified a lot the whole.

Alternative would have been to develop a COM DLL in C# to do the heavy lifting of the web side and connect this to delphi. This would also have been possible and depending on your deployment environment could be a simpler solution. We chose not to go this route because out setup is quite intricate with a mix of thick client, remote desktop of various nature and a very tight IT structure to work around with. It is easier to ask to open web access to a single machine and get internal socket to this server from the different clients than asking to open every clients to internet.

Otherwise in pure Delphi 5 accessing web service is not something I would call fun, so my first reflex here would be to use a more WS friendly platform and try to integrate them via some sort of bridge (COM, JNI, stdcall DLL etc).

Anyways, I hope this helps.


No experience myself consuming webservices using D5, but my first instinct would be to get an internet component set for the web access and a DOM library (ms xml, sax) to process the xml.

Having said that, you may be hard pressed to find components that still support D5. I am using the Indy internet components in one of my D5 apps and there is a specific Indy SOAP library for consuming web services. http://www.indyproject.org/index.en.aspx

Another internet library that may be of help is Francois Piette's Internet Component Suite (ICS): http://www.overbyte.be/frame_index.html

As for the xml processing, this page on the Delphi Developer's Guide to XML should help you on your way: http://keith-wood.name/DelphiXML/Software/index.html

0

精彩评论

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

关注公众号