/// <summary> /// Create a new SOAP dispatch. /// </summary> /// <param name="Description">A description for this SOAP dispatch.</param> /// <param name="Matcher">A delegate to check if this dispatch applies.</param> /// <param name="HeaderAndBodyDelegate">A HTTP/SOAP delegate to invoke this dispatch.</param> public SOAPDispatch(String Description, SOAPMatch Matcher, SOAPHeaderAndBodyDelegate HeaderAndBodyDelegate) { this._Description = Description; this._Matcher = Matcher; this._HeaderAndBodyDelegate = HeaderAndBodyDelegate; }
/// <summary> /// Register a SOAP delegate. /// </summary> /// <param name="Hostname">The HTTP hostname.</param> /// <param name="URITemplate">The URI template.</param> /// <param name="Description">A description of this SOAP delegate.</param> /// <param name="SOAPMatch">A delegate to check whether this dispatcher matches the given XML.</param> /// <param name="SOAPHeaderAndBodyDelegate">A delegate to process a matching SOAP request.</param> public void RegisterSOAPDelegate(HTTPHostname Hostname, String URITemplate, String Description, SOAPMatch SOAPMatch, SOAPHeaderAndBodyDelegate SOAPHeaderAndBodyDelegate) { SOAPDispatcher _SOAPDispatcher = null; // Check if there are other SOAP dispatchers at the given URI template. var _Handler = GetHandler(HTTPHostname.Any, URITemplate, HTTPMethod.POST, ContentTypes => SOAPContentType); if (_Handler == null) { _SOAPDispatcher = new SOAPDispatcher(URITemplate, SOAPContentType); _SOAPDispatchers.Add(URITemplate, _SOAPDispatcher); // Register a new SOAP dispatcher AddMethodCallback(Hostname, HTTPMethod.POST, URITemplate, SOAPContentType, HTTPDelegate: _SOAPDispatcher.Invoke); // Register some information text for people using HTTP GET AddMethodCallback(Hostname, HTTPMethod.GET, URITemplate, SOAPContentType, HTTPDelegate: _SOAPDispatcher.EndpointTextInfo); } else { _SOAPDispatcher = _Handler.Target as SOAPDispatcher; } _SOAPDispatcher.RegisterSOAPDelegate(Description, SOAPMatch, SOAPHeaderAndBodyDelegate); }
/// <summary> /// Register a SOAP delegate. /// </summary> /// <param name="Hostname">The HTTP hostname.</param> /// <param name="URITemplate">The URI template.</param> /// <param name="Description">A description of this SOAP delegate.</param> /// <param name="SOAPMatch">A delegate to check whether this dispatcher matches the given XML.</param> /// <param name="SOAPHeaderAndBodyDelegate">A delegate to process a matching SOAP request.</param> public void RegisterSOAPDelegate(HTTPHostname Hostname, String URITemplate, String Description, SOAPMatch SOAPMatch, SOAPHeaderAndBodyDelegate SOAPHeaderAndBodyDelegate) { SOAPDispatcher _SOAPDispatcher = null; // Check if there are other SOAP dispatchers at the given URI template. var _Handler = GetHandler(HTTPHostname.Any, URITemplate, HTTPMethod.POST, ContentTypes => SOAPContentType); if (_Handler == null) { _SOAPDispatcher = new SOAPDispatcher(URITemplate, SOAPContentType); _SOAPDispatchers.Add(URITemplate, _SOAPDispatcher); // Register a new SOAP dispatcher AddMethodCallback(Hostname, HTTPMethod.POST, URITemplate, SOAPContentType, HTTPDelegate: _SOAPDispatcher.Invoke); // Register some information text for people using HTTP GET AddMethodCallback(Hostname, HTTPMethod.GET, URITemplate, SOAPContentType, HTTPDelegate: _SOAPDispatcher.EndpointTextInfo); } else _SOAPDispatcher = _Handler.Target as SOAPDispatcher; _SOAPDispatcher.RegisterSOAPDelegate(Description, SOAPMatch, SOAPHeaderAndBodyDelegate); }
/// <summary> /// Register a SOAP delegate. /// </summary> /// <param name="Description">A description of this SOAP delegate.</param> /// <param name="SOAPMatch">A delegate to check whether this dispatcher matches the given XML.</param> /// <param name="SOAPHeaderAndBodyDelegate">A delegate to process a matching SOAP request.</param> public void RegisterSOAPDelegate(String Description, SOAPMatch SOAPMatch, SOAPHeaderAndBodyDelegate SOAPHeaderAndBodyDelegate) { _SOAPDispatches.Add(new SOAPDispatch(Description, SOAPMatch, SOAPHeaderAndBodyDelegate)); }