public virtual WsMessage GetData(WsMessage request)
        {
            // Build request object
            GetDataDataContractSerializer reqDcs;

            reqDcs           = new GetDataDataContractSerializer("GetData", "http://tempuri.org/");
            reqDcs.BodyParts = request.BodyParts;
            GetData req;

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

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

            resp = m_service.GetData(req);

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

            // Create response serializer
            GetDataResponseDataContractSerializer respDcs;

            respDcs             = new GetDataResponseDataContractSerializer("GetDataResponse", "http://tempuri.org/");
            response.Serializer = respDcs;

            // Indicate that message is Mtom encoded
            response.BodyParts = new WsMtomBodyParts();
            return(response);
        }
예제 #2
0
        public virtual WsMessage GetData(WsMessage request)
        {
            // Build request object
            GetDataDataContractSerializer reqDcs;
            reqDcs = new GetDataDataContractSerializer("GetData", "http://tempuri.org/");
            reqDcs.BodyParts = request.BodyParts;
            GetData req;
            req = ((GetData)(reqDcs.ReadObject(request.Reader)));

            // Create response object
            // Call service operation to process request and return response.
            GetDataResponse resp;
            resp = m_service.GetData(req);

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

            // Create response serializer
            GetDataResponseDataContractSerializer respDcs;
            respDcs = new GetDataResponseDataContractSerializer("GetDataResponse", "http://tempuri.org/");
            response.Serializer = respDcs;

            // Indicate that message is Mtom encoded
            response.BodyParts = new WsMtomBodyParts();
            return response;
        }
        public virtual GetDataResponse GetData(GetData req)
        {

            // Create request header
            String action;
            action = "http://tempuri.org/IDataAccessService/GetData";
            WsWsaHeader header;
            header = new WsWsaHeader(action, null, EndpointAddress, m_version.AnonymousUri, null, null);
            WsMessage request = new WsMessage(header, req, WsPrefix.None);

            // Create request serializer
            GetDataDataContractSerializer reqDcs;
            reqDcs = new GetDataDataContractSerializer("GetData", "http://tempuri.org/");
            request.Serializer = reqDcs;
            request.Method = "GetData";


            // Indicate that this message will use Mtom encoding
            request.BodyParts = new WsMtomBodyParts();

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

            // Process response
            GetDataResponseDataContractSerializer respDcs;
            respDcs = new GetDataResponseDataContractSerializer("GetDataResponse", "http://tempuri.org/");
            respDcs.BodyParts = response.BodyParts;
            GetDataResponse resp;
            resp = ((GetDataResponse)(respDcs.ReadObject(response.Reader)));
            return resp;
        }
        public virtual GetDataResponse GetData(GetData req)
        {
            // Create request header
            String action;

            action = "http://tempuri.org/IDataAccessService/GetData";
            WsWsaHeader header;

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

            // Create request serializer
            GetDataDataContractSerializer reqDcs;

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


            // Indicate that this message will use Mtom encoding
            request.BodyParts = new WsMtomBodyParts();

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

            m_requestChannel.Close();

            // Process response
            GetDataResponseDataContractSerializer respDcs;

            respDcs           = new GetDataResponseDataContractSerializer("GetDataResponse", "http://tempuri.org/");
            respDcs.BodyParts = response.BodyParts;
            GetDataResponse resp;

            resp = ((GetDataResponse)(respDcs.ReadObject(response.Reader)));
            response.Reader.Dispose();
            response.Reader = null;

            return(resp);
        }