> Think of this hook-object a as "strategy" or "command" that will be integrated at some point of the execution-process of a webservice.
Inheritance: IClientMessageInspector
Exemple #1
0
        public BLZServicePortTypeClient CreateServiceFor(BankDataAccessor accessor)
        {
            var messageInspector = new XmlMessageInspector ();
            // bind some simple handling methods to connect our crafted events
            messageInspector.SoapXmlRequestOccured += accessor.OnSoapXmlActionOccured;
            messageInspector.SoapXmlResponseOccured += accessor.OnSoapXmlActionOccured;

            // inject our inspector into a concrete behavior
            var messageBehavior = new InterceptMessageBehavior (messageInspector);

            var client = new BLZServicePortTypeClient (new BasicHttpBinding (),
                            new EndpointAddress ("http://www.thomas-bayer.com/axis2/services/BLZService"));

            // here we can inject an interception object, which itself calls in our case
            // the inspector, that catches the XML Messages and raises the defined events
            client.Endpoint.Behaviors.Add (messageBehavior);

            // and now we have the client ready for "action" :-)
            return client;
        }
Exemple #2
0
        public BLZServicePortTypeClient CreateServiceFor(BankDataAccessor accessor)
        {
            var messageInspector = new XmlMessageInspector();

            // bind some simple handling methods to connect our crafted events
            messageInspector.SoapXmlRequestOccured  += accessor.OnSoapXmlActionOccured;
            messageInspector.SoapXmlResponseOccured += accessor.OnSoapXmlActionOccured;

            // inject our inspector into a concrete behavior
            var messageBehavior = new InterceptMessageBehavior(messageInspector);

            var client = new BLZServicePortTypeClient(new BasicHttpBinding(),
                                                      new EndpointAddress("http://www.thomas-bayer.com/axis2/services/BLZService"));

            // here we can inject an interception object, which itself calls in our case
            // the inspector, that catches the XML Messages and raises the defined events
            client.Endpoint.Behaviors.Add(messageBehavior);

            // and now we have the client ready for "action" :-)
            return(client);
        }