Exemplo n.º 1
0
 public void decodeServiceResponse(Stream readerResponse)
 {
     XmlSerializer serializer = new XmlSerializer(typeof(serviceresponse));
     // Call the Deserialize method to restore the object's state.
     using (readerResponse)
     {
         myServiceResponse = (serviceresponse)serializer.Deserialize(readerResponse);
     }
 }
        public IActionResult IsPasswordStrong(string password)
        {
            apiResponse response = new apiResponse();

            serviceresponse isPasswordStrong = banking.IsPasswordStrong(password);

            response.responseCode            = "00";
            response.responseFriendlyMessage = isPasswordStrong.result;
            response.result   = isPasswordStrong.result;
            response.hasError = isPasswordStrong.check;
            return(Ok(response));
            //ge
        }
Exemplo n.º 3
0
        public serviceresponse sendRequestAndGetResponse(string uri, string xmlPayload)
        {
            this.xmlPayload = xmlPayload;
            this.myServiceResponse = null;

            // Create a new HttpWebRequest object.
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);

            request.ContentType = "application/xml";
            request.Accept = "application/xml";
            // Set the Method property to 'POST' to post data to the URI.
            request.Method = "POST";

            // start the asynchronous operation
            request.BeginGetRequestStream(new AsyncCallback(GetRequestStreamCallback), request);

            // Keep the main thread from continuing while the asynchronous
            // operation completes. A real world application
            // could do something useful such as updating its user interface.
            allDone.WaitOne();

            return myServiceResponse;
        }