X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=data%2Fnet_2_0%2FDefaultWsdlHelpGenerator.jvm.aspx;h=b56e80052a4242b41c9826e7fe67243e57bf2516;hb=a341404ecdd3b5ca2ed0ab1e9a5bcb9b5ccd2566;hp=e1152937cd5919cf0a1a7ecc9ac38fa6f563795c;hpb=04d1b4116331e3813b8f75304f714a5d61ba1214;p=mono.git diff --git a/data/net_2_0/DefaultWsdlHelpGenerator.jvm.aspx b/data/net_2_0/DefaultWsdlHelpGenerator.jvm.aspx index e1152937cd5..b56e80052a4 100755 --- a/data/net_2_0/DefaultWsdlHelpGenerator.jvm.aspx +++ b/data/net_2_0/DefaultWsdlHelpGenerator.jvm.aspx @@ -16,6 +16,8 @@ <%@ 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" %> @@ -25,6 +27,7 @@ <%@ Import Namespace="System.CodeDom.Compiler" %> <%@ Import Namespace="Microsoft.CSharp" %> <%@ Import Namespace="Microsoft.VisualBasic" %> +<%@ Import Namespace="System.Text" %> <%@ Import Namespace="System.Text.RegularExpressions" %> <%@ Assembly name="System.Web.Services" %> <%@ Page debug="true" %> @@ -88,7 +91,9 @@ void Page_Load(object sender, EventArgs e) Page.DataBind(); ProfileViolations = new BasicProfileViolationCollection (); - //WebServicesInteroperability.CheckConformance (WsiClaims.BP10, 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 () @@ -122,7 +127,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); @@ -296,7 +304,8 @@ OperationBinding FindOperation (Binding binding, string name) string FormatBindingName (string name) { - if (name == DefaultBinding) return "Methods"; + if (name.EndsWith("Soap")) return "Soap 1.1"; + else if (name.EndsWith("Soap12")) return "Soap 1.2"; else return "Methods for binding
" + name; } @@ -346,7 +355,20 @@ string GetTestResult () { string url = location + "/" + CurrentOperationName; Uri uri = new Uri (url); - WebRequest req = WebRequest.Create (url + ".invoke?" + qs); + WebRequest req; + if (CurrentOperationProtocols.IndexOf ("HttpGet") < 0) { + req = WebRequest.Create (url + ".invoke"); + 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 + ".invoke?" + qs); HttpCookieCollection cookies = Request.Cookies; int last = cookies.Count; if (last > 0) { @@ -366,7 +388,7 @@ string GetTestResult () } catch (Exception ex) { - string res = "" + ex.Message + "
" + ex.StackTrace.Replace("\n", "
") + "
"; + string res = "" + ex.Message + ""; WebException wex = ex as WebException; if (wex != null) { @@ -757,7 +779,6 @@ public class HtmlSampleGenerator: SampleGenerator static readonly XmlQualifiedName anyType = new XmlQualifiedName ("anyType",XmlSchema.Namespace); static readonly XmlQualifiedName arrayType = new XmlQualifiedName ("Array","http://schemas.xmlsoap.org/soap/encoding/"); static readonly XmlQualifiedName arrayTypeRefName = new XmlQualifiedName ("arrayType","http://schemas.xmlsoap.org/soap/encoding/"); - const string SoapEnvelopeNamespace = "http://schemas.xmlsoap.org/soap/envelope/"; const string WsdlNamespace = "http://schemas.xmlsoap.org/wsdl/"; const string SoapEncodingNamespace = "http://schemas.xmlsoap.org/soap/encoding/"; @@ -892,6 +913,10 @@ public class HtmlSampleGenerator: SampleGenerator public string GenerateSoapMessage (OperationBinding obin, Operation oper, OperationMessage msg) { + string SoapEnvelopeNamespace = "http://schemas.xmlsoap.org/soap/envelope/"; + if(obin.Binding.Name.EndsWith("Soap12")) + SoapEnvelopeNamespace = "http://www.w3.org/2003/05/soap-envelope"; + SoapOperationBinding sob = obin.Extensions.Find (typeof(SoapOperationBinding)) as SoapOperationBinding; SoapBindingStyle style = (sob != null) ? sob.Style : SoapBindingStyle.Document; @@ -1502,7 +1527,7 @@ public class HtmlSampleGenerator: SampleGenerator .title { color:dimgray; font-family: Arial; font-size:20pt; font-weight:900} .operationTitle { color:dimgray; font-family: Arial; font-size:15pt; font-weight:900} .method { font-size: x-small } - .bindingLabel { font-size: x-small; font-weight:bold; color:darkgray; line-height:8pt; display:block; margin-bottom:3px } + .bindingLabel { font-size: medium; font-weight:bold; color:darkgray; line-height:8pt; display:block; margin-bottom:3px } .label { font-size: small; font-weight:bold; color:darkgray } .paramTable { font-size: x-small } .paramTable TR { background-color: gainsboro } @@ -1551,8 +1576,10 @@ function clearForm () Overview
Service Description +

@@ -1581,7 +1608,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 ("