Send Btxml Response To Web Server 追蹤




I am generating a BTXML file through my MVC application, which is read by the Commander through "BTXML Script" command type and a corresponding label is printed. Once the label is printed (or not), I want to generate a BTXML response corresponding to my request and send it to my MVC application through "Send To Web Server" command type. I have 2 questions :-


1. How do I make sure that the BTXML Response generated corresponds to my BTXML request file? Can I set the response XML file name to match my request XML's file name?


2. When I run the commander task as mentioned above, the second command does not execute and errors out with the below message in the Commander log --- 

[Send to Web Server] Server returned: 404  [The remote server returned an error: (404) Not Found.].
[Send to Web Server] Command failed: Server returned error code 404.
I have attached the command tab and send to web server tab clippings that I am using. What am I missing here?
Thank you in advance!

2 意見

Shotaro Ito
評論操作 永久連結

Hi Nikita,


BTXML response can be idenfied by Name attribute or ID attribute in XMLScript Tag.


I don't know well about MVC application, however try this setup to post XML response to a web server.

Method: POST

Content-type: text/xml


404 error usually means wrong folder / file name specified - make sure the URL specified works.





In, response can be received as follows:

        protected void Page_Load(object sender, EventArgs e)
            Page.Response.ContentType = "text/xml";
            // Read XML posted via HTTP
            System.IO.StreamReader reader = new System.IO.StreamReader(Page.Request.InputStream);
            String xmlData = reader.ReadToEnd();

            System.IO.File.WriteAllText(@"C:\Temp\Response.xml", xmlData, System.Text.Encoding.UTF8);


In received text, you can see Name and ID which specified in the XML Script.

Print tag's JobName attribute shows document name, since document name is used for BarTender's default print job name.


Legacy Poster
評論操作 永久連結

Hi Shotaro,


Thanks a ton! That completely resolved my issue.  :)