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; }
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); }