B2B dolution in classical ASP

Discussion in 'ASP General' started by c676228, Apr 10, 2007.

  1. c676228

    c676228 Guest

    Hi all,
    Recently, a couple of our clients have asked if it is possible for them to
    pass data in xml format to our server program for processing it.
    Would you please give me some guide lines or point me to a starting point
    how I should do it in classical asp program.
    Thank you.
    --
    Betty
     
    c676228, Apr 10, 2007
    #1
    1. Advertising

  2. Hi Betty,

    For the client users of your application, how will they provide the XML
    data to your server application? So far, for classic ASP page, you can
    consider the following approachs:

    1. let use upload the xml data via file upload as Jon has suggested

    2. Let them programmatically post the XML document as content of http post
    request, and at server-side, you can read the XML data from http request's
    body:

    #Happy Days Are Here Again: Posting XML to the Server
    http://msdn2.microsoft.com/en-us/library/ms950790.aspx

    3. You can also let client user use html form input textbox to submit some
    XML data.

    IMO, the #1 and #2 would be preferred.


    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead



    ==================================================

    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.



    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscriptions/support/default.aspx.

    ==================================================



    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Steven Cheng[MSFT], Apr 11, 2007
    #2
    1. Advertising

  3. Hi Betty,

    Any progress on this? If you have anything else we can help, please feel
    free to post here.


    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Steven Cheng[MSFT], Apr 13, 2007
    #3
  4. c676228

    c676228 Guest

    Jon and Steven,
    thanks for your help. Steven, thank you so much being helpful all the time,
    with your detailed information and help, I can always quickly start with
    something which I never did before.
    I just read your meesage, I think in our scenario. Our client will send a
    XML file
    (which has many fields data in a form) programatically to our *.asp script.
    My task is unwrapped the data in this xml file and use it just like a
    regular form data and process it and then save the transaction data into
    database.
    I don't need to save this xml file some where, I need to process the data on
    the fly.
    Do you have an example, how to extra data from a xml file?
    --
    Betty


    "Steven Cheng[MSFT]" wrote:

    > Hi Betty,
    >
    > Any progress on this? If you have anything else we can help, please feel
    > free to post here.
    >
    >
    > Sincerely,
    >
    > Steven Cheng
    >
    > Microsoft MSDN Online Support Lead
    >
    >
    > This posting is provided "AS IS" with no warranties, and confers no rights.
    >
    >
     
    c676228, Apr 13, 2007
    #4
  5. c676228

    Evertjan. Guest

    Steven Cheng[MSFT] wrote on 13 apr 2007 in
    microsoft.public.inetserver.asp.general:

    > Any progress on this? If you have anything else we can help, please feel
    > free to post here.
    >


    [please always quote on usenet]

    Please Steven, usenet is not email.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Apr 13, 2007
    #5
  6. Hi Betty,

    For file uploading and processing in classic ASP, it is a bit complex since
    ASP doesn't provide built-in object model for accessing multi-part
    form(when upload files). I know that there are many 3rd party components
    for classic ASP file uploading processing. If you do not want to use 3rd
    party one, here are some web article that provide some custom vbscript to
    process uploaded file stream:

    #File upload script class
    http://authors.aspalliance.com/Michiel/uploadscript.asp

    #File Upload using a VBScript Class
    http://www.codeproject.com/asp/vbsupload.asp?df=100

    After you get the uploaded file's stream, you can load them into some XML
    component to process them(the MSXML classes).

    Hope this helps.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Steven Cheng[MSFT], Apr 13, 2007
    #6
  7. c676228

    c676228 Guest

    Hi,
    here is my question: The following code I download from hotscript.com which
    display oK on the server, but it will give me an error message if I use
    https://xxxx.com instead of http://xxxx.com
    The error message will be:(it seems very strange to me since it has nothing
    to do with xsl style sheet.


    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and
    then click the Refresh button, or try again later.


    --------------------------------------------------------------------------------

    Invalid at the top level of the document. Error processing resource
    'https://www.xxxxxx.com/annualp/testxm...

    <news><newsitem><title>programmingsite.co.uk</title><link>http://www.programmingsite.co.uk<...



    <%@LANGUAGE = "VBScript" %>
    <%
    Response.Buffer = False
    'ensure proper headers sent to the client
    Response.ContentType = "text/xml"
    %>
    <?xml version="1.0"?>
    <%
    'these are our variables
    Dim objXML , objNews
    'create an instance of the DOM
    Set objXML = Server.CreateObject("Microsoft.XMLDOM")
    'Create our root element using the createElement method
    Set objXML.documentElement = objXML.createElement("news")
    'Create the newsitem element
    Set objNews = objXML.createElement("newsitem")
    'now we will create all the child elements in this case
    'title , link and description
    objNews.appendChild objXML.createElement("title")
    objNews.appendChild objXML.createElement("link")
    objNews.appendChild objXML.createElement("description")
    'now we add values to the child elements
    objNews.childNodes(0).text = "programmingsite.co.uk"
    objNews.childNodes(1).text = "http://www.programmingsite.co.uk"
    objNews.childNodes(2).text = "programming resources"
    'add the newsitem element to the news element
    objXML.documentElement.appendChild objNews.cloneNode(true)
    'write the document using the xml method of the DOM
    Response.Write objXML.xml
    %>

    --
    Betty


    "Steven Cheng[MSFT]" wrote:

    > Hi Betty,
    >
    > Any progress on this? If you have anything else we can help, please feel
    > free to post here.
    >
    >
    > Sincerely,
    >
    > Steven Cheng
    >
    > Microsoft MSDN Online Support Lead
    >
    >
    > This posting is provided "AS IS" with no warranties, and confers no rights.
    >
    >
     
    c676228, Apr 17, 2007
    #7
  8. Thanks for your followup Betty,

    So when you return a XML document into ASP page's response, it displays
    well when through http channel, but report the following error through
    https channel, correct?

    =============
    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and
    then click the Refresh button, or try again later.
    ===============

    For this problem, I think it is likely due to the response's XML stream be
    malformed or the client browser has something incorrect. I have pasted your
    code and test in my local environment(with both SSL and non SSL channel),
    both of them work well.

    I think you can first try using a static XML document file(with the same
    response content) and visiting it through https to see whether you'll get
    the same problem behavior.

    For client specfic test, you can try using different machine or browser to
    perform the test to see whether behavior.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Steven Cheng[MSFT], Apr 19, 2007
    #8
  9. c676228

    c676228 Guest

    Re: B2B solution in classical ASP

    Steven,
    I think you are right. I have experience similar situation too.
    sometimes, the xml file cannot be present the way it is supposed to be. i.e.
    just regular text in the browser,
    But when I view the source of the page, the code is in xml file format. I
    don't know why.
    another question I want to ask is when I validate the data submitted from an
    external source, how I can check if certain fields are provided or not. let's
    say lastname,
    if they don't provide the lastname, check request("lastname")="" won't work,
    isNUll or isobject(Request("lastname")) seems not working, any suggestion or
    clue?
    Thank you.
    --
    Betty


    "Steven Cheng[MSFT]" wrote:

    > Thanks for your followup Betty,
    >
    > So when you return a XML document into ASP page's response, it displays
    > well when through http channel, but report the following error through
    > https channel, correct?
    >
    > =============
    > The XML page cannot be displayed
    > Cannot view XML input using XSL style sheet. Please correct the error and
    > then click the Refresh button, or try again later.
    > ===============
    >
    > For this problem, I think it is likely due to the response's XML stream be
    > malformed or the client browser has something incorrect. I have pasted your
    > code and test in my local environment(with both SSL and non SSL channel),
    > both of them work well.
    >
    > I think you can first try using a static XML document file(with the same
    > response content) and visiting it through https to see whether you'll get
    > the same problem behavior.
    >
    > For client specfic test, you can try using different machine or browser to
    > perform the test to see whether behavior.
    >
    > Sincerely,
    >
    > Steven Cheng
    >
    > Microsoft MSDN Online Support Lead
    >
    >
    > This posting is provided "AS IS" with no warranties, and confers no rights.
    >
    >
     
    c676228, Apr 24, 2007
    #9
  10. Re: B2B solution in classical ASP

    Hi Betty,

    For the form elements in the post request, I think as long as the certain
    item key has been included in the post messsage(such as the input element
    has been put on the <form> ), the request.Form collection should contain it
    (if no value specified, it is an empty string). You can use the following
    code to enumerate all the form collection items:

    ===============
    <%

    dim x

    for each x in Request.Form
    Response.Write("<br>" & x & " = " & Request.Form )
    next

    %>
    =================

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Steven Cheng[MSFT], Apr 26, 2007
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest

    B2B application

    Guest, Nov 24, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    326
    Richard K Bethell
    Nov 24, 2003
  2. Eduardo Rosa

    (classical ASP question) Order a xml

    Eduardo Rosa, Jun 30, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    391
    Kevin Spencer
    Jun 30, 2004
  3. c676228
    Replies:
    2
    Views:
    128
    c676228
    Apr 30, 2007
  4. c676228
    Replies:
    12
    Views:
    616
    一刀
    Mar 29, 2009
  5. Michael Galvin
    Replies:
    0
    Views:
    408
    Michael Galvin
    Oct 30, 2012
Loading...

Share This Page