SOAP C# Tutorial/Example
-
Hello All, It's about 4:25 EST and I got in around 7:30am EST. I have scoured the Web for a SIMPLE tutorial or example to send and receive(process) SOAP messages in C#. At this moment, I have not found any full descriptive examples/tutorials to satisfy my goal. My goal is simple and not in need of anything fancy. I have a web service that requires a SOAP message to be passed to it and I require a response. The closet I have come is to recreate an app that get's the time off of EBay's server which was a paramount step. But when I try the same for my WebService, I receive an error "Malformed SOAP request, SOAP-ENV:Envelope element not found in root". My sniffer, did show that SOAP-ENV was not included in the message, indicating to me that I have to find a way to edit the message. So, I am now forced to you, my last hope to assist me with accessing my goal. What I am looking for is a tutorial or code example (mostly complete) that would show me how to create a soap message (manually would be better in this case) send it and read the response. Simple (to you) but a monster to me. Any and I mean any help will be greatly appreciated.
-
Hello All, It's about 4:25 EST and I got in around 7:30am EST. I have scoured the Web for a SIMPLE tutorial or example to send and receive(process) SOAP messages in C#. At this moment, I have not found any full descriptive examples/tutorials to satisfy my goal. My goal is simple and not in need of anything fancy. I have a web service that requires a SOAP message to be passed to it and I require a response. The closet I have come is to recreate an app that get's the time off of EBay's server which was a paramount step. But when I try the same for my WebService, I receive an error "Malformed SOAP request, SOAP-ENV:Envelope element not found in root". My sniffer, did show that SOAP-ENV was not included in the message, indicating to me that I have to find a way to edit the message. So, I am now forced to you, my last hope to assist me with accessing my goal. What I am looking for is a tutorial or code example (mostly complete) that would show me how to create a soap message (manually would be better in this case) send it and read the response. Simple (to you) but a monster to me. Any and I mean any help will be greatly appreciated.
Hi, how did you created the client? Could you post the code? I guess the problem is the namespace. SOAP-ENV is the prefix for the soap namespace in your message. Does the message contain a "xmlns:SOAP-ENV=..." in the first element (which should have the local name 'envelope'). Or better, post the request message from your sniffer. Regards Sebastian
It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.
-
Hi, how did you created the client? Could you post the code? I guess the problem is the namespace. SOAP-ENV is the prefix for the soap namespace in your message. Does the message contain a "xmlns:SOAP-ENV=..." in the first element (which should have the local name 'envelope'). Or better, post the request message from your sniffer. Regards Sebastian
It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.
Thanks Sebastian for the time: Below is a snippet of the code that creates and calls the service (simply). Below the code is the sniffer section that shows that there is no SOAP-ENV namespace. So I guess my guestion is, how can I create a user specified SOAP message. O int rprocess; int rErrors; int sampAdded; int sampMod; int sampDeleted; int aliAdded; int aliModified; int aliDeleted; int[] recSent = {'1'}; string[] reqNum = {"C0772014121"}; string[] sampType = {"BLOOD"}; string[] sampID = {"07720141210"}; DateTime[] inputDate = {Convert.ToDateTime("2009-10-15")}; DateTime[] inputTime = {Convert.ToDateTime("17:12")}; int[] aliID = {100050}; WebReference.Freezerworks service = new WebReference.Freezerworks(); service.Url = @"http://172.32.2.102:8081/Freezerworks/Update/"; try { service.TestUpdate("ffowler",