From: Jeff Johnson on
"Family Tree Mike" <FamilyTreeMike(a)ThisOldHouse.com> wrote in message
news:OXURT7yXKHA.3600(a)TK2MSFTNGP04.phx.gbl...

> I know I'm going to regret this, but...
>
> Can't you call the web service from VB 6?

With the SOAP Toolkit, probably.


From: Scott M. on

"Mark Goldin" <mgoldin(a)UFANDD.LOCAL> wrote in message
news:O0plA5yXKHA.1268(a)TK2MSFTNGP04.phx.gbl...
> This is what I have so far:
> using System;
> using System.Collections.Generic;
> using System.Linq;
> using System.Text;
> using System.Web.Services.Protocols;
> using WebServiceAccessReports.ufddbreportservices;
>
> namespace WebServiceAccessReports
> {
> public class Program
> {
> static void Main(string[] args)
> {
> }
> public string getParameters(string reportFile)
> {
> ReportingService2005 rs = new ReportingService2005();
> rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
> string report = reportFile;
> bool forRendering = false;
> string historyID = null;
> string returnStr = "";
> ParameterValue[] values = null;
> DataSourceCredentials[] credentials = null;
> ReportParameter[] parameters = null;
>
> try
> {
> parameters = rs.GetReportParameters(report, historyID,
> forRendering, values, credentials);
> if (parameters != null)
> {
> foreach (ReportParameter rp in parameters)
> {
> returnStr = returnStr + " " + rp.Name;
> //Console.WriteLine("Name: {0}", rp.Name);
> }
> }
> }
>
> catch (SoapException e)
> {
> Console.WriteLine(e.Detail.InnerXml.ToString());
> }
> return returnStr;
>
> }
> }
> }
>
>
> I built it as a class library I ran regasm utility with no problem.
> My question is: do I instantiate WebServiceAccessReports.Program or what?
>
> Thanks for all the help.

It looks like you have a Console application here, even though you built it
as a class libary. You should build this as a class library project from
the start. But yes, after you get your COM proxy, you just make an instance
of the class and use it as usual.

-Scott


From: Mark Goldin on
I surely will.
But I tried run it and I got something working, but all the way.
When I run getParameters ...
I am getting:
OLE IDispatch exception code 0 from mscorlib: Request for the permission of
type
'System.Security.Permissions.EnvironmentPermission, mscorlib, Version ....
Culture ... PublicKeyToken ......
failed ....
What do I need to provide?

Thanks agian.

"Scott M." <s-mar(a)nospam.nospam> wrote in message
news:eWxjVFzXKHA.4648(a)TK2MSFTNGP05.phx.gbl...
>
> "Mark Goldin" <mgoldin(a)UFANDD.LOCAL> wrote in message
> news:O0plA5yXKHA.1268(a)TK2MSFTNGP04.phx.gbl...
>> This is what I have so far:
>> using System;
>> using System.Collections.Generic;
>> using System.Linq;
>> using System.Text;
>> using System.Web.Services.Protocols;
>> using WebServiceAccessReports.ufddbreportservices;
>>
>> namespace WebServiceAccessReports
>> {
>> public class Program
>> {
>> static void Main(string[] args)
>> {
>> }
>> public string getParameters(string reportFile)
>> {
>> ReportingService2005 rs = new ReportingService2005();
>> rs.Credentials =
>> System.Net.CredentialCache.DefaultCredentials;
>> string report = reportFile;
>> bool forRendering = false;
>> string historyID = null;
>> string returnStr = "";
>> ParameterValue[] values = null;
>> DataSourceCredentials[] credentials = null;
>> ReportParameter[] parameters = null;
>>
>> try
>> {
>> parameters = rs.GetReportParameters(report, historyID,
>> forRendering, values, credentials);
>> if (parameters != null)
>> {
>> foreach (ReportParameter rp in parameters)
>> {
>> returnStr = returnStr + " " + rp.Name;
>> //Console.WriteLine("Name: {0}", rp.Name);
>> }
>> }
>> }
>>
>> catch (SoapException e)
>> {
>> Console.WriteLine(e.Detail.InnerXml.ToString());
>> }
>> return returnStr;
>>
>> }
>> }
>> }
>>
>>
>> I built it as a class library I ran regasm utility with no problem.
>> My question is: do I instantiate WebServiceAccessReports.Program or what?
>>
>> Thanks for all the help.
>
> It looks like you have a Console application here, even though you built
> it as a class libary. You should build this as a class library project
> from the start. But yes, after you get your COM proxy, you just make an
> instance of the class and use it as usual.
>
> -Scott
>

From: Scott M. on

"Mark Goldin" <mgoldin(a)UFANDD.LOCAL> wrote in message
news:ubMNyKzXKHA.3428(a)TK2MSFTNGP06.phx.gbl...
>I surely will.
> But I tried run it and I got something working, but all the way.
> When I run getParameters ...
> I am getting:
> OLE IDispatch exception code 0 from mscorlib: Request for the permission
> of type
> 'System.Security.Permissions.EnvironmentPermission, mscorlib, Version ....
> Culture ... PublicKeyToken ......
> failed ....
> What do I need to provide?
>
> Thanks agian.

Not exactly sure since I'm not familiar with your entire setup, but I'd
Google the exact error you got for some ideas on what is the problem and
potential cures.

-Scott


From: Arne Vajhøj on
Jeff Johnson wrote:
> "Family Tree Mike" <FamilyTreeMike(a)ThisOldHouse.com> wrote in message
> news:OXURT7yXKHA.3600(a)TK2MSFTNGP04.phx.gbl...
>> I know I'm going to regret this, but...
>>
>> Can't you call the web service from VB 6?
>
> With the SOAP Toolkit, probably.

It should work. It is COM based. VB6 use COM.

But it is an IDE from 1998 using a kit from 2003.

Not particular attractive.

Arne