Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Execute an sqlbatch through an end-point

From: Tom@-----------.---------.---
To: 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.
> 
> 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent