Web service question
-
I didn't think that this question was appropriate for the ASP.NET forum but I will mention it in this question. I currently have an ASP.NET page that receives an XML stream which I write to disk.
StreamReader reader = new StreamReader(Request.InputStream); string xmlData = reader.ReadToEnd(); ... StreamWriter writer = new StreamWriter( "Somefile.xnl, false); writer.Write( xmlData ); writer.Flush(); writer.Close();
I would like to have this functionality using a Web service instead of an ASP page. It is possible to use a web service to receive posts in this fashion? Any pointers appreciated
-
I didn't think that this question was appropriate for the ASP.NET forum but I will mention it in this question. I currently have an ASP.NET page that receives an XML stream which I write to disk.
StreamReader reader = new StreamReader(Request.InputStream); string xmlData = reader.ReadToEnd(); ... StreamWriter writer = new StreamWriter( "Somefile.xnl, false); writer.Write( xmlData ); writer.Flush(); writer.Close();
I would like to have this functionality using a Web service instead of an ASP page. It is possible to use a web service to receive posts in this fashion? Any pointers appreciated
-
yes. send a stream to it and save it I'm not an expert yet, but I play one at work. Yeah and here too.
Would you care to elaborate a little. I am very new to web services. My team lead is wanting me to do this without a IIS server even running. What do you mean by send a steam to it? Then how do you save it, how does the webservice get hold of the stream. Note: I have no control of how the stream is sent to me. I give them a url to post to and they send me an stream formated as xml. Thanks
-
Would you care to elaborate a little. I am very new to web services. My team lead is wanting me to do this without a IIS server even running. What do you mean by send a steam to it? Then how do you save it, how does the webservice get hold of the stream. Note: I have no control of how the stream is sent to me. I give them a url to post to and they send me an stream formated as xml. Thanks
Okay. define the web services as a memory stream like maybe public void SendMyData( MemoryStream ms ) { // Write the text to the file here } So the user will call your web service and send them stream to you. And you can what you want with it. Your PC will have the IIS on it so any PC that has IIS can hold the web service. Not having a web server to deploy is just crazy! But the programs will simply locate your WSDL file and they will see they need to send a Stream to it. You don't have to use a memory stream, it's just one I use a lot. Play with it. When you create the web service it creates the WSDL. So Create another app and click Add Web References and find the wsdl then call it. Its easy If you need help I will up for for another 3 hours Nick I'm not an expert yet, but I play one at work. Yeah and here too.
-
Okay. define the web services as a memory stream like maybe public void SendMyData( MemoryStream ms ) { // Write the text to the file here } So the user will call your web service and send them stream to you. And you can what you want with it. Your PC will have the IIS on it so any PC that has IIS can hold the web service. Not having a web server to deploy is just crazy! But the programs will simply locate your WSDL file and they will see they need to send a Stream to it. You don't have to use a memory stream, it's just one I use a lot. Play with it. When you create the web service it creates the WSDL. So Create another app and click Add Web References and find the wsdl then call it. Its easy If you need help I will up for for another 3 hours Nick I'm not an expert yet, but I play one at work. Yeah and here too.
I follow what you are saying. I realize that not having a web server to deploy it crazy, but I have been asked to look into this method. The problem that we are trying to get around it the limitation of IIS 5 running on XP, which is 10 conncurrent connections. Of course this could be solved by switching to 2003 server and IIS 6 but that is not the exercise. Given that explanation is there a way to do what my team lead wants, even if it's insane, I need to go back to him with some answers. Again in a nut shell here is what he wants. 1) create a web service independent of a IIS server. 2) have this web service receive the data sent my our client. It seems to this that this would require socket programming as I don't see how a web service could receive streams without a server. Thanks
-
I follow what you are saying. I realize that not having a web server to deploy it crazy, but I have been asked to look into this method. The problem that we are trying to get around it the limitation of IIS 5 running on XP, which is 10 conncurrent connections. Of course this could be solved by switching to 2003 server and IIS 6 but that is not the exercise. Given that explanation is there a way to do what my team lead wants, even if it's insane, I need to go back to him with some answers. Again in a nut shell here is what he wants. 1) create a web service independent of a IIS server. 2) have this web service receive the data sent my our client. It seems to this that this would require socket programming as I don't see how a web service could receive streams without a server. Thanks
well a web service is a (web) and is know way independent of IIS. You could host IIS on a win2k machine. It doesn't have to be a server. Now you can imitate the web service by doing remoting. and just open a port or listen on port 80 for data coming through. After all, a web service wraps remoting. Its a simple concept but you'll need to practice it. http://www.csharphelp.com/archives2/archive422.html[^] I would say set up a win2k machine that doesn't exhibit such behavior. If not, do remoting but it will be a learning curve. Its a shame when companies do this over a few dollars. Hes going to spend more in the long run. Make sure you do tons of exception handling. I'm not an expert yet, but I play one at work. Yeah and here too.
-
well a web service is a (web) and is know way independent of IIS. You could host IIS on a win2k machine. It doesn't have to be a server. Now you can imitate the web service by doing remoting. and just open a port or listen on port 80 for data coming through. After all, a web service wraps remoting. Its a simple concept but you'll need to practice it. http://www.csharphelp.com/archives2/archive422.html[^] I would say set up a win2k machine that doesn't exhibit such behavior. If not, do remoting but it will be a learning curve. Its a shame when companies do this over a few dollars. Hes going to spend more in the long run. Make sure you do tons of exception handling. I'm not an expert yet, but I play one at work. Yeah and here too.
Thanks for the information. I don't believe it's over a few bucks, I believe he has two motivations. 1. He is from a non-Microsoft background... and he doesn't want to use ISS any version on any machine. 2. He wants to find a way for the client to send info directly to our application with out a middle man or web server. I am with you. Why reinvent the wheel. I will look at the remoting to make our point to him. Cheers