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);
        }
Example #2
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 TypeCheckResponse TypeCheck(TypeCheckRequest req)
 {
     TypeCheckResponse resp = new TypeCheckResponse();
     resp.BoolCheck = req.BoolCheck;
     resp.DecimalCheck = req.DecimalCheck;
     resp.FloatCheck = req.FloatCheck;
     resp.UriListCheck = new String[req.UriListCheck.Length];
     for (int i = 0; i < req.UriListCheck.Length; ++i)
     {
         resp.UriListCheck[i] = req.UriListCheck[i];   
     }
     return resp;
 }
        public TypeCheckResponse TypeCheck(TypeCheckRequest req)
        {
            TypeCheckResponse resp = new TypeCheckResponse();

            resp.BoolCheck    = req.BoolCheck;
            resp.DecimalCheck = req.DecimalCheck;
            resp.FloatCheck   = req.FloatCheck;
            resp.UriListCheck = new String[req.UriListCheck.Length];
            for (int i = 0; i < req.UriListCheck.Length; ++i)
            {
                resp.UriListCheck[i] = req.UriListCheck[i];
            }
            return(resp);
        }
        public override object ReadObject(XmlReader reader)
        {
            TypeCheckRequest TypeCheckRequestField = null;

            if (IsParentStartElement(reader, false, true))
            {
                TypeCheckRequestField         = new TypeCheckRequest();
                TypeCheckRequestField.AnyAttr = ReadAnyAttribute(reader);
                reader.Read();
                if (IsChildStartElement(reader, "BoolCheck", false, true))
                {
                    reader.Read();
                    TypeCheckRequestField.BoolCheck = XmlConvert.ToBoolean(reader.ReadString());
                    reader.ReadEndElement();
                }
                if (IsChildStartElement(reader, "DecimalCheck", false, true))
                {
                    reader.Read();
                    TypeCheckRequestField.DecimalCheck = reader.ReadString();
                    reader.ReadEndElement();
                }
                if (IsChildStartElement(reader, "FloatCheck", false, true))
                {
                    reader.Read();
                    TypeCheckRequestField.FloatCheck = XmlConvert.ToSingle(reader.ReadString());
                    reader.ReadEndElement();
                }
                if (IsChildStartElement(reader, "UriListCheck", false, true))
                {
                    reader.Read();
                    string[] tempList = reader.ReadString().Split();
                    TypeCheckRequestField.UriListCheck = new string[tempList.Length];
                    int i;
                    for (i = 0; (i < tempList.Length); i = (i + 1))
                    {
                        TypeCheckRequestField.UriListCheck[i] = tempList[i];
                    }
                    reader.ReadEndElement();
                }
                TypeCheckRequestField.Any = ReadAnyElement(reader, false);
                reader.ReadEndElement();
            }
            return(TypeCheckRequestField);
        }
        public override void WriteObject(XmlWriter writer, object graph)
        {
            TypeCheckRequest TypeCheckRequestField = ((TypeCheckRequest)(graph));

            if (WriteParentElement(writer, true, true, graph))
            {
                WriteAnyAttribute(writer, TypeCheckRequestField.AnyAttr);
                if (WriteChildElement(writer, "BoolCheck", false, true, TypeCheckRequestField.BoolCheck))
                {
                    writer.WriteString(XmlConvert.ToString(TypeCheckRequestField.BoolCheck));
                    writer.WriteEndElement();
                }
                if (WriteChildElement(writer, "DecimalCheck", false, true, TypeCheckRequestField.DecimalCheck))
                {
                    writer.WriteString(TypeCheckRequestField.DecimalCheck);
                    writer.WriteEndElement();
                }
                if (WriteChildElement(writer, "FloatCheck", false, true, TypeCheckRequestField.FloatCheck))
                {
                    writer.WriteString(XmlConvert.ToString(TypeCheckRequestField.FloatCheck));
                    writer.WriteEndElement();
                }
                if (WriteChildElement(writer, "UriListCheck", false, true, TypeCheckRequestField.UriListCheck))
                {
                    string tempList = "";
                    int    i;
                    for (i = 0; (i < TypeCheckRequestField.UriListCheck.Length); i = (i + 1))
                    {
                        tempList = (tempList + TypeCheckRequestField.UriListCheck[i]);
                        if ((i
                             < (TypeCheckRequestField.UriListCheck.Length - 1)))
                        {
                            tempList = (tempList + " ");
                        }
                    }
                    writer.WriteString(tempList);
                    writer.WriteEndElement();
                }
                WriteAnyElement(writer, TypeCheckRequestField.Any, false);
                writer.WriteEndElement();
            }
            return;
        }
        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;
        }
 TypeCheckResponse ISimpleService.TypeCheck(TypeCheckRequest req)
 {
     throw new NotImplementedException();
 }
 public override object ReadObject(XmlReader reader)
 {
     TypeCheckRequest TypeCheckRequestField = null;
     if (IsParentStartElement(reader, false, true))
     {
         TypeCheckRequestField = new TypeCheckRequest();
         TypeCheckRequestField.AnyAttr = ReadAnyAttribute(reader);
         reader.Read();
         if (IsChildStartElement(reader, "BoolCheck", false, true))
         {
             reader.Read();
             TypeCheckRequestField.BoolCheck = XmlConvert.ToBoolean(reader.ReadString());
             reader.ReadEndElement();
         }
         if (IsChildStartElement(reader, "DecimalCheck", false, true))
         {
             reader.Read();
             TypeCheckRequestField.DecimalCheck = reader.ReadString();
             reader.ReadEndElement();
         }
         if (IsChildStartElement(reader, "FloatCheck", false, true))
         {
             reader.Read();
             TypeCheckRequestField.FloatCheck = XmlConvert.ToSingle(reader.ReadString());
             reader.ReadEndElement();
         }
         if (IsChildStartElement(reader, "UriListCheck", false, true))
         {
             reader.Read();
             string[] tempList = reader.ReadString().Split();
             TypeCheckRequestField.UriListCheck = new string[tempList.Length];
             int i;
             for (i = 0; (i < tempList.Length); i = (i + 1))
             {
                 TypeCheckRequestField.UriListCheck[i] = tempList[i];
             }
             reader.ReadEndElement();
         }
         TypeCheckRequestField.Any = ReadAnyElement(reader, false);
         reader.ReadEndElement();
     }
     return TypeCheckRequestField;
 }
        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;
        }