How to Post XML 'response back'  to Epicor b2b Supplier using Classic .ASP

Posted on 2009-04-15
Medium Priority
Last Modified: 2012-05-06
I am able to receive a 'Punchout request' from supplier with no problems, but, when I try to Post response back using 'cxml-urlencoded' hidden field I receive following message:

(Tap Out message: A string variable was expected but no openning character was found)

Code is below:

Thanks for your help......

<%@LANGUAGE = VBScript%>
myURL = "https://www.sg.net/SiteA/_Epicor/b2bshop.asp?CompID=0122"
'Build XML string
Function CreateCXML()
<?xml version = &quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
<!DOCTYPE cXML SYSTEM &quot;http://xml.cxml.org/schemas/cXML/1.2.014/cXML.dtd&quot;>
<cXML payloadID="&lt;%= Now &amp;&quot;@&quot;&amp;Request.ServerVariables(&quot;LOCAL_ADDR&quot;)%&gt;" timestamp="&lt;%= Now %&gt;">
<Status code="200" text="Success">
End Function
<form method="post" action="<%=BrowserFormPost%>" name="ReturnPost" id="ReturnPost">
<INPUT TYPE="hidden" NAME="cxml-urlencoded" VALUE="<%=CreateCXML()%>">
<script language="javascript" type="text/javascript">
    if ('<%=BrowserFormPost%>' != "")

Open in new window

Question by:SG_unique
  • 2

Expert Comment

ID: 24154269
Have you attempted to alert the value of the hidden field to verify that the XML is getting into the field?
If it is not try changing your function to:

Function CreateCXML()
createcxml = "<?xml version = ""1.0"" encoding=""UTF-8""?>"
createcxml = createcxml & "<!DOCTYPE cXML SYSTEM ""http://xml.cxml.org/schemas/cXML/1.2.014/cXML.dtd"">"
createcxml = createcxml & "<cXML payloadID=""" & now & "@" & Request.ServerVariables("LOCAL_ADDR") & """ timestamp=""" & Now &""">"
createcxml = createcxml & "<Response><Status code=""200"" text=""Success"" />"
createcxml = createcxml & "<PunchOutSetupResponse><StartPage>"
createcxml = createcxml & "<URL>" & myURL & "</URL></StartPage></PunchOutSetupResponse>"
createcxml = createcxml & "</Response></cXML>"
End Function

Open in new window


Expert Comment

by:Rich Hudec
ID: 24162318
 Yes - XML is getting into hiddenfield ,also, tried your New function logic.
After change to program (per above function)  I initially received error: A string literal was expected.
So I replaced double-quotes with single-quotes and received error msg: The character '<' cannot be used in a attribute value.
 I decided to create a Login program to access this page and the 'hidden' field was read correctly and redirected to my catalog page w/o a problem. I'm wondering if Epicor has a configuration setting that needs to be set.

Thanks again for any suggestions

Expert Comment

ID: 24162672
I am not familiar with Epicor.

Accepted Solution

SG_unique earned 0 total points
ID: 24163004
Epicor is Similiar to Ariba procurement application, there are a couple of choices of how-to post/receive a data string  - either thru a hidden field  or  XML call.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Loops Section Overview
Screencast - Getting to Know the Pipeline
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question