Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 953
  • Last Modified:

Using Delphi 2010, Example required for Web Service Server communicating with Client

Can anyone hep me with a working example code of a Delphi Web Service Server that can communicate with a Delphi Webservice Client.  It just needs to send a request from the Clinet to the server and get a reply from the server and display it on the client.
0
HenryM2
Asked:
HenryM2
  • 5
  • 5
2 Solutions
 
epasquierCommented:
here is a sample group of projects :

* WebService Server (GUI mode)

* WebService Server (console mode)

* WebService Client (GUI)

Hope you'll like it, it's derived from a sample I made for a client once, I simplified it just a bit.
You'll see many improvements from Delphi wizard samples. Especially in console mode
WebService-Sample.zip
0
 
HenryM2Author Commented:
OK thanks, this looks nice although I once again need to untie a few knots.  From what I read elsewhere, it appears as if messages are transferred via xml file, is this so, and is this the included IMyWebService.xml.

Then WSConsole and  Main requires IdHTTPWebBrokerBridge in its Uses clause.  What is this and where do I find it.  
0
 
epasquierCommented:
IdHTTPWebBrokerBridge is an Indy 10 unit, included in Delphi. I use XE, but it has to be in Delphi 2010 as well.

the XML file is in fact a .XSDL file (WebService Description Language), it is what defines the interface implemented by the server. This file is generated by the server application itself (you can open the browser, point to the WebServer default HTTP page which will provide a link to download it). Then you import this file to generate the client unit
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
HenryM2Author Commented:
I have 2010 Prodesional.  I went through all the Indys and can't find IdHTTPWebBrokerBridge, unless it is called something else, which I doubt.  I however have ordered XE Profesional and my licence was supposed to have been mailed to me already, so hopefully I will receive that today.
0
 
epasquierCommented:
Well, I have XE pro, and I doubt that this unit is not included in D2010 Pro.
For me it's there :
C:\Program Files (x86)\Embarcadero\RAD Studio\8.0\source\Indy10\Protocols

if you can't find it, try (re)installing Indy 10
http://www.indyproject.org/Sockets/Download/Files/Indy10.EN.aspx

I post the unit, just for reference, so that you know what to look after. You'll probably need a bunch of other files if you just copy that unit in your project directory, but who knows ?
IdHTTPWebBrokerBridge.pas
0
 
HenryM2Author Commented:
Interesting, I ran a search for IdHTTPWebBrokerBridge under Program Files for   and it popped up for my D7 installation (C:\Program Files\Borland\Delphi7\Source\), but nothing under 2010.

Unless I am midding something, on my side the paths for Indy look different i.e. RAD Studio\7.0 instead of yours being RAD Studio\8.0 with the folders as below, but nothing about IdHTTPWebBrokerBridge in any of these.
C:\Program Files\Embarcadero\RAD Studio\7.0\source\Indy\Indy10\Core\
C:\Program Files\Embarcadero\RAD Studio\7.0\source\Indy\Indy10\Protocols\
C:\Program Files\Embarcadero\RAD Studio\7.0\source\Indy\Indy10\System\

Thanks for you kind assitance in this.
 
0
 
epasquierCommented:
so you do have the Protocols directory, but no IdHTTPWebBroketBridge ?
Well, consider putting the one I gave you there, and see if it screams for another missing unit.
Can you list the files you have there so I compare with mines ?
0
 
lomo74Commented:
D2010 here --
no IdHTTPWebBrokerBridge.pas, nor .dcu
maybe this could help https://forums.embarcadero.com/message.jspa?messageID=200405
0
 
HenryM2Author Commented:
Guys, I hope I am awarding the points fairly.  

Lomo74, after your comment I decided to waste no further time to try and get IdHTTPWebBrokerBridge running in my D2010.  Since I received my XE2 licence this afternoon, I rather went ahead and installed it.  

epasquier, Your sample application worked like a charm, first time, on XE2, so I can take it from here.  Thanks.
0
 
epasquierCommented:
Guys, I hope I am awarding the points fairly.  
considering that you where stuck on a stupid problem (D2010 not having a fairly common unit...) and lomo74 prevented that you loose any more time on it, he deserved your recognition.

I can understand your doubts about giving only 400 pts x4 (grade)  for a complete Webservice system, that is not that much compared to some easier questions that gives 500x4. That is how the game is here and I accept it, don't worry.
Fortunately I didn't built these 3 apps only for you, I had them almost like I posted here. I just took 2 hours to clear it from reference to a customer, and simplified it so that I don't have to publish a bunch of custom units (I have a complex log system, much more than those simple functions in EPTools unit)

And I'm sure that I have earned from you more than points but your recognition as well.

Now, I can give you a trick to give extra bonus to multiple experts on a question, without having to diminish what you give to one to send your thanks to another contributor :
mark the question as Neglected : it will give 200pts bonus to all experts having one or more message accepted as part of the solution.
For ex., in this case, you give
475 to me for the tough work => (475 + 200)*4 = 2700 pts
25 for Iomo for the quick but decisive remark => (25+200)*4 = 900 pts

That way, it's impossible that any expert can feel being unfairly rewarded, even if there are 4 or 5 helping answers
0
 
HenryM2Author Commented:
Hi epasquier, thank you for your feedabck and yes, you have erned much more than points, but respect in the way you , the experts, treat those that is not as far down the road of experience that you are. There is just so much to learn plus new things every single day, while trying to make a living at the same time, where one is weak another is strong, which in the end makes Experts Exchange such a wonderfull tool.

Thanks for the tip of awarding points, I will keep that in mind in the future.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now