Im trying to send some xml inside a soap request to a webservice using the HttpWebRequest class. I know this isnt the best way, but my hands are tied by company policy so i have to do it this way. My webmethod has an input parameter "SourceXML" so my soap request has this node<SourceXML></SourceXML>I need to insert the xml in this node but whenver I insert it and try to send it to my web method I get an error "400 bad request"Is this even possible ? I need to insert the xml as a string literal and read it in the web methodStringBuilder sb = new StringBuilder(_soapEnv); -- soap enevlope template containing the SourceXML node
sb.Insert(sb.ToString().IndexOf("</SourceXML>"), the xml I want to insert in the node);
sendmessage(url, webmethod, sb.ToString()) -- send the message to the webserviceIf I put plain text in the string builderegsb.Insert(sb.ToString().IndexOf("</SourceXML>"), "this is a test");everything works ok, but as soon as i put some xml in it fails. Am I going about this in the right way ?basically my webmethod will have 2 input parameters, some xml and an object, but I just cant get it to work. Can anyone help ?
View Complete Post