Exemplo n.º 1
0
        public virtual WsMessage keepAlive(WsMessage request)
        {
            // Build request object
            keepAliveDataContractSerializer reqDcs;

            reqDcs = new keepAliveDataContractSerializer("keepAlive", "http://tempuri.org/");
            keepAlive req;

            req = ((keepAlive)(reqDcs.ReadObject(request.Reader)));
            request.Reader.Dispose();
            request.Reader = null;

            // Create response object
            // Call service operation to process request and return response.
            keepAliveResponse resp;

            resp = m_service.keepAlive(req);

            // Create response header
            WsWsaHeader respHeader = new WsWsaHeader("http://tempuri.org/IService1/keepAliveResponse", request.Header.MessageID, m_version.AnonymousUri, null, null, null);
            WsMessage   response   = new WsMessage(respHeader, resp, WsPrefix.Wsdp);

            // Create response serializer
            keepAliveResponseDataContractSerializer respDcs;

            respDcs             = new keepAliveResponseDataContractSerializer("keepAliveResponse", "http://tempuri.org/");
            response.Serializer = respDcs;
            return(response);
        }
Exemplo n.º 2
0
        public virtual keepAliveResponse keepAlive(keepAlive req)
        {
            // Create request header
            String action;

            action = "http://tempuri.org/IService1/keepAlive";
            WsWsaHeader header;

            header = new WsWsaHeader(action, null, EndpointAddress, m_version.AnonymousUri, null, null);
            WsMessage request = new WsMessage(header, req, WsPrefix.None);

            // Create request serializer
            keepAliveDataContractSerializer reqDcs;

            reqDcs             = new keepAliveDataContractSerializer("keepAlive", "http://tempuri.org/");
            request.Serializer = reqDcs;
            request.Method     = "keepAlive";


            // Send service request
            m_requestChannel.Open();
            WsMessage response = m_requestChannel.Request(request);

            m_requestChannel.Close();

            // Process response
            keepAliveResponseDataContractSerializer respDcs;

            respDcs = new keepAliveResponseDataContractSerializer("keepAliveResponse", "http://tempuri.org/");
            keepAliveResponse resp;

            resp = ((keepAliveResponse)(respDcs.ReadObject(response.Reader)));
            response.Reader.Dispose();
            response.Reader = null;
            return(resp);
        }