Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Execute an sqlbatch through an end-point [Thread Next] RE: Execute an sqlbatch through an end-pointTo: NULL Date: 5/2/2006 7:38:00 AM I think I am having the same problem. Have you found a solution? Thanks.. -- Tom "DSmith1974@g..." wrote: > Now that IIS/Virtual directories is dropped in favour of web services > from SQL Server 2005, I need to update all of our sql related web-pages > (to eventually make use of the native xml datatype). > > Previously we relied heavily on xmlhttp to query the sqlxml database, > and direct the resulting xml into a stylesheet to generate dynamic > content. > > To try and acheive a similar way of working with 2005, I have created > an sqlbatch enabled end-point like this: > > CREATE ENDPOINT MyEndpoint > STATE = STARTED > AS HTTP ( > AUTHENTICATION = (INTEGRATED), > PATH = '/sql/myendpoint', > PORTS = (CLEAR) ) > FOR SOAP ( > BATCHES = ENABLED, > WSDL = DEFAULT > ) > > After searching many examples and reading the sql books online for > calling web-services directly using soap, I have come up with the > following vb6 function (which will eventually end up as vbscript or > javascript - as this needs to be initiated from within a normal > webpage) > > Private Sub Command1_Click() > On Error GoTo eh > > Dim objXmlHttp As Variant > Dim strRequest As String > > Set objXmlHttp = CreateObject("msxml2.xmlhttp.4.0") > > strRequest = "<?xml version='1.0' encoding='UTF-8' > standalone='no'?>" & _ > "<SOAP-ENV:Envelope > xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' " & _ > > "xmlns:sql='http://schemas.microsoft.com/sqlserver/2004/SOAP'> " + _ > " <SOAP-ENV:Body>" & _ > " <sql:sqlbatch>" & _ > " <sql:BatchCommands>select * from > sys.http_endpoints</sql:BatchCommands> " & _ > " </sql:sqlbatch>" & _ > " </SOAP-ENV:Body>" & _ > "</SOAP-ENV:Envelope>" > > Call objXmlHttp.open("POST", "http://dcnbk1/sql/myendpoint", False) > > Call objXmlHttp.Setrequestheader("Host", "dcnbk1") > Call objXmlHttp.Setrequestheader("Content-Type", "text/xml; > charset=utf-8") > Call objXmlHttp.Setrequestheader("SOAPAction", > "http://schemas.microsoft.com/sqlserver/2004/SOAPsqlbatch") > > Call objXmlHttp.send(strRequest) > > If objXmlHttp.Status = 200 Then > MsgBox objXmlHttp.responseXML.xml > Else > MsgBox "error" > End If > > Exit Sub > eh: > MsgBox Err.Description > End Sub > > Unfortunately, it seems no matter what I do, the call to send() always > throws the error - 'The parameter is incorrect'. > > I'd really (really) appreciate any pointers or a link to a complete > sample including calling code - as the books online falls short of > this.. > > Many thanks, > > Duncan. > > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
