I am attempting to create a bound connection (loopback) in an extended stored procedure. The xp should:
-- accept a bind token, a path to an XML file, and a namespace string as parameters
-- establish a connection to the server which called it
-- bind the session
-- pass the contents of the XML file specified by the path to sp_xml_preparedocument
-- receive the document handle from sp_xmlpreparedocument
-- pass the document handle back to the calling application
The xp at this point does all this, using sp_getbindtoken in the calling sp and sp_bindsession (or is it srv_bindsession?) in the xp. Debug output shows that the bind token is being passed properly.
The calling sp fails when trying to use OpenXML using the returned handle (cannot find a document with that handle). To separate the bound connection problem from the XML stuff, the same problem occurs if the sp creates a temp table and the xp, after the session is bound, attempts to insert into it. The temp table created by the sp is invisible to the xp and vice versa, just as with the prepared XML document.
Does anyone know if what I am trying to do is possible with bound connections or in any other way? Does anyone have any examples other than the ones from BOL and MSDN?
Thanks ever so much.
Jennifer
-- accept a bind token, a path to an XML file, and a namespace string as parameters
-- establish a connection to the server which called it
-- bind the session
-- pass the contents of the XML file specified by the path to sp_xml_preparedocument
-- receive the document handle from sp_xmlpreparedocument
-- pass the document handle back to the calling application
The xp at this point does all this, using sp_getbindtoken in the calling sp and sp_bindsession (or is it srv_bindsession?) in the xp. Debug output shows that the bind token is being passed properly.
The calling sp fails when trying to use OpenXML using the returned handle (cannot find a document with that handle). To separate the bound connection problem from the XML stuff, the same problem occurs if the sp creates a temp table and the xp, after the session is bound, attempts to insert into it. The temp table created by the sp is invisible to the xp and vice versa, just as with the prepared XML document.
Does anyone know if what I am trying to do is possible with bound connections or in any other way? Does anyone have any examples other than the ones from BOL and MSDN?
Thanks ever so much.
Jennifer