Hi
I have an application written in PB.net that sends an xml request to UPS web service and gets a response back.
It is no longer supported in PB2019R# and i need help replacing the code .
If you can help me it will be greatly appreciated.
Thanks
Malek
Function talktoups(string asurl, string asrequest , REF string asresponse)
// this function uses the web post to communicate with UPS web services via XML documents
// the process issues a request by sending an XML document to a URL and receives back an XML document.
#if defined PBDOTNET then
try
GMaPSCommon.gasecurity.tls12()
@System.IO.StringWriter sWriter
@System.Net.HttpWebRequest myHttpWebRequest
@System.Net.WebRequest myWebRequest
@System.Net.WebResponse myWebResponse
@System.IO.Stream stream
@System.IO.StreamReader myReader
@System.IO.StreamWriter myWriter
myWebRequest = @System.Net.WebRequest.Create(asURL)
myHttpWebRequest = myWebRequest
myHttpWebRequest.Method = "POST"
myHttpWebRequest.ContentType = "application/x-www-form-urlencoded"
myHttpWebRequest.ContentLength = len(asRequest)
//send request using stream writer
stream = myHttpWebRequest.GetRequestStream()
myWriter = Create @System.IO.StreamWriter(stream)
myWriter.Write(asRequest)
myWriter.Close()
//receive response using stream reader
myWebResponse = myHttpWebRequest.GetResponse()
stream = myWebResponse.GetResponseStream()
myReader = Create @System.IO.StreamReader(stream)
asResponse = myReader.ReadToEnd()
catch (@System.Exception e)
messagebox("Talk To UPS Error", e.Message)
end try
#end if
return 0