In Fiddler when you choose the relevent request from the list on left and then click the "Session Inspector" tab on the right, the right side of the screen is splitted to the request (top) and response (bottom). Press the "TextView" above the response to
see what it was.
The remote certificate is invalid according to the validation procedure.
Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
Source Error:
Line 234: [return: System.Xml.Serialization.XmlElementAttribute("getHostbridgeResponse", Namespace="http://soapinterop.org/xsd")]
Line 235: public string getHostbridge([System.Xml.Serialization.XmlElementAttribute("getHostbridge", Namespace="http://soapinterop.org/xsd")] getHostbridge getHostbridge1) {
Line 236: object[] results = this.Invoke("getHostbridge", new object[] {
Line 237: getHostbridge1});
Line 238: return ((string)(results[0]));
Source File: C:\Documents and Settings\yinung\My Documents\Visual Studio 2005\Projects\RetrivePassword\RetrivePassword\Web References\UAS\Reference.cs Line: 236
According to the web site that you provided, I saw code for building a class:
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.IO;
using System.Net;
using System.Security.Cryptography.X509Certificates;
using System.Net.Security;
namespace ResortCom.LIB.Util
{
public class TrustAllCert
{
public TrustAllCert()
{
}
TrustAllCert ValCallback = new TrustAllCert();
ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(ValCallback.OnValidationCallback);
nResponse = expService.GetPkg(SiteId, out strUserPermissions);
========================================================
And in your function that calls the web service before you call it add this:
ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(ValCallback.OnValidationCallback);
yaronn01
Contributor
2754 Points
414 Posts
Re: Possible SOAP version mismatch
Nov 07, 2008 03:35 PM|LINK
Make sure you are sending the request to the following url:
http://staging2.it.okstate.edu/UAS/soap.php
In Fiddler when you choose the relevent request from the list on left and then click the "Session Inspector" tab on the right, the right side of the screen is splitted to the request (top) and response (bottom). Press the "TextView" above the response to see what it was.
Web Services Performance, Interoperability And Testing Blog
yinung@oksta...
Member
11 Points
56 Posts
Re: Possible SOAP version mismatch
Nov 07, 2008 04:24 PM|LINK
Thank you so much.
The request of TextView of Inspectors :
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><preauth xmlns="http://soapinterop.org/xsd"><Username>ldapguide</Username><Password>20LdaGuide07</Password><AuthSource>AD</AuthSource></preauth></soap:Header><soap:Body><getHostbridge xmlns="http://soapinterop.org/xsd"><Username> </Username><SAName>SCTT</SAName><HB_USER>fim</HB_USER><HB_PASS>10Fim2008</HB_PASS><attributes>system;hrs:region;sctt</attributes></getHostbridge></soap:Body></soap:Envelope>
======================================================================
And the reponse of TextView of Inspectors:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="https://staging2.it.okstate.edu/UAS/soap.php">here</a>.</p>
</body></html>
yaronn01
Contributor
2754 Points
414 Posts
Re: Possible SOAP version mismatch
Nov 07, 2008 04:50 PM|LINK
Then try to send the request to the suggested address (https and not http):
https://staging2.it.okstate.edu/UAS/soap.php
Web Services Performance, Interoperability And Testing Blog
yinung@oksta...
Member
11 Points
56 Posts
Re: Possible SOAP version mismatch
Nov 07, 2008 04:58 PM|LINK
After I send the request,
request TextView:
The data sent represents an SSLv3-compatible ClientHello handshake. For your convenience, the data is extracted below.
Major Version: 3
Minor Version: 1
Random: 49 14 81 5D AC AF 77 68 8E 13 0A 52 39 4B A7 0E BA CB 42 A5 64 19 6F 11 47 6C F2 7A 2F 6A E6 2E
SessionID: 71 AA 85 B8 68 06 8B E0 5D 80 8A 1C 80 0E E7 D8 5D BB 2C C0 0F 80 B3 8E 1E B0 94 3C 9C 34 91 B2
Ciphers:
[0004] SSL_RSA_WITH_RC4_128_MD5
[0005] SSL_RSA_WITH_RC4_128_SHA
[000A] SSL_RSA_WITH_3DES_EDE_SHA
[0009] SSL_RSA_WITH_DES_SHA
[0064] TLS_RSA_EXPORT1024_WITH_RC4_56_SHA
[0062] TLS_RSA_EXPORT1024_WITH_DES_SHA
[0003] SSL_RSA_EXPORT_WITH_RC4_40_MD5
[0006] SSL_RSA_EXPORT_WITH_RC2_40_MD5
[0013] SSL_DHE_DSS_WITH_3DES_EDE_SHA
[0012] SSL_DHE_DSS_WITH_DES_SHA
[0063] TLS_DHE_DSS_EXPORT1024_WITH_DES_SHA
====================================================
Response TextView:
This is a CONNECT tunnel, through which encrypted HTTPS traffic flows.
To view the encrypted sessions inside this tunnel, ensure that the Tools | Fiddler Options | Decrypt HTTPS traffic option is checked.
The data sent represents an SSLv3-compatible ServerHello handshake. For your convenience, the data is extracted below.
Major Version: 3
Minor Version: 1
SessionID: 71 AA 85 B8 68 06 8B E0 5D 80 8A 1C 80 0E E7 D8 5D BB 2C C0 0F 80 B3 8E 1E B0 94 3C 9C 34 91 B2
Random: 49 14 81 6E B9 2C 07 34 B3 50 F6 46 0A DF 6A 5B 54 E4 EB 6F 92 28 E8 73 CA 56 96 49 90 2A 32 59
Cipher: 0x04
yaronn01
Contributor
2754 Points
414 Posts
Re: Possible SOAP version mismatch
Nov 07, 2008 05:26 PM|LINK
And do you get the exact same exception at the client?
Also you need to configure Fiddler to decrypt ssl:
Tools-->Fiddler options--> check "Decrypt http traffic"
After this you will probably need to (temporarily) configure your client to trust Fiddler:
http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_23179662.html
Web Services Performance, Interoperability And Testing Blog
yinung@oksta...
Member
11 Points
56 Posts
Re: Possible SOAP version mismatch
Nov 07, 2008 06:08 PM|LINK
The Client gets server error message:
Server Error in '/' Application.
The remote certificate is invalid according to the validation procedure.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.
Source Error:
Source File: C:\Documents and Settings\yinung\My Documents\Visual Studio 2005\Projects\RetrivePassword\RetrivePassword\Web References\UAS\Reference.cs Line: 236
Stack Trace:
yaronn01
Contributor
2754 Points
414 Posts
Re: Possible SOAP version mismatch
Nov 07, 2008 08:41 PM|LINK
This is not a server error - this error comes from your client because Fiddler is interfering with ssl.
You need to add the few lines of code from the link I posted last time.
Web Services Performance, Interoperability And Testing Blog
yinung@oksta...
Member
11 Points
56 Posts
Re: Possible SOAP version mismatch
Nov 07, 2008 09:04 PM|LINK
Thank you.
According to the web site that you provided, I saw code for building a class:
using System;;hy.X509Certificates;
t sender, X509Certificate cert, X509Chain chain, SslPolicyErrors errors)
using System.Collections.Generic
using System.Text;
using System.Xml;
using System.IO;
using System.Net;
using System.Security.Cryptograp
using System.Net.Security;
namespace ResortCom.LIB.Util
{
public class TrustAllCert
{
public TrustAllCert()
{
}
public bool OnValidationCallback(objec
{
return true;
}
}
}
And others:
TrustAllCert ValCallback = new TrustAllCert();CertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(ValCallback.OnValidationCallback);
ServicePointManager.Server
nResponse = expService.GetPkg(SiteId, out strUserPermissions);
========================================================
Are those what you wanna me to add in my code?
yaronn01
Contributor
2754 Points
414 Posts
Re: Possible SOAP version mismatch
Nov 07, 2008 09:55 PM|LINK
public bool OnValidationCallback(object sender, X509Certificate cert, X509Chain chain, SslPolicyErrors errors)
{
return true;
}
And in your function that calls the web service before you call it add this:
ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(ValCallback.OnValidationCallback);
Also you need to add some of the "using" there.
Web Services Performance, Interoperability And Testing Blog
yinung@oksta...
Member
11 Points
56 Posts
Re: Possible SOAP version mismatch
Nov 10, 2008 01:35 PM|LINK
Good morning.
I tried adding the codes that you suggested, but I still got the same error message.
Is adding PHP web services more difficult than adding C#.NET web services into ASP web application?