on 2014 Feb 07 6:29 PM
Background
After watching
So far i have
Created a web service in PowerBuilder 12.5 .NET
Added WS Security to the service, implementing message security with a certificate
Created s WCF client in Visual Studio to consume the service
Added WS Security to the client, implementing message security with a certificate
Called the service from the client and it works flawlessly.
When i try to do the same with a PowerBuilder 12.5 .NET client however i constantly get the error
"Message "The client certificate is not provided. Specify a client certificate in ClientCredentials. " string" |
Regardless of where in the client I specify the certificate details i get the same error.
Also,whenever i deploy the client application the generated config generated does not have the certificate details within in it.
Any help would be greatly appreciated
Request clarification before answering.
Hi,
Did you set the certification in the soapconnection properties
Rgds.
Abdallah.
Sets the certificate file or files to use to connect to a Web service. This
method is available for .NET Web services only.
conn.SetClientCertificateFile (string filename)
Argument | Description |
---|---|
conn | The name of the SoapConnection object that establishes the |
filename | A string containing the name of the certificate file or files |
Long. Valid values are 0
for
success, and 50
for failure.
You can call the SetClientCertificateFile method
instead of including certificate information in the options argument of the SetOptions method.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andre,
You're right. PB .Net does not support soapconnection class.
I did some tests and could find how to set the certificate.
I guess that you have already generated the proxy. In my case, I have of WS with a method
getGUID(). which returns a System.Guid
string ls_soapResponse
long ll_result
PBWS.pbws_EmployeesServiceSoapClient proxy_obj
proxy_obj = create PBWS.pbws_EmployeesServiceSoapClient
//----------------
PBWCF.WCFEndpointAddress ld_endpoint
ld_endpoint = create PBWCF.WCFEndpointAddress
ld_endpoint.URL = sle_url.text
try
proxy_obj.wcfConnectionObject.EndpointAddress = ld_endpoint
proxy_obj.wcfConnectionObject.ClientCredential.ClientCertificate.SubjectName = "c:\temp\mycert.cer"
ls_soapResponse = proxy_obj.getGUID().ToString()
mle_1.text = "SOAP Response : " + ls_soapResponse + "~r~n"
catch ( System.Net.WebException e )
mle_1.text += "Error Cannot invoke Web service. Exception info: " + e.Message
end try
Hope this helps.
Abdallah.
I have tried and it still doesn't work same error unfortunately.Below i have uploaded a few images o show the code in debug mode after the error has occurred.
This is the exception i get
the certificate is set there so what am i missing?
this is the code for where i set the certificate
both CLientCredential areas of the connection object the certificate is set. I cant see what i am missing.
I noticed that within the m_service object the client certificate isnt set is this where i need to set it? Is it possible to access these "Non-public members" to do so?
I also noticed a few thing which are odd
Hi Andre,
In my case, I give only the subjectName which is the full path to the certficate.
See this link :
ClientCertificateCredential Class
Regards.
Abdallah.
User | Count |
---|---|
71 | |
33 | |
9 | |
8 | |
8 | |
7 | |
7 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.