Receive an XML sent to a webform by webserviceHello to everybody!
I'm going to use a web service for sending SMS to customers cells.
My provider (Vodafone-Redbox) sent me a WDSL file to use their services. I added a reference in my web application using that provided file, and I invoked the available functions successfully. No problems here.
The trouble appears when trying to use the "acknowledgment" feature, to confirm that an SMS has reached its destination. For this feature, Vodafone asked me an URL to send confirmation messages in XML format. Thinking that would be a GET or POST to the URL (an ASP.NET webform), I asked them for the method and parameter name, but their response was that no GET or POST is fired, just the system "sends" the XML to the URL. As far as I know, the only way to send something to a webform from another is with parameters via GET or POST, but I'm aware that my skills are very limited and it's possible I'm wrong here.
Trying to figure out how to "capture" the XML sent, I got the idea of reading everything that went into the page whenever this was called, using Request.Params in Page_Load function. With key-value pairs in Params collection, construct a string and save it in database.
protected void Page_Load(object sender, EventArgs e)
/* Connect to database */
NameValueCollection valoresentrada = Request.Params;
int numvalores = valoresentrada.Count;
StringBuilder sbmensaje = new StringBuilder();
if (numvalores > 0)
sbmensaje.Append("Page invoked with params.\n");
for (int i = 0; i < numvalores; i++)
sbmensaje.Append("Clave nº" + (i + 1).ToString() + ": " + valoresentrada[i]);
sbmensaje.Append(". Valor: " + valoresentrada.Get(i));
sbmensaje.Append("Page invoked with no params.\n");
/* Save page access and string to database */
catch (Exception ex)
/* Save page access and error to database */
/* Disconnect database */
The code works when I open the URL with browser (obviously no XML is captured, but the access to the page is registered and the params collection is readed and stored in database). But when Vodafone supposedly sends the XML with the ACK, nothing is stored in the database, and this means that Page_Load function is not executed. I've contacted Vodafone, but the answer is only that they don't provide support to the client's application development.
At this point I don't know if the procedure is correct but should be implemented in other point of page lifecycle (perhaps Page_Init?), if the procedure is absolutely silly, if there's another way to receive "something" sent to a page... I'm totally lost and I'm unable to find articles in Internet. Whenever I look for "send XML to an ASP.NET page" I find explanations on how to create a web service, but not how to collect a response sent by a web service. If anyone has ever had to deal with something like this, or have a clue that could help me, I will be eternally grateful.