Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: How to develop a web service client with certificate?


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 4 - Last Post: Nov 12, 2014 4:10 PM Last Post By: David Pedrelli Threads: [ Previous | Next ]
Livio Costa

Posts: 2
Registered: 11/13/01
How to develop a web service client with certificate?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 26, 2014 5:05 PM
Hello, I'm New Here. I have to develop a web service client that uses certificates to connect and I have not found a specific tutorial. I have only found tutorials for simple web services.
1) I Have these two file: Ca_yyyy.pem and xxservice.cer. I use Delphi XE7 and I have set the property httprio1.HTTPWebNode.ClientCertificate with xxservice.cer and I installed xxservice.cer in windows xp. What should I do with the file Ca_yyy.pem?
2)In the specifications I found this Directive: POST /xxxxxxxxxxxxxxxx/xxxxxxxxxx/xxxxxxxxxx HTTP/1.1. What should I do with it?
Please help me, I will not develop in Java, I would stay in Delphi.

Many thanks
David Pedrelli

Posts: 13
Registered: 6/28/98
Re: How to develop a web service client with certificate?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 27, 2014 1:09 PM   in response to: Livio Costa in response to: Livio Costa
Hi,

I assume that you are publishing this through a Web server, like IIS. Do you want to use certificates to verify the 1) identity of the client, 2) verify the server, or 3) just encrypt the traffic?

If it is #2 or #3, you should be able to install a certificate on the server, and only allow HTTPS traffic. That will force all clients to use the certificate.

Livio Costa wrote:
Hello, I'm New Here. I have to develop a web service client that uses certificates to connect and I have not found a specific tutorial. I have only found tutorials for simple web services.
1) I Have these two file: Ca_yyyy.pem and xxservice.cer. I use Delphi XE7 and I have set the property httprio1.HTTPWebNode.ClientCertificate with xxservice.cer and I installed xxservice.cer in windows xp. What should I do with the file Ca_yyy.pem?
2)In the specifications I found this Directive: POST /xxxxxxxxxxxxxxxx/xxxxxxxxxx/xxxxxxxxxx HTTP/1.1. What should I do with it?
Please help me, I will not develop in Java, I would stay in Delphi.

Many thanks

Edited by: David Pedrelli on Oct 27, 2014 1:11 PM
Livio Costa

Posts: 2
Registered: 11/13/01
Re: How to develop a web service client with certificate?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 27, 2014 4:38 PM   in response to: David Pedrelli in response to: David Pedrelli
Thanks for Your help.
I'm not pubblishing server side, I have only to develop a client web service to comunicate with a national web service.
I am able to develop a simple webservice client but in this case is different.
I have received a number of specifications including: a CA_xxxxx.pem and a .cer files, and various parameters (for http header I think):
POST /xxxxxxxxxxxx/xxxxxxxxx/xxxxxxxxxxxx HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://xxxxxxxxxxx.wsdl.xxxxx.xxxxx.xxxxxxx.it/xxxxxxxxxx"
Authorization: Basic ...................................
Content-Length: 1049
Host: xxxxxxxxxxxxxxxxx.xxxxxxxxxx.xxxxxx.it
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

I have developed a delphi xe7 project with httprio component and I have imported the wsdl file, but I do not know where to put the above parameters and how to use the two files.

Edited by: Livio Costa on Oct 27, 2014 4:39 PM
David Pedrelli

Posts: 13
Registered: 6/28/98
Re: How to develop a web service client with certificate?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 12, 2014 2:06 PM   in response to: Livio Costa in response to: Livio Costa
Livio,

I am not sure what you mean. The lines that you have "POST" through "User-Agent" are all part of the SOAP message and are generated by the THTTPRIO component.

David

Livio Costa wrote:
Thanks for Your help.
I'm not pubblishing server side, I have only to develop a client web service to comunicate with a national web service.
I am able to develop a simple webservice client but in this case is different.
I have received a number of specifications including: a CA_xxxxx.pem and a .cer files, and various parameters (for http header I think):
POST /xxxxxxxxxxxx/xxxxxxxxx/xxxxxxxxxxxx HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://xxxxxxxxxxx.wsdl.xxxxx.xxxxx.xxxxxxx.it/xxxxxxxxxx"
Authorization: Basic ...................................
Content-Length: 1049
Host: xxxxxxxxxxxxxxxxx.xxxxxxxxxx.xxxxxx.it
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

I have developed a delphi xe7 project with httprio component and I have imported the wsdl file, but I do not know where to put the above parameters and how to use the two files.

Edited by: Livio Costa on Oct 27, 2014 4:39 PM
David Pedrelli

Posts: 13
Registered: 6/28/98
Re: How to develop a web service client with certificate?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 12, 2014 4:10 PM   in response to: Livio Costa in response to: Livio Costa
I am not sure if it is what you want, but under THTTPRIO.HTTPWebNode, you can set a ClientCertificate.

Livio Costa wrote:
Hello, I'm New Here. I have to develop a web service client that uses certificates to connect and I have not found a specific tutorial. I have only found tutorials for simple web services.
1) I Have these two file: Ca_yyyy.pem and xxservice.cer. I use Delphi XE7 and I have set the property httprio1.HTTPWebNode.ClientCertificate with xxservice.cer and I installed xxservice.cer in windows xp. What should I do with the file Ca_yyy.pem?
2)In the specifications I found this Directive: POST /xxxxxxxxxxxxxxxx/xxxxxxxxxx/xxxxxxxxxx HTTP/1.1. What should I do with it?
Please help me, I will not develop in Java, I would stay in Delphi.

Many thanks
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02