<%@ 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.Web.Configuration" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.Globalization" %>
<%@ 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.DataBind();
ProfileViolations = new BasicProfileViolationCollection ();
- WebServicesInteroperability.CheckConformance (WsiProfiles.BasicProfile1_1, descriptions, ProfileViolations);
+ foreach (WsiProfilesElement claims in ((WebServicesSection) WebConfigurationManager.GetSection("system.web/webServices")).ConformanceWarnings)
+ if (claims.Name != WsiProfiles.None)
+ WebServicesInteroperability.CheckConformance (claims.Name, descriptions, ProfileViolations);
}
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);
{
string url = location + "/" + CurrentOperationName;
Uri uri = new Uri (url);
- HttpWebRequest req = (HttpWebRequest) WebRequest.Create (url + "?" + qs);
+ WebRequest req;
+ if (CurrentOperationProtocols.IndexOf ("HttpGet") < 0) {
+ req = WebRequest.Create (url);
+ req.Method="POST";
+ if (!String.IsNullOrEmpty (qs)) {
+ req.ContentType = "application/x-www-form-urlencoded";
+ 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;
</script>
-<head>
+<head runat="server">
<link rel="alternate" type="text/xml" href="<%=Request.FilePath%>?disco"/>
<title><%=WebServiceName%> Web Service</title>
<p class="label">Web Service Overview</p>
<%=WebServiceDescription%>
<br/><br/>
- <% if (ProfileViolations.Count > 0) { %>
+ <% if (ProfileViolations != null && ProfileViolations.Count > 0) { %>
<p class="label">Basic Profile Conformance</p>
- 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 ("<ul>");
foreach (BasicProfileViolation vio in ProfileViolations) {