Hi,
Try this please:
static void Main( string[] args )
{
System.Net.HttpWebRequest request =
(System.Net.HttpWebRequest)System.Net.WebRequest.C reate(
"http://url_of_your_web_service" );
string strSOAPRequestBody = "<SOAP-ENV:Header>" +
"<wsse:Security
xmlns:wsse=\"http://schemas.xmlsoap.org/ws/2002/07/secext\">" +
"<wsse:UsernameToken>" +
"<wsse:Username>AUSER</wsse:Username>" +
"<wsse:Password
Type=\"wsse:PasswordText\">APassword</wsse:Password>" +
"</wsse:UsernameToken>" +
"</wsse:Security>" +
"</SOAP-ENV:Header>" +
"<SOAP-ENV:Body>" +
"<ns1:Search_spcUser xmlns:ns1=\"http://myapp.com/asi\">" +
"<UserId>John</UserId>" +
"</ns1:Search_spcUser>" +
"</SOAP-ENV:Body>" +
"</SOAP-ENV:Envelope>";
request.Method = "POST";
request.ContentType = "application/soap+xml; charset=utf-8";
request.ContentLength = strSOAPRequestBody.Length;
System.IO.StreamWriter streamWriter =
new System.IO.StreamWriter( request.GetRequestStream() );
streamWriter.Write( strSOAPRequestBody );
streamWriter.Close();
System.IO.StreamReader streamReader =
new System.IO.StreamReader(
request.GetResponse().GetResponseStream() );
string strResponse = "";
while( !streamReader.EndOfStream )
strResponse += streamReader.ReadLine();
reader.Close();
}
At the end, strResponse will contain the XML of whatever the service has
returned to you. Of course you will need to parse that XML into a
XmlDocument and use that document to read whatever data is there.
"John" <19*****@gmail.comwrote in message
news:11**********************@k78g2000cwa.googlegr oups.com...
Unfortunately I have no control over the "Non-.NET webservice" so I
have to figure out a way to manually insert into the SOAP Header. I've
never Manually created a SOAP request and passed it to a Web
Service. I'm hoping it is *fairly* straightforward.