/// <summary>
 /// Creates a new <see cref="DynamicWebServiceProxy"/> instance.
 /// </summary>
 /// <param name="wsdlLocation">Location of WSDL file</param>
 /// <param name="enableMessageAccess">Enables access to SOAP messages</param>
 /// <param name="wsdlCache">Type of caching to be used</param>
 /// <param name="certificate">Certificate to use.</param>
 internal DynamicWebServiceProxy(string wsdlLocation, bool enableMessageAccess = false, WsdlCache wsdlCache = WsdlCache.Both, X509Certificate2 certificate = null)
 {
     this.wsdl = wsdlLocation;
     this.enableMessageAccess = enableMessageAccess;
     this.serviceCache = new ServiceCache(wsdlLocation, wsdlCache, new ServiceCache.CacheMissEvent(BuildAssemblyFromWsdl));
     this.certificate = certificate;
     BuildProxy();
 }
Example #2
0
            internal MemoryCacheKey(string wsdlLocation, int contentHash, WsdlCache type)
            {
                Debug.Assert((type == WsdlCache.None && contentHash != 0) ||
                             (type != WsdlCache.None && contentHash == 0));

                this.wsdlLocation = wsdlLocation;
                this.contentHash = contentHash;
                this.type = type;
            }
Example #3
0
            internal MemoryCacheKey(string wsdlLocation, int contentHash, WsdlCache type)
            {
                Debug.Assert((type == WsdlCache.None && contentHash != 0) ||
                             (type != WsdlCache.None && contentHash == 0));

                this.wsdlLocation = wsdlLocation;
                this.contentHash  = contentHash;
                this.type         = type;
            }
Example #4
0
        public void __construct(string wsdl, [Optional] PhpArray options)
        {
            bool             enableMessageAccess = false;
            WsdlCache        wsdlCache           = WsdlCache.Both;
            X509Certificate2 certificate         = null;

            if (options != null)
            {
                object value;

                if (options.TryGetValue("trace", out value))
                {
                    enableMessageAccess = PHP.Core.Convert.ObjectToBoolean(value);
                }

                if (options.TryGetValue("cache_wsdl", out value))
                {
                    wsdlCache = (WsdlCache)value;//PHP.Core.Convert.ObjectToBoolean(value);//WsdlCache.None == 0, anything else is true
                }

                if (options.TryGetValue("exceptions", out value))
                {
                    exceptions = PHP.Core.Convert.ObjectToBoolean(value);
                }

                // certificate:
                string pass = null;

                if (options.TryGetValue("passphrase", out value))
                {
                    pass = Core.Convert.ObjectToString(value);
                }

                if (options.TryGetValue("local_cert", out value))
                {
                    var cert = Core.Convert.ObjectToString(value);
                    if (cert != null)
                    {
                        certificate = new X509Certificate2(cert, pass);
                    }
                }
            }

            try
            {
                wsp = new DynamicWebServiceProxy(wsdl, enableMessageAccess, wsdlCache, certificate);
            }
            catch (Exception exception)
            {
                SoapFault.Throw(ScriptContext.CurrentContext, "SOAP-ERROR", exception.Message, exceptions);
            }
        }
 /// <summary>
 /// Creates a new <see cref="DynamicWebServiceProxy"/> instance.
 /// </summary>
 /// <param name="wsdlLocation">Location of WSDL file</param>
 /// <param name="enableMessageAccess">Enables access to SOAP messages</param>
 /// <param name="wsdlCache">Type of caching to be used</param>
 /// <param name="certificate">Certificate to use.</param>
 /// <param name="version"></param>
 internal DynamicWebServiceProxy(string wsdlLocation, bool enableMessageAccess = false, WsdlCache wsdlCache = WsdlCache.Both, X509Certificate2 certificate = null, SoapVersion? version = null)
 {
     this.wsdl = wsdlLocation;
     this.enableMessageAccess = enableMessageAccess;
     this.serviceCache = new ServiceCache(wsdlLocation, wsdlCache, new ServiceCache.CacheMissEvent(BuildAssemblyFromWsdl));
     this.certificate = certificate;
     this.version = version;
     if (this.version == SoapVersion.SOAP_1_2)
         protocolName = "Soap12";
     else if (this.version == SoapVersion.SOAP_1_1)
         protocolName = "Soap";
     BuildProxy();
 }
 /// <summary>
 /// Creates a new <see cref="DynamicWebServiceProxy"/> instance.
 /// </summary>
 /// <param name="wsdlLocation">Location of WSDL file</param>
 /// <param name="enableMessageAccess">Enables access to SOAP messages</param>
 /// <param name="wsdlCache">Type of caching to be used</param>
 /// <param name="certificate">Certificate to use.</param>
 internal DynamicWebServiceProxy(string wsdlLocation, bool enableMessageAccess = false, WsdlCache wsdlCache = WsdlCache.Both, X509Certificate2 certificate = null)
 {
     this.wsdl = wsdlLocation;
     this.enableMessageAccess = enableMessageAccess;
     this.serviceCache        = new ServiceCache(wsdlLocation, wsdlCache, new ServiceCache.CacheMissEvent(BuildAssemblyFromWsdl));
     this.certificate         = certificate;
     BuildProxy();
 }
Example #7
0
 internal MemoryCacheKey(string wsdlLocation, WsdlCache type):
     this(wsdlLocation, 0, type)
 {
 }
Example #8
0
 public ServiceCache(string wsdlLocation, WsdlCache type, CacheMissEvent cacheMiss)
 {
     this.type = type;
     this.wsdlLocation = wsdlLocation;
     this.cacheMiss = cacheMiss;
 }
Example #9
0
 internal MemoryCacheKey(string wsdlLocation, WsdlCache type) :
     this(wsdlLocation, 0, type)
 {
 }
Example #10
0
 public ServiceCache(string wsdlLocation, WsdlCache type, CacheMissEvent cacheMiss)
 {
     this.type         = type;
     this.wsdlLocation = wsdlLocation;
     this.cacheMiss    = cacheMiss;
 }