rajparmar

Hi,

My aim is to submit message from Asp.Net app to BTS using HTTP Receive
adapter. For that following is the code I have written


protected void Button1_Click(object sender, EventArgs e){

string xmlTemplate = "<ImportListRequest><ImportList><MapFile>Map.xml</MapFile><DataFile>mydata.csv</DataFile><ImportList></ImportListRequest>";
string requestlocation = "http://localhost/HTTPReceive/BTSHTTPReceive.dll";
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.PreserveWhitespace = true;
xmlDocument.LoadXml(xmlTemplate);

try
{
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(requestlocation);
request.Method = "POST";
ASCIIEncoding encoding = new ASCIIEncoding();
byte[] requestData = encoding.GetBytes(xmlDocument.OuterXml);
request.ContentType="application/x-www-form-urlencoded";
request.ContentLength = xmlDocument.OuterXml.Length;
Stream requestStream = request.GetRequestStream();
requestStream.Write(requestData,0,requestData.Length);
requestStream.Flush();
requestStream.Close();

HttpWebResponse response = (HttpWebResponse) request.GetResponse();

StreamReader responseData = new StreamReader( response.GetResponseStream());

Response.Write(System.Web.HttpUtility.HtmlEncode(responseData.ReadToEnd());

}
catch (WebException wex)
{

//unable to complete web request;

}

}


1. I have created a vir directory for the same called as HttpReceive.
2. I copied BTSHTTPReceive.dll to Httpreceive in c:/tutorial/Lessons/ImportListSolution/HttpReceive
3. I created new app in BTS Admin Console and configured Receive
location with Http Adapter
virtual directory plus isapi extension : /HttpReceive/BTSHTTPReceive.dll
Public address : http://localhost/HttpReceive/Default.aspx

I get the following error from { EVENT VIEWER}


There was a failure executing the receive pipeline:
"Microsoft.BizTalk.DefaultPipelines.XMLReceive,
Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" Source: "XML disassembler" Receive
Port: "ReceivePort7" URI: "/HttpReceive/BTSHTTPReceive.dll" Reason:
Finding the document specification by message type "ImportListRequest" failed. Verify the schema deployed properly.


Please let me know what should I do

First correct answer will be rewarded with $100 XMas Gift card!!!


THX

RAJ




Re: BizTalk R2 General HTTP ADAPER : RECEIVE LOCATION error

rajparmar

I checked Schema in BT Explorer and is fine! Perfectly deployed.






Re: BizTalk R2 General HTTP ADAPER : RECEIVE LOCATION error

rajparmar

i did as alternate with web service; but answer is still appreciated for above.

THX






Re: BizTalk R2 General HTTP ADAPER : RECEIVE LOCATION error

Leonid Ganeline

Seems there something wrong with the Message type.
You use
"<ImportListRequest><ImportList><MapFile>Map.xml</MapFile><DataFile>mydata.csv</DataFile><ImportList></ImportListRequest>"
- no namespace!
Try:
"<ImportListRequest xmlns=\"\"><ImportList><MapFile>Map.xml</MapFile><DataFile>mydata.csv</DataFile><ImportList></ImportListRequest>"
But, please, give your schema a REAL target namespace which works as a global type. BizTalk is all about those Message types (target namespace + root_name). And you never know where it would not work without good Message types.





Re: BizTalk R2 General HTTP ADAPER : RECEIVE LOCATION error

rajparmar

Sir, Thx for help; YES it was namespace problem;

I had applied namespace correctly and used FILE adapter to test the xsd (for both Request and response schemas);

Thse catch was - I needed to use validate Instance schema by applying test xml filenames in the schema property (for both req and resp)

and it would show errrs in the schema in the output window; so i then be able to fix the schema(s);

once all was ok in file adpatyer I then proceeded to apply them in the Message assignment (inside transform) and also the xml tags.

THX

RAJ