X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=data%2Fnet_2_0%2FDefaultWsdlHelpGenerator.aspx;h=0b02fb5de572d5004ff0e4b0f15abad5f77dbdd6;hb=7a2a2a92225f55a8610c38a5c6ea619c84204dfd;hp=b1eac1fa1ccb307e2d09ad9cd17e233d1c37463e;hpb=9869ae24b88761ab261c4311e24f7383b4af3f02;p=mono.git diff --git a/data/net_2_0/DefaultWsdlHelpGenerator.aspx b/data/net_2_0/DefaultWsdlHelpGenerator.aspx index b1eac1fa1cc..0b02fb5de57 100644 --- a/data/net_2_0/DefaultWsdlHelpGenerator.aspx +++ b/data/net_2_0/DefaultWsdlHelpGenerator.aspx @@ -16,6 +16,7 @@ <%@ Import Namespace="System.Xml.Schema" %> <%@ Import Namespace="System.Web.Services" %> <%@ Import Namespace="System.Web.Services.Description" %> +<%@ Import Namespace="System.Web.Services.Configuration" %> <%@ Import Namespace="System" %> <%@ Import Namespace="System.Net" %> <%@ Import Namespace="System.Globalization" %> @@ -25,7 +26,9 @@ <%@ Import Namespace="System.CodeDom.Compiler" %> <%@ Import Namespace="Microsoft.CSharp" %> <%@ Import Namespace="Microsoft.VisualBasic" %> +<%@ Import Namespace="System.Text" %> <%@ Import Namespace="System.Text.RegularExpressions" %> +<%@ Import Namespace="System.Security.Cryptography.X509Certificates" %> <%@ Assembly name="System.Web.Services" %> <%@ Page debug="true" %> @@ -88,7 +91,7 @@ void Page_Load(object sender, EventArgs e) Page.DataBind(); ProfileViolations = new BasicProfileViolationCollection (); - WebServicesInteroperability.CheckConformance (WsiClaims.BP10, descriptions, ProfileViolations); + WebServicesInteroperability.CheckConformance (WsiProfiles.BasicProfile1_1, descriptions, ProfileViolations); } void BuildOperationInfo () @@ -122,7 +125,10 @@ void BuildOperationInfo () CurrentOperationProtocols += (string) prots[n]; } - CurrentOperationSupportsTest = prots.Contains ("HttpGet") || prots.Contains ("HttpPost"); + WebServiceProtocols testProtocols = WebServiceProtocols.HttpGet | WebServiceProtocols.HttpPost; + if (Context.Request.IsLocal) + testProtocols |= WebServiceProtocols.HttpPostLocalhost; + CurrentOperationSupportsTest = (WebServicesSection.Current.EnabledProtocols & testProtocols) != 0; // Operation format OperationBinding obin = FindOperation (binding, CurrentOperationName); @@ -313,6 +319,13 @@ bool HasFormResult get { return Request.QueryString ["ext"] == "testform"; } } +class NoCheckCertificatePolicy : ICertificatePolicy { + public bool CheckValidationResult (ServicePoint a, X509Certificate b, WebRequest c, int d) + { + return true; + } +} + string GetTestResult () { if (!HasFormResult) return null; @@ -346,7 +359,21 @@ string GetTestResult () { string url = location + "/" + CurrentOperationName; Uri uri = new Uri (url); - WebRequest req = WebRequest.Create (url + "?" + qs); + WebRequest req; + if (CurrentOperationProtocols.IndexOf ("HttpGet") < 0) { + req = WebRequest.Create (url); + req.Method="POST"; + if (!String.IsNullOrEmpty (qs)) { + byte [] postBuffer = Encoding.UTF8.GetBytes (qs); + req.ContentLength = postBuffer.Length; + using (Stream requestStream = req.GetRequestStream()) + requestStream.Write (postBuffer, 0, postBuffer.Length); + } + } + else + req = WebRequest.Create (url + "?" + qs); + if (url.StartsWith ("https:")) + ServicePointManager.CertificatePolicy = new NoCheckCertificatePolicy (); HttpCookieCollection cookies = Request.Cookies; int last = cookies.Count; if (last > 0) { @@ -1615,7 +1642,7 @@ function clearForm ()

<% if (ProfileViolations.Count > 0) { %>

Basic Profile Conformance

- This web service does not conform to WS-I Basic Profile v1.0 + This web service does not conform to WS-I Basic Profile v1.1 <% Response.Write ("