R
Rouven Hertenstein
1. My Client-scipt uses the webservice behavior and couple it with a pivot
table
==================================================
<SCRIPT language="JavaScript">
var iCallID;
function init()
{
service.useService("http://localhost/Service1.asmx?WSDL","MyService");
iCallID = service.MyService.callService("GetResultsAsAdoXML");
}
function onWSresult()
{
document.all.locobj_pivotview.ConnectionString = "Provider=mspersist";
document.all.locobj_pivotview.CommandText = event.result.value;
}
</SCRIPT>
</HEAD>
<BODY MS_POSITIONING="GridLayout" onload="init()">
<div id="service" style="BEHAVIOR:url(webservice.htc)"
onresult="onWSresult()"></div>
....
2. My webservice returns valid xml:
=======================
<WebMethod()> Public Function GetResultsAsAdoXML() As String
Dim myAdoRs As ADODB.Recordset
Dim myAdoConnection As New ADODB.Connection
Dim mypersiststream As New ADODB.Stream
Dim myConnectionString As String = "driver={SQL Server};
Server=sql-server; Database=db; UID=sa; PW=;"
Dim mySelect As String = "SELECT * from sql-view"
myAdoConnection.ConnectionString = myConnectionString
myAdoConnection.Open()
myAdoRs = myAdoConnection.Execute(mySelect)
myAdoRs.Save(mypersiststream, ADODB.PersistFormatEnum.adPersistXML)
'mypersiststream.SaveToFile("C:\Inetpub\wwwroot\PVA-WebService\test.xml",
ADODB.SaveOptionsEnum.adSaveCreateOverWrite)
Return mypersiststream.ReadText
myAdoConnection.Close()
End Function
It works, when I creat an xml-file and call it (look at the comments in the
webservice and javascript).
But when I use the webservice behind (the file "webservice.htc" exists of
course), the pivot table won't load the data correctly. The error message is
something like " the query can't work out: o By opening the file "<xml
xmlns:s="uuid:BDC6E3FO- etc. etc. etc."
I tried to manipulate the string, which the webservice results:
comma delimited by mystring = mystring.Replace(">", ">,") or mystring =
mystring.Replace("""", "'") but the pivot table won't do...
I'm thankfull for every advice.
Regards,
Rouven
table
==================================================
<SCRIPT language="JavaScript">
var iCallID;
function init()
{
service.useService("http://localhost/Service1.asmx?WSDL","MyService");
iCallID = service.MyService.callService("GetResultsAsAdoXML");
}
function onWSresult()
{
document.all.locobj_pivotview.ConnectionString = "Provider=mspersist";
document.all.locobj_pivotview.CommandText = event.result.value;
}
</SCRIPT>
</HEAD>
<BODY MS_POSITIONING="GridLayout" onload="init()">
<div id="service" style="BEHAVIOR:url(webservice.htc)"
onresult="onWSresult()"></div>
....
2. My webservice returns valid xml:
=======================
<WebMethod()> Public Function GetResultsAsAdoXML() As String
Dim myAdoRs As ADODB.Recordset
Dim myAdoConnection As New ADODB.Connection
Dim mypersiststream As New ADODB.Stream
Dim myConnectionString As String = "driver={SQL Server};
Server=sql-server; Database=db; UID=sa; PW=;"
Dim mySelect As String = "SELECT * from sql-view"
myAdoConnection.ConnectionString = myConnectionString
myAdoConnection.Open()
myAdoRs = myAdoConnection.Execute(mySelect)
myAdoRs.Save(mypersiststream, ADODB.PersistFormatEnum.adPersistXML)
'mypersiststream.SaveToFile("C:\Inetpub\wwwroot\PVA-WebService\test.xml",
ADODB.SaveOptionsEnum.adSaveCreateOverWrite)
Return mypersiststream.ReadText
myAdoConnection.Close()
End Function
It works, when I creat an xml-file and call it (look at the comments in the
webservice and javascript).
But when I use the webservice behind (the file "webservice.htc" exists of
course), the pivot table won't load the data correctly. The error message is
something like " the query can't work out: o By opening the file "<xml
xmlns:s="uuid:BDC6E3FO- etc. etc. etc."
I tried to manipulate the string, which the webservice results:
comma delimited by mystring = mystring.Replace(">", ">,") or mystring =
mystring.Replace("""", "'") but the pivot table won't do...
I'm thankfull for every advice.
Regards,
Rouven