webservice behavior / pivot

  • Thread starter Rouven Hertenstein
  • Start date
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
 
A

Alvin Bruney [MVP - ASP.NET]

check your permissions firstly, these are different processes and require
the appropriate permissions

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
 
R

Rouven Hertenstein

Hi Alvin,
I'm not sure what you're meaning.

When I use (just for testing):
alert("The method returned the result: " + event.result.value);
in the javascript (with webservice behind), it returns an alert with the
xml-structur, that is equivalent to your description of valid xml on page 445
in your black-book.

It works also, when I write the output from my webservice in an xml-file and
connect it like this:
document.all.locobj_pivotview.ConnectionString = "Provider=mspersist"
document.all.locobj_pivotview.CommandText = "http://localhost/test.xml"

That's a positive proof of the correct valid xml!

I think, there's the rub:
===============
document.all.locobj_pivotview.ConnectionString = "Provider=mspersist;"
document.all.locobj_pivotview.CommandText = event.result.value;

Because I can only set a text string (SQL) to the "CommandText Property" or
the URL of an XML file containing the data. But I can't allocate
"event.result.value" from the webservice behavior directly to the
"CommandText Property" (according to the remarks at the msdn-library)!

The same case by using XML-HTTP, of course. Because these two lines are the
same!

So, I need the instructions to connect the output of event.result.value
directly with pivot. Something like
document.all.locobj_pivotview.ConnectionString = "Provider=mspersist;"
document.all.locobj_pivotview.xxx = event.result.value;
(If it is possible).

Please, please, please :)

Regards,
Rouven


Alvin Bruney said:
check your permissions firstly, these are different processes and require
the appropriate permissions

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
Rouven Hertenstein said:
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
 
R

Rouven Hertenstein

Canceling!

I figured out that I have to connect the "event.result.value" (webservice
behavior) with a RecordSet. And then set the "DataSource Property" for
docking. It works!

Thanks,
Rouven


Rouven Hertenstein said:
Hi Alvin,
I'm not sure what you're meaning.

When I use (just for testing):
alert("The method returned the result: " + event.result.value);
in the javascript (with webservice behind), it returns an alert with the
xml-structur, that is equivalent to your description of valid xml on page 445
in your black-book.

It works also, when I write the output from my webservice in an xml-file and
connect it like this:
document.all.locobj_pivotview.ConnectionString = "Provider=mspersist"
document.all.locobj_pivotview.CommandText = "http://localhost/test.xml"

That's a positive proof of the correct valid xml!

I think, there's the rub:
===============
document.all.locobj_pivotview.ConnectionString = "Provider=mspersist;"
document.all.locobj_pivotview.CommandText = event.result.value;

Because I can only set a text string (SQL) to the "CommandText Property" or
the URL of an XML file containing the data. But I can't allocate
"event.result.value" from the webservice behavior directly to the
"CommandText Property" (according to the remarks at the msdn-library)!

The same case by using XML-HTTP, of course. Because these two lines are the
same!

So, I need the instructions to connect the output of event.result.value
directly with pivot. Something like
document.all.locobj_pivotview.ConnectionString = "Provider=mspersist;"
document.all.locobj_pivotview.xxx = event.result.value;
(If it is possible).

Please, please, please :)

Regards,
Rouven


Alvin Bruney said:
check your permissions firstly, these are different processes and require
the appropriate permissions

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
Rouven Hertenstein said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top