Пример #1
0
        public virtual TypeCheckResponse TypeCheckRequest(TypeCheckRequest req)
        {
            // Create request header
            String action;

            action = "http://schemas.example.org/SimpleService/TypeCheckRequest";
            WsWsaHeader header;

            header = new WsWsaHeader(action, null, ServiceEndpoint, null, EndpointAddress, null);

            // Create request serializer
            TypeCheckRequestDataContractSerializer reqDcs;

            reqDcs = new TypeCheckRequestDataContractSerializer("TypeCheckRequest", "http://schemas.example.org/SimpleService");

            // Build soap request message
            byte[] soapBuffer = SoapMessageBuilder.BuildSoapMessage(header, reqDcs, req);

            // Send service request
            DpwsHttpClient httpClient;

            httpClient = new DpwsHttpClient();
            DpwsSoapResponse response;

            response = httpClient.SendRequest(soapBuffer, ServiceEndpoint, false, false);

            // Process response
            TypeCheckResponseDataContractSerializer respDcs;

            respDcs = new TypeCheckResponseDataContractSerializer("TypeCheckResponse", "http://schemas.example.org/SimpleService");
            TypeCheckResponse resp;

            resp = ((TypeCheckResponse)(respDcs.ReadObject(response.Reader)));
            return(resp);
        }
        public virtual TypeCheckResponse TypeCheck(TypeCheckRequest req)
        {
            // Create request header
            String action;

            action = "http://schemas.example.org/SimpleService/TypeCheck";
            WsWsaHeader header;

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

            // Create request serializer
            TypeCheckRequestDataContractSerializer reqDcs;

            reqDcs             = new TypeCheckRequestDataContractSerializer("TypeCheckRequest", "http://schemas.example.org/SimpleService");
            request.Serializer = reqDcs;
            request.Method     = "TypeCheck";


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

            m_requestChannel.Close();

            // Process response
            TypeCheckResponseDataContractSerializer respDcs;

            respDcs = new TypeCheckResponseDataContractSerializer("TypeCheckResponse", "http://schemas.example.org/SimpleService");
            TypeCheckResponse resp;

            resp = ((TypeCheckResponse)(respDcs.ReadObject(response.Reader)));
            return(resp);
        }
        public virtual WsMessage TypeCheck(WsMessage request)
        {
            // Build request object
            TypeCheckRequestDataContractSerializer reqDcs;

            reqDcs = new TypeCheckRequestDataContractSerializer("TypeCheckRequest", "http://schemas.example.org/SimpleService");
            TypeCheckRequest req;

            req = ((TypeCheckRequest)(reqDcs.ReadObject(request.Reader)));

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

            resp = m_service.TypeCheck(req);

            // Create response header
            WsWsaHeader respHeader = new WsWsaHeader("http://schemas.example.org/SimpleService/TypeCheckResponse", request.Header.MessageID, m_version.AnonymousUri, null, null, null);
            WsMessage   response   = new WsMessage(respHeader, resp, WsPrefix.Wsdp);

            // Create response serializer
            TypeCheckResponseDataContractSerializer respDcs;

            respDcs             = new TypeCheckResponseDataContractSerializer("TypeCheckResponse", "http://schemas.example.org/SimpleService");
            response.Serializer = respDcs;
            return(response);
        }
Пример #4
0
        public virtual Byte[] TypeCheckRequest(WsWsaHeader header, XmlReader reader)
        {
            // Build request object
            TypeCheckRequestDataContractSerializer reqDcs;

            reqDcs = new TypeCheckRequestDataContractSerializer("TypeCheckRequest", "http://schemas.example.org/SimpleService");
            TypeCheckRequest req;

            req = ((TypeCheckRequest)(reqDcs.ReadObject(reader)));

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

            resp = m_service.TypeCheck(req);

            // Create response header
            WsWsaHeader respHeader = new WsWsaHeader("http://schemas.example.org/SimpleService/TypeCheckResponse", header.MessageID, WsWellKnownUri.WsaAnonymousUri, null, null, null);

            // Create response serializer
            TypeCheckResponseDataContractSerializer respDcs;

            respDcs = new TypeCheckResponseDataContractSerializer("TypeCheckResponse", "http://schemas.example.org/SimpleService");

            // Build response message and return
            return(SoapMessageBuilder.BuildSoapMessage(respHeader, respDcs, resp));
        }
        public virtual TypeCheckResponse TypeCheck(TypeCheckRequest req)
        {

            // Create request header
            String action;
            action = "http://schemas.example.org/SimpleService/TypeCheck";
            WsWsaHeader header;
            header = new WsWsaHeader(action, null, EndpointAddress, m_version.AnonymousUri, null, null);
            WsMessage request = new WsMessage(header, req, WsPrefix.None);

            // Create request serializer
            TypeCheckRequestDataContractSerializer reqDcs;
            reqDcs = new TypeCheckRequestDataContractSerializer("TypeCheckRequest", "http://schemas.example.org/SimpleService");
            request.Serializer = reqDcs;
            request.Method = "TypeCheck";


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

            // Process response
            TypeCheckResponseDataContractSerializer respDcs;
            respDcs = new TypeCheckResponseDataContractSerializer("TypeCheckResponse", "http://schemas.example.org/SimpleService");
            TypeCheckResponse resp;
            resp = ((TypeCheckResponse)(respDcs.ReadObject(response.Reader)));
            return resp;
        }
        public virtual Byte[] TypeCheckRequest(WsWsaHeader header, XmlReader reader)
        {
            // Build request object
            TypeCheckRequestDataContractSerializer reqDcs;
            reqDcs = new TypeCheckRequestDataContractSerializer("TypeCheckRequest", "http://schemas.example.org/SimpleService");
            TypeCheckRequest req;
            req = ((TypeCheckRequest)(reqDcs.ReadObject(reader)));

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

            // Create response header
            WsWsaHeader respHeader = new WsWsaHeader("http://schemas.example.org/SimpleService/TypeCheckResponse", header.MessageID, WsWellKnownUri.WsaAnonymousUri, null, null, null);

            // Create response serializer
            TypeCheckResponseDataContractSerializer respDcs;
            respDcs = new TypeCheckResponseDataContractSerializer("TypeCheckResponse", "http://schemas.example.org/SimpleService");

            // Build response message and return
            return SoapMessageBuilder.BuildSoapMessage(respHeader, respDcs, resp);
        }
        public virtual WsMessage TypeCheck(WsMessage request)
        {
            // Build request object
            TypeCheckRequestDataContractSerializer reqDcs;
            reqDcs = new TypeCheckRequestDataContractSerializer("TypeCheckRequest", "http://schemas.example.org/SimpleService");
            TypeCheckRequest req;
            req = ((TypeCheckRequest)(reqDcs.ReadObject(request.Reader)));

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

            // Create response header
            WsWsaHeader respHeader = new WsWsaHeader("http://schemas.example.org/SimpleService/TypeCheckResponse", request.Header.MessageID, m_version.AnonymousUri, null, null, null);
            WsMessage response = new WsMessage(respHeader, resp, WsPrefix.Wsdp);

            // Create response serializer
            TypeCheckResponseDataContractSerializer respDcs;
            respDcs = new TypeCheckResponseDataContractSerializer("TypeCheckResponse", "http://schemas.example.org/SimpleService");
            response.Serializer = respDcs;
            return response;
        }
        public virtual TypeCheckResponse TypeCheckRequest(TypeCheckRequest req)
        {
            // Create request header
            String action;
            action = "http://schemas.example.org/SimpleService/TypeCheckRequest";
            WsWsaHeader header;
            header = new WsWsaHeader(action, null, ServiceEndpoint, null, EndpointAddress, null);

            // Create request serializer
            TypeCheckRequestDataContractSerializer reqDcs;
            reqDcs = new TypeCheckRequestDataContractSerializer("TypeCheckRequest", "http://schemas.example.org/SimpleService");

            // Build soap request message
            byte[] soapBuffer = SoapMessageBuilder.BuildSoapMessage(header, reqDcs, req);

            // Send service request
            DpwsHttpClient httpClient;
            httpClient = new DpwsHttpClient();
            DpwsSoapResponse response;
            response = httpClient.SendRequest(soapBuffer, ServiceEndpoint, false, false);

            // Process response
            TypeCheckResponseDataContractSerializer respDcs;
            respDcs = new TypeCheckResponseDataContractSerializer("TypeCheckResponse", "http://schemas.example.org/SimpleService");
            TypeCheckResponse resp;
            resp = ((TypeCheckResponse)(respDcs.ReadObject(response.Reader)));
            return resp;
        }