Exemple #1
0
        public SoapServerMethod(Type serverType, LogicalMethodInfo methodInfo)
        {
            TypeStubInfo type = TypeStubManager.GetTypeStub(serverType, "Soap");

            info = type.GetMethod(methodInfo.Name) as SoapMethodStubInfo;
            if (info == null)
            {
                throw new InvalidOperationException("Argument methodInfo does not seem to be a member of the server type.");
            }
        }
        public SoapDocumentationHandler(Type type, HttpContext context) : base(type)
        {
            _url = context.Request.Url.ToString();
            int i = _url.LastIndexOf('?');

            if (i != -1)
            {
                _url = _url.Substring(0, i);
            }
            _typeStubInfo = (SoapTypeStubInfo)TypeStubManager.GetTypeStub(ServiceType, "Soap");

            HttpRequest req = context.Request;
            string      key = null;

            if (req.QueryString.Count == 1)
            {
                key = req.QueryString.GetKey(0);
                if (key == null)
                {
                    key = req.QueryString [0];
                }

                if (key != null)
                {
                    key = key.ToLower(CultureInfo.InvariantCulture);
                }
            }

            if (key == "wsdl" || key == "schema" || key == "code" || key == "disco")
            {
                return;
            }

#if NET_2_0
            string help = WebServicesSection.Current.WsdlHelpGenerator.Href;
            string path = Path.GetDirectoryName(ConfigurationManager.OpenMachineConfiguration().FilePath);
#else
            string help = WSConfig.Instance.WsdlHelpPage;
            string path = Path.GetDirectoryName(WSConfig.Instance.ConfigFilePath);
#endif
            string appPath = AppDomain.CurrentDomain.GetData(".appPath").ToString();
            string vpath;
            if (path.StartsWith(appPath))
            {
                vpath = path.Substring(appPath.Length);
                vpath = vpath.Replace("\\", "/");
            }
            else
            {
                vpath = "/";
            }

            if (vpath.EndsWith("/"))
            {
                vpath += help;
            }
            else
            {
                vpath += "/" + help;
            }

            string physPath = Path.Combine(path, help);

#if !TARGET_JVM
            if (!File.Exists(physPath))
            {
                throw new InvalidOperationException("Documentation page '" + physPath + "' not found");
            }
#endif

            _pageHandler = PageParser.GetCompiledPageInstance(vpath, physPath, context);
        }
Exemple #3
0
 public HttpGetClientProtocol()
 {
     TypeStub = (HttpSimpleTypeStubInfo)TypeStubManager.GetTypeStub(GetType(), "HttpGet");
 }
Exemple #4
0
 public SoapHttpClientProtocol()
 {
     type_info = (SoapTypeStubInfo)TypeStubManager.GetTypeStub(this.GetType(), "Soap");
 }
 public HttpSoapWebServiceHandler(Type type) : base(type)
 {
     _typeStubInfo = (SoapTypeStubInfo)TypeStubManager.GetTypeStub(ServiceType, "Soap");
 }
Exemple #6
0
 public HttpSimpleWebServiceHandler(Type type, string protocolName)
     : base(type)
 {
     _typeInfo = (HttpSimpleTypeStubInfo)TypeStubManager.GetTypeStub(type, protocolName);
 }