• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 523
  • Last Modified:

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

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;">
<Response>
<Status code="200" text="Success">
</Status>
<PunchOutSetupResponse>
<StartPage>
<URL><%=myURL%>
</URL>
</StartPage>
</PunchOutSetupResponse>
</Response>
</cXML> 
<%
End Function
%>
 
<form method="post" action="<%=BrowserFormPost%>" name="ReturnPost" id="ReturnPost">
<INPUT TYPE="hidden" NAME="cxml-urlencoded" VALUE="<%=CreateCXML()%>">
</form>
 
 
<script language="javascript" type="text/javascript">
  {
    if ('<%=BrowserFormPost%>' != "")
      { 
	   document.ReturnPost.submit();
      }
  }
</script>

Open in new window

0
SG_unique
Asked:
SG_unique
  • 2
1 Solution
 
dan_nealCommented:
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

0
 
Rich HudecCommented:
 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
Dave
 
0
 
dan_nealCommented:
I am not familiar with Epicor.
0
 
SG_uniqueAuthor Commented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now