Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / March 2007

Tip: Looking for answers? Try searching our database.

WebService over FTP

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter Morris - 27 Mar 2007 10:00 GMT
Hi all

I would like my Pocket PC application (.NET Compact Framwork V2) to talk to
a webservice, but the only port open on the server is 21 where an FTP server
is sitting.

I was wondering if it is possible to stream WS requests to a MemoryStream
which I can then ZIP and put onto the FTP, and then maybe have a service on
the server which looks for these files and calls the webservice on the local
machine eventually streaming the response back into a MemoryStream which I
zip and make available on the FTP server?

Basicaly I need to know if I can use webservices over FTP on .NET 2 compact
framework.

Thanks

Pete
Peter Morris - 27 Mar 2007 17:53 GMT
Okay, I have managed to get the web service client to stream its request to
an XML file which I then FTP onto the server.  What I need to do next is to
HTTP Post that XML to the real web service....

WebService definition
=====================
        [WebMethod]
        public string StartSession(string deviceUniqueID, string
applicationVersion)
        {
            return "SessionID";
        }

CLIENT
======
        private string QueryXml = "<?xml version=\"1.0\"
encoding=\"utf-8\"?><soap:Envelope
xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><soap:Body><StartSession
xmlns=\"http://tempuri.org/\"><deviceUniqueID>123</deviceUniqueID><applicationVersion>12
3</applicationVersion></StartSession></soap:Body></soap:Envelope
>";

        private void Form1_Load(object sender, EventArgs e)
        {
            HttpWebRequest request = (HttpWebRequest)
WebRequest.Create("http://localhost/HandheldVendorWebService/SyncService.asmx");
            request.Method = "POST";
            request.ContentType = "text/xml";
            request.ContentLength = QueryXml.Length;
            byte[] postData = System.Text.ASCIIEncoding.ASCII.GetBytes(QueryXml);
            request.GetRequestStream().Write(postData, 0, postData.Length);
                        /*******************************/
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            Stream responseStream = response.GetResponseStream();
            StreamReader reader = new StreamReader(responseStream);
            textBox1.Text = reader.ReadToEnd();
        }The QueryXml string is exactly what is generated by the client to call
StartSession().  When I call request.GetResponse() I get "500 Internal
server error", but this works fine in the test page inside Internet
Explorer.Any ideas?ThanksPete

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.