예제 #1
0
        public virtual WsMessage GetMeasurements(WsMessage request)
        {
            // Build request object
            GetMeasurementsDataContractSerializer reqDcs;

            reqDcs = new GetMeasurementsDataContractSerializer("GetMeasurements", "http://tempuri.org/");
            GetMeasurements req;

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

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

            resp = m_service.GetMeasurements(req);

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

            // Create response serializer
            GetMeasurementsResponseDataContractSerializer respDcs;

            respDcs             = new GetMeasurementsResponseDataContractSerializer("GetMeasurementsResponse", "http://tempuri.org/");
            response.Serializer = respDcs;
            return(response);
        }
예제 #2
0
        public virtual GetMeasurementsResponse GetMeasurements(GetMeasurements req)
        {
            // Create request header
            String action;

            action = "http://tempuri.org/ISmartService/GetMeasurements";
            WsWsaHeader header;

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

            // Create request serializer
            GetMeasurementsDataContractSerializer reqDcs;

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


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

            m_requestChannel.Close();

            // Process response
            GetMeasurementsResponseDataContractSerializer respDcs;

            respDcs = new GetMeasurementsResponseDataContractSerializer("GetMeasurementsResponse", "http://tempuri.org/");
            GetMeasurementsResponse resp;

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