Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Sending XML directly to a template using SQL Server & IIS

Sending XML directly to a template using SQL Server & IIS

Scheduled Pinned Locked Moved Database
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nick Blumhardt
    wrote on last edited by
    #1

    Hi all, I'm trying to use IXMLHTTPRequest to send an XML document (from a C++ client app) to a template on a SQL Server. It appears IIS support is configured properly, because putting the document directly in the url works - like this: http://myserver/virtualdir/templates/mytemplate.xml?doc='<root/>' The template is:

    <ROOT xmlns:sql='urn:schemas-microsoft-com:xml-sql'>
    sql:header
    <sql:param name='doc'>'default'</sql:param>
    sql:header
    sql:query
    exec usp_MySP @doc
    </sql:query>
    <ROOT>

    In code, I open an IXMLDOMDocument, and load xml into it. Then, I open an IXMLHTTPRequest and send the document:

    hr = pIXMLHttpRequest->open(\_bstr\_t(\_T("POST")),
                                \_bstr\_t(\_T("http://myserver/virtualdir/templates/mytemplate.xml")),
                                \_variant\_t(VARIANT\_FALSE),
                                \_variant\_t(""), \_variant\_t(""));
    
    hr = pIXMLHttpRequest->setRequestHeader(\_bstr\_t(\_T("Content-type")), 
                                \_bstr\_t(\_T("application/xml")));
    
    hr = pIXMLHttpRequest->send((IDispatch \*)pDoc);
    

    The stored procedure always gets the default parameter, not whatever document I pass in. Thanks for any help with this cryptic stuff Cheers NB

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups