Hi,
I have to send a message to the soap envelope and am struggling to get it to work. I have a rough idea and can do it in code(see below) but wanted to carry out in Biztalk.
Sample c# code run on the Page_Load event.
<% @ Page Language=”C#” %>
<% @Import Namespace=”System” %>
<% @Import Namespace=”System.Xml” %>
<% @Import Namespace=”System.Text” %>
<% @Import Namespace=”System.IO” %>
<% @Import Namespace=”System.Net” %>
<script Language=”C#” runat=”server”>
protected void Page_Load(object sender, EventArgs e)
{
string xmlfile;
xmlfile=Request.Params[“xmlfile”];
if (xmlfile==null)
//xmlfile=”uddi.xml”;
xmlfile=”a.xml”;
HttpSOAPRequest(xmlfile,null);
}
void HttpSOAPRequest(String xmlfile, string proxy)
{
XmlDocument doc = new XmlDocument();
doc.Load(@”C:\Inetpub\wwwroot\ASP.NET\” +xmlfile);
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(“https://some.url.com/RentalManagement/companyname”);
if (proxy != null) req.Proxy = new WebProxy(proxy,true);
req.Headers.Add(“SOAPAction”,”\”\””);
req.ContentType = “text/xml;charset=\”utf-8\””;
req.Accept = “text/xml”;
req.Method = “POST”;
Stream stm = req.GetRequestStream();
doc.Save(stm);
stm.Close();
WebResponse resp = req.GetResponse();
stm = resp.GetResponseStream();
StreamReader r = new StreamReader(stm);
// process SOAP return doc here. For now, we’ll just send the XML out to the browser …
Response.Write(r.ReadToEnd());
}
</script>
My send shape sends to a port which has a message type of BTS.soap_envelope_1__1.Envelope. Is this correct? Or should it be the soap body?
The error I get is
This Assembler cannot retrieve a document specification using this type: “http://some.url.com/RentalManagement/companyname#RentalReservationRequestRequest”.
The schema, RentalReservationRequestRequest, is in the Biztalk project and deployed to the server.
Please help.
Paul