Hi Guys
Before you answer read! and please dont give me a result you quickly Googled, i need someone who actualy dealt with this and can give me an actual answer.
I have a delphi program that calls my .net web service, problem is the parameters always comes through as a null value , all i need is to pasre a simple string through so I built a bit of code into my Global.asax code.
protected void Application_BeginRequest(object sender, EventArgs e)
{
string name = HttpContext.Current.Request.Url.ToString();
if (name.Contains("PMA/PMAService.asmx"))
{
byte[] inputStream = new byte[HttpContext.Current.Request.ContentLength];
HttpContext.Current.Request.InputStream.Read(inputStream, 0, inputStream.Length);
HttpContext.Current.Request.InputStream.Position = 0;
string requestString =UTF8Encoding.UTF8.GetString(inputStream);
}
}
This captures the incoming soap requests
From delphi the request is as follow:
="1.0"
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<saySomething xmlns="http://tempuri.org/"><xsd:data>hello</xsd:data></saySomething>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
I need to change this into Following (this is what comes from a .net client program):
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<saySomething xmlns="http://tempuri.org/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><data>hello</data></saySomething>
</s:Body>
</s:Envelope>
I know how to manipulate the string but how do i manipulate the request input stream before it hits the web service and runs the command and returns the result ?
Thank you in advance