Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

can pb 9 invoke a WCF service via com+?

4 posts in General Discussion Last posting was on 2013-03-11 11:26:46.0Z
ken yup Posted on 2013-03-08 13:22:11.0Z
Sender: 4fe1.5139e1bc.1804289383@sybase.com
From: ken yup
Newsgroups: sybase.public.powerbuilder.general
Subject: can pb 9 invoke a WCF service via com+?
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <5139e603.51e6.1681692777@sybase.com>
NNTP-Posting-Host: 172.20.134.41
X-Original-NNTP-Posting-Host: 172.20.134.41
Date: 8 Mar 2013 05:22:11 -0800
X-Trace: forums-1-dub 1362748931 172.20.134.41 (8 Mar 2013 05:22:11 -0800)
X-Original-Trace: 8 Mar 2013 05:22:11 -0800, 172.20.134.41
Lines: 186
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.general:249845
Article PK: 1308222

hi all, i hope i can findd a method that PB 9 can invoke the
WCF service.please help,thanks
i tried to build a COM+ that written by C# for the PB 9 to
invoke WCF service,but i failed,i have tried to migrate my
application to PB 12.5,but some NVO object is fail to
migrate,it appear that error and my application work not
normal,i google and found a method that legacy VB6 can
invoke the WCF service,i hope this method can use in
powerbuilder

web address:
http://msdn.microsoft.com/en-us/library/bb735856.aspx

the following is my fail test,i hope it can be a refrence to
all of you that dont write such code,it must be failed

i have got the warining when i registing the COM+:

E:\csharptest\bin\Debug>regsvcs /c bhcom.dll
Microsoft (R) .NET Framework Services Installation Utility
Version 2.0.50727.542
0
Copyright (c) Microsoft Corporation. All rights reserved.

Type library exporter warning processing
'bhcom.ServiceReference.Service1Client,
bhcom'. Warning: Type library exporter encountered a type
that derives from a g
eneric class and is not marked as
[ClassInterface(ClassInterfaceType.None)]. Cla
ss interfaces cannot be exposed for such types. Consider
marking the type with [
ClassInterface(ClassInterfaceType.None)] and exposing an
explicit interface as t
he default interface to COM using the ComDefaultInterface
attribute.
Type library exporter warning processing
'bhcom.ServiceReference.Proddepinfo.ext
ensionDataField, bhcom'. Warning: The public struct contains
one or more non-pub
lic fields that will be exported.

Installed Assembly:
Assembly: E:\csharptest\bin\Debug\bhcom.dll
Application: bhcom
TypeLib: E:\csharptest\bin\Debug\bhcom.tlb

Type library exporter warning processing
'bhcom.ServiceReference.Proddepinfo.extensionDataField,
bhcom'. Warning: The public struct contains one or more
non-public fields that will be exported.

my COM+ source code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Security.Cryptography.X509Certificates;
using System.Configuration;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.Windows;
using System.EnterpriseServices;




namespace bhcom
{

[Guid("04FF5B4F-BAF3-4eb7-9250-1A77863415E6")]
[ComVisible(true)]


public interface InvokeWCFInterface
{

string invokgetproddep(ref string[] prodnovar, ref
string[] prodnamevar, ref string[] prodsizevar, ref string[]
lastaddvar, ref double[] retailpricevar, ref int[]
belongtovar, ref int[] ysblvar, string wcfaddr, string
theusername, string thepw);



}



[Guid("96425A2C-06DE-43c4-81FC-E88CF00BE464")]
[ClassInterface(ClassInterfaceType.None)]
[ComVisible(true)]
public class Bhclass : ServicedComponent,
InvokeWCFInterface
{


public string invokgetproddep(ref string[]
prodnovar, ref string[] prodnamevar, ref string[]
prodsizevar, ref string[] lastaddvar, ref double[]
retailpricevar, ref int[] belongtovar, ref int[] ysblvar,
string wcfaddr, string theusername, string thepw)
{


ServiceReference.Service1Client m_proxy = new
ServiceReference.Service1Client();



int rowcount = 0;
int i = 0;
ServiceReference.Proddepinfo[] mylistproddepdc =
new ServiceReference.Proddepinfo[8000];
try
{
mylistproddepdc = m_proxy.GetProddepinfo(ref
rowcount);



for (i = 0; i < rowcount; i++)
{
prodnovar[i] =
mylistproddepdc[i].Myprodno;
prodnamevar[i] =
mylistproddepdc[i].Myprodname;
prodsizevar[i] =
mylistproddepdc[i].Myprodsize;
lastaddvar[i] =
mylistproddepdc[i].Mylastadd;
retailpricevar[i] =
mylistproddepdc[i].Myretailprice;
belongtovar[i] =
mylistproddepdc[i].Mybelongto;
ysblvar[i] = mylistproddepdc[i].Myysbl;

}


return "invoke WCF succesful";
}


catch
(FaultException<ServiceReference.GetProddepinfoFault> ex)
{
System.Windows.Forms.MessageBox.Show("error
occur&#65306;" + ex.Detail.Operation + " reason&#65306;" +
ex.Detail.ProblemType);
m_proxy.Abort();
return "invoke WCF failed";
}
catch (CommunicationException ex)
{
System.Windows.Forms.MessageBox.Show("error
occur&#65306;" + ex.ToString());
m_proxy.Abort();
return "invoke WCF failed";
}
catch (Exception ex)
{
System.Windows.Forms.MessageBox.Show("error
occur&#65306;" + ex.ToString());
m_proxy.Abort();
return "invoke WCF failed";
}

finally
{
if (m_proxy != null)
m_proxy.Close();
}


}


}
}

Ken redmond@139.com

best regards


Chris Pollach Posted on 2013-03-08 13:50:01.0Z
From: Chris Pollach <cpollach@travel-net.com>
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130215 Thunderbird/17.0.3
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.general
Subject: Re: can pb 9 invoke a WCF service via com+?
References: <5139e603.51e6.1681692777@sybase.com>
In-Reply-To: <5139e603.51e6.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <5139ec89$1@forums-1-dub>
Date: 8 Mar 2013 05:50:01 -0800
X-Trace: forums-1-dub 1362750601 172.20.134.152 (8 Mar 2013 05:50:01 -0800)
X-Original-Trace: 8 Mar 2013 05:50:01 -0800, vip152.sybase.com
Lines: 209
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.general:249846
Article PK: 1308223

Hi Ken;

FYI: http://pbdj.sys-con.com/node/1668463

HTH

--

Regards ... Chris
President: OSUG / STD Inc.
Vice President: ISUG-TECH
Blog: http://chrispollach.blogspot.com
SourceForge: http://sourceforge.net/projects/stdfndclass
PBDJ: http://chrispollach.sys-con.com
TKD: http://www.syeoh.com

On 3/8/2013 8:22 AM, ken yup wrote:
> hi all, i hope i can findd a method that PB 9 can invoke the
> WCF service.please help,thanks
> i tried to build a COM+ that written by C# for the PB 9 to
> invoke WCF service,but i failed,i have tried to migrate my
> application to PB 12.5,but some NVO object is fail to
> migrate,it appear that error and my application work not
> normal,i google and found a method that legacy VB6 can
> invoke the WCF service,i hope this method can use in
> powerbuilder
>
> web address:
> http://msdn.microsoft.com/en-us/library/bb735856.aspx
>
> the following is my fail test,i hope it can be a refrence to
> all of you that dont write such code,it must be failed
>
> i have got the warining when i registing the COM+:
>
> E:\csharptest\bin\Debug>regsvcs /c bhcom.dll
> Microsoft (R) .NET Framework Services Installation Utility
> Version 2.0.50727.542
> 0
> Copyright (c) Microsoft Corporation. All rights reserved.
>
> Type library exporter warning processing
> 'bhcom.ServiceReference.Service1Client,
> bhcom'. Warning: Type library exporter encountered a type
> that derives from a g
> eneric class and is not marked as
> [ClassInterface(ClassInterfaceType.None)]. Cla
> ss interfaces cannot be exposed for such types. Consider
> marking the type with [
> ClassInterface(ClassInterfaceType.None)] and exposing an
> explicit interface as t
> he default interface to COM using the ComDefaultInterface
> attribute.
> Type library exporter warning processing
> 'bhcom.ServiceReference.Proddepinfo.ext
> ensionDataField, bhcom'. Warning: The public struct contains
> one or more non-pub
> lic fields that will be exported.
>
> Installed Assembly:
> Assembly: E:\csharptest\bin\Debug\bhcom.dll
> Application: bhcom
> TypeLib: E:\csharptest\bin\Debug\bhcom.tlb
>
> Type library exporter warning processing
> 'bhcom.ServiceReference.Proddepinfo.extensionDataField,
> bhcom'. Warning: The public struct contains one or more
> non-public fields that will be exported.
>
> my COM+ source code:
>
> using System;
> using System.Collections.Generic;
> using System.Linq;
> using System.Text;
> using System.Runtime.InteropServices;
> using System.Security.Cryptography.X509Certificates;
> using System.Configuration;
> using System.ServiceModel;
> using System.ServiceModel.Channels;
> using System.Windows;
> using System.EnterpriseServices;
>
>
>
>
> namespace bhcom
> {
>
> [Guid("04FF5B4F-BAF3-4eb7-9250-1A77863415E6")]
> [ComVisible(true)]
>
>
> public interface InvokeWCFInterface
> {
>
> string invokgetproddep(ref string[] prodnovar, ref
> string[] prodnamevar, ref string[] prodsizevar, ref string[]
> lastaddvar, ref double[] retailpricevar, ref int[]
> belongtovar, ref int[] ysblvar, string wcfaddr, string
> theusername, string thepw);
>
>
>
> }
>
>
>
> [Guid("96425A2C-06DE-43c4-81FC-E88CF00BE464")]
> [ClassInterface(ClassInterfaceType.None)]
> [ComVisible(true)]
> public class Bhclass : ServicedComponent,
> InvokeWCFInterface
> {
>
>
> public string invokgetproddep(ref string[]
> prodnovar, ref string[] prodnamevar, ref string[]
> prodsizevar, ref string[] lastaddvar, ref double[]
> retailpricevar, ref int[] belongtovar, ref int[] ysblvar,
> string wcfaddr, string theusername, string thepw)
> {
>
>
> ServiceReference.Service1Client m_proxy = new
> ServiceReference.Service1Client();
>
>
>
> int rowcount = 0;
> int i = 0;
> ServiceReference.Proddepinfo[] mylistproddepdc =
> new ServiceReference.Proddepinfo[8000];
> try
> {
> mylistproddepdc = m_proxy.GetProddepinfo(ref
> rowcount);
>
>
>
> for (i = 0; i < rowcount; i++)
> {
> prodnovar[i] =
> mylistproddepdc[i].Myprodno;
> prodnamevar[i] =
> mylistproddepdc[i].Myprodname;
> prodsizevar[i] =
> mylistproddepdc[i].Myprodsize;
> lastaddvar[i] =
> mylistproddepdc[i].Mylastadd;
> retailpricevar[i] =
> mylistproddepdc[i].Myretailprice;
> belongtovar[i] =
> mylistproddepdc[i].Mybelongto;
> ysblvar[i] = mylistproddepdc[i].Myysbl;
>
> }
>
>
> return "invoke WCF succesful";
> }
>
>
> catch
> (FaultException<ServiceReference.GetProddepinfoFault> ex)
> {
> System.Windows.Forms.MessageBox.Show("error
> occur&#65306;" + ex.Detail.Operation + " reason&#65306;" +
> ex.Detail.ProblemType);
> m_proxy.Abort();
> return "invoke WCF failed";
> }
> catch (CommunicationException ex)
> {
> System.Windows.Forms.MessageBox.Show("error
> occur&#65306;" + ex.ToString());
> m_proxy.Abort();
> return "invoke WCF failed";
> }
> catch (Exception ex)
> {
> System.Windows.Forms.MessageBox.Show("error
> occur&#65306;" + ex.ToString());
> m_proxy.Abort();
> return "invoke WCF failed";
> }
>
> finally
> {
> if (m_proxy != null)
> m_proxy.Close();
> }
>
>
> }
>
>
> }
> }
>
> Ken redmond@139.com
>
> best regards
>


ken yup Posted on 2013-03-09 00:05:43.0Z
Sender: 1221.513a7b22.1804289383@sybase.com
From: ken yup
Newsgroups: sybase.public.powerbuilder.general
Subject: Re: can pb 9 invoke a WCF service via com+?
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <513a7cd7.12b8.1681692777@sybase.com>
References: <5139ec89$1@forums-1-dub>
NNTP-Posting-Host: 172.20.134.41
X-Original-NNTP-Posting-Host: 172.20.134.41
Date: 8 Mar 2013 16:05:43 -0800
X-Trace: forums-1-dub 1362787543 172.20.134.41 (8 Mar 2013 16:05:43 -0800)
X-Original-Trace: 8 Mar 2013 16:05:43 -0800, 172.20.134.41
Lines: 218
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.general:249853
Article PK: 1308237

hi Chris:
i knew that PB invoke COM+,i just dont know how to make a
COM+ that PB can invoke the WCF service, i have found a web
page that
build a COM+ to invoke the WCF service,but i still learn to
build the COM+ for PB using. the web page is
http://www.west-wind.com/weblog/posts/2007/Dec/16/WCF-Clients-and-COM-Interop

> Hi Ken;
>
> FYI: http://pbdj.sys-con.com/node/1668463
>
> HTH
>
> --
>
> Regards ... Chris
> President: OSUG / STD Inc.
> Vice President: ISUG-TECH
> Blog: http://chrispollach.blogspot.com
> SourceForge: http://sourceforge.net/projects/stdfndclass
> PBDJ: http://chrispollach.sys-con.com
> TKD: http://www.syeoh.com
>
>
>
> On 3/8/2013 8:22 AM, ken yup wrote:
> > hi all, i hope i can findd a method that PB 9 can invoke
> > the WCF service.please help,thanks
> > i tried to build a COM+ that written by C# for the PB 9
> > to invoke WCF service,but i failed,i have tried to
> > migrate my application to PB 12.5,but some NVO object is
> > fail to migrate,it appear that error and my application
> > work not normal,i google and found a method that legacy
> > VB6 can invoke the WCF service,i hope this method can
> > use in powerbuilder
> >
> > web address:
> > http://msdn.microsoft.com/en-us/library/bb735856.aspx
> >
> > the following is my fail test,i hope it can be a
> > refrence to all of you that dont write such code,it must
> be failed >
> > i have got the warining when i registing the COM+:
> >
> > E:\csharptest\bin\Debug>regsvcs /c bhcom.dll
> > Microsoft (R) .NET Framework Services Installation
> > Utility Version 2.0.50727.542
> > 0
> > Copyright (c) Microsoft Corporation. All rights
> reserved. >
> > Type library exporter warning processing
> > 'bhcom.ServiceReference.Service1Client,
> > bhcom'. Warning: Type library exporter encountered a
> > type that derives from a g
> > eneric class and is not marked as
> > [ClassInterface(ClassInterfaceType.None)]. Cla
> > ss interfaces cannot be exposed for such types. Consider
> > marking the type with [
> > ClassInterface(ClassInterfaceType.None)] and exposing an
> > explicit interface as t
> > he default interface to COM using the
> > ComDefaultInterface attribute.
> > Type library exporter warning processing
> > 'bhcom.ServiceReference.Proddepinfo.ext
> > ensionDataField, bhcom'. Warning: The public struct
> > contains one or more non-pub
> > lic fields that will be exported.
> >
> > Installed Assembly:
> > Assembly: E:\csharptest\bin\Debug\bhcom.dll
> > Application: bhcom
> > TypeLib: E:\csharptest\bin\Debug\bhcom.tlb
> >
> > Type library exporter warning processing
> > 'bhcom.ServiceReference.Proddepinfo.extensionDataField,
> > bhcom'. Warning: The public struct contains one or more
> > non-public fields that will be exported.
> >
> > my COM+ source code:
> >
> > using System;
> > using System.Collections.Generic;
> > using System.Linq;
> > using System.Text;
> > using System.Runtime.InteropServices;
> > using System.Security.Cryptography.X509Certificates;
> > using System.Configuration;
> > using System.ServiceModel;
> > using System.ServiceModel.Channels;
> > using System.Windows;
> > using System.EnterpriseServices;
> >
> >
> >
> >
> > namespace bhcom
> > {
> >
> > [Guid("04FF5B4F-BAF3-4eb7-9250-1A77863415E6")]
> > [ComVisible(true)]
> >
> >
> > public interface InvokeWCFInterface
> > {
> >
> > string invokgetproddep(ref string[] prodnovar,
> > ref string[] prodnamevar, ref string[] prodsizevar, ref
> > string[] lastaddvar, ref double[] retailpricevar, ref
> > int[] belongtovar, ref int[] ysblvar, string wcfaddr,
> > string theusername, string thepw);
> >
> >
> >
> > }
> >
> >
> >
> > [Guid("96425A2C-06DE-43c4-81FC-E88CF00BE464")]
> > [ClassInterface(ClassInterfaceType.None)]
> > [ComVisible(true)]
> > public class Bhclass : ServicedComponent,
> > InvokeWCFInterface
> > {
> >
> >
> > public string invokgetproddep(ref string[]
> > prodnovar, ref string[] prodnamevar, ref string[]
> > prodsizevar, ref string[] lastaddvar, ref double[]
> > retailpricevar, ref int[] belongtovar, ref int[] ysblvar
> > , string wcfaddr, string theusername, string thepw)
> > {
> >
> >
> > ServiceReference.Service1Client m_proxy =
> > new ServiceReference.Service1Client();
> >
> >
> >
> > int rowcount = 0;
> > int i = 0;
> > ServiceReference.Proddepinfo[]
> > mylistproddepdc = new ServiceReference.Proddepinfo[8000]
> > ; try
> > {
> > mylistproddepdc =
> > m_proxy.GetProddepinfo(ref rowcount);
> >
> >
> >
> > for (i = 0; i < rowcount; i++)
> > {
> > prodnovar[i] =
> > mylistproddepdc[i].Myprodno;
> > prodnamevar[i] =
> > mylistproddepdc[i].Myprodname;
> > prodsizevar[i] =
> > mylistproddepdc[i].Myprodsize;
> > lastaddvar[i] =
> > mylistproddepdc[i].Mylastadd;
> > retailpricevar[i] =
> > mylistproddepdc[i].Myretailprice;
> > belongtovar[i] =
> > mylistproddepdc[i].Mybelongto;
> > ysblvar[i] =
> mylistproddepdc[i].Myysbl; >
> > }
> >
> >
> > return "invoke WCF succesful";
> > }
> >
> >
> > catch
> > (FaultException<ServiceReference.GetProddepinfoFault>
> > ex) {
> >
> > System.Windows.Forms.MessageBox.Show("error
occur&#65306;
> > ;" + ex.Detail.Operation + " reason&#65306;" +
> > ex.Detail.ProblemType); m_proxy.Abort()
> > ; return "invoke WCF failed";
> > }
> > catch (CommunicationException ex)
> > {
> >
> > System.Windows.Forms.MessageBox.Show("error
occur&#65306;
> > ;" + ex.ToString()); m_proxy.Abort();
> > return "invoke WCF failed";
> > }
> > catch (Exception ex)
> > {
> >
> > System.Windows.Forms.MessageBox.Show("error
occur&#65306;
> > ;" + ex.ToString()); m_proxy.Abort();
> > return "invoke WCF failed";
> > }
> >
> > finally
> > {
> > if (m_proxy != null)
> > m_proxy.Close();
> > }
> >
> >
> > }
> >
> >
> > }
> > }
> >
> > Ken redmond@139.com
> >
> > best regards
> >
>


Chris Pollach Posted on 2013-03-11 11:26:46.0Z
From: Chris Pollach <cpollach@travel-net.com>
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130215 Thunderbird/17.0.3
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.general
Subject: Re: can pb 9 invoke a WCF service via com+?
References: <5139ec89$1@forums-1-dub> <513a7cd7.12b8.1681692777@sybase.com>
In-Reply-To: <513a7cd7.12b8.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <513dbf76$1@forums-1-dub>
Date: 11 Mar 2013 03:26:46 -0800
X-Trace: forums-1-dub 1363001206 172.20.134.152 (11 Mar 2013 03:26:46 -0800)
X-Original-Trace: 11 Mar 2013 03:26:46 -0800, vip152.sybase.com
Lines: 240
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.general:249861
Article PK: 1308248

Hi Ken;

You would use PB.net to create a WCF client based assembly. Then
just make that assembly COM Callable (fyi:
http:\\download.sybase.com/presentation/TW2008/21221.pdf)

--

Regards ... Chris
President: OSUG / STD Inc.
Vice President: ISUG-TECH
Blog: http://chrispollach.blogspot.com
SourceForge: http://sourceforge.net/projects/stdfndclass
PBDJ: http://chrispollach.sys-con.com
TKD: http://www.syeoh.com

On 3/8/2013 7:05 PM, ken yup wrote:
> hi Chris:
> i knew that PB invoke COM+,i just dont know how to make a
> COM+ that PB can invoke the WCF service, i have found a web
> page that
> build a COM+ to invoke the WCF service,but i still learn to
> build the COM+ for PB using. the web page is
> http://www.west-wind.com/weblog/posts/2007/Dec/16/WCF-Clients-and-COM-Interop
>
>> Hi Ken;
>>
>> FYI: http://pbdj.sys-con.com/node/1668463
>>
>> HTH
>>
>> --
>>
>> Regards ... Chris
>> President: OSUG / STD Inc.
>> Vice President: ISUG-TECH
>> Blog: http://chrispollach.blogspot.com
>> SourceForge: http://sourceforge.net/projects/stdfndclass
>> PBDJ: http://chrispollach.sys-con.com
>> TKD: http://www.syeoh.com
>>
>>
>>
>> On 3/8/2013 8:22 AM, ken yup wrote:
>>> hi all, i hope i can findd a method that PB 9 can invoke
>>> the WCF service.please help,thanks
>>> i tried to build a COM+ that written by C# for the PB 9
>>> to invoke WCF service,but i failed,i have tried to
>>> migrate my application to PB 12.5,but some NVO object is
>>> fail to migrate,it appear that error and my application
>>> work not normal,i google and found a method that legacy
>>> VB6 can invoke the WCF service,i hope this method can
>>> use in powerbuilder
>>>
>>> web address:
>>> http://msdn.microsoft.com/en-us/library/bb735856.aspx
>>>
>>> the following is my fail test,i hope it can be a
>>> refrence to all of you that dont write such code,it must
>> be failed >
>>> i have got the warining when i registing the COM+:
>>>
>>> E:\csharptest\bin\Debug>regsvcs /c bhcom.dll
>>> Microsoft (R) .NET Framework Services Installation
>>> Utility Version 2.0.50727.542
>>> 0
>>> Copyright (c) Microsoft Corporation. All rights
>> reserved. >
>>> Type library exporter warning processing
>>> 'bhcom.ServiceReference.Service1Client,
>>> bhcom'. Warning: Type library exporter encountered a
>>> type that derives from a g
>>> eneric class and is not marked as
>>> [ClassInterface(ClassInterfaceType.None)]. Cla
>>> ss interfaces cannot be exposed for such types. Consider
>>> marking the type with [
>>> ClassInterface(ClassInterfaceType.None)] and exposing an
>>> explicit interface as t
>>> he default interface to COM using the
>>> ComDefaultInterface attribute.
>>> Type library exporter warning processing
>>> 'bhcom.ServiceReference.Proddepinfo.ext
>>> ensionDataField, bhcom'. Warning: The public struct
>>> contains one or more non-pub
>>> lic fields that will be exported.
>>>
>>> Installed Assembly:
>>> Assembly: E:\csharptest\bin\Debug\bhcom.dll
>>> Application: bhcom
>>> TypeLib: E:\csharptest\bin\Debug\bhcom.tlb
>>>
>>> Type library exporter warning processing
>>> 'bhcom.ServiceReference.Proddepinfo.extensionDataField,
>>> bhcom'. Warning: The public struct contains one or more
>>> non-public fields that will be exported.
>>>
>>> my COM+ source code:
>>>
>>> using System;
>>> using System.Collections.Generic;
>>> using System.Linq;
>>> using System.Text;
>>> using System.Runtime.InteropServices;
>>> using System.Security.Cryptography.X509Certificates;
>>> using System.Configuration;
>>> using System.ServiceModel;
>>> using System.ServiceModel.Channels;
>>> using System.Windows;
>>> using System.EnterpriseServices;
>>>
>>>
>>>
>>>
>>> namespace bhcom
>>> {
>>>
>>> [Guid("04FF5B4F-BAF3-4eb7-9250-1A77863415E6")]
>>> [ComVisible(true)]
>>>
>>>
>>> public interface InvokeWCFInterface
>>> {
>>>
>>> string invokgetproddep(ref string[] prodnovar,
>>> ref string[] prodnamevar, ref string[] prodsizevar, ref
>>> string[] lastaddvar, ref double[] retailpricevar, ref
>>> int[] belongtovar, ref int[] ysblvar, string wcfaddr,
>>> string theusername, string thepw);
>>>
>>>
>>>
>>> }
>>>
>>>
>>>
>>> [Guid("96425A2C-06DE-43c4-81FC-E88CF00BE464")]
>>> [ClassInterface(ClassInterfaceType.None)]
>>> [ComVisible(true)]
>>> public class Bhclass : ServicedComponent,
>>> InvokeWCFInterface
>>> {
>>>
>>>
>>> public string invokgetproddep(ref string[]
>>> prodnovar, ref string[] prodnamevar, ref string[]
>>> prodsizevar, ref string[] lastaddvar, ref double[]
>>> retailpricevar, ref int[] belongtovar, ref int[] ysblvar
>>> , string wcfaddr, string theusername, string thepw)
>>> {
>>>
>>>
>>> ServiceReference.Service1Client m_proxy =
>>> new ServiceReference.Service1Client();
>>>
>>>
>>>
>>> int rowcount = 0;
>>> int i = 0;
>>> ServiceReference.Proddepinfo[]
>>> mylistproddepdc = new ServiceReference.Proddepinfo[8000]
>>> ; try
>>> {
>>> mylistproddepdc =
>>> m_proxy.GetProddepinfo(ref rowcount);
>>>
>>>
>>>
>>> for (i = 0; i < rowcount; i++)
>>> {
>>> prodnovar[i] =
>>> mylistproddepdc[i].Myprodno;
>>> prodnamevar[i] =
>>> mylistproddepdc[i].Myprodname;
>>> prodsizevar[i] =
>>> mylistproddepdc[i].Myprodsize;
>>> lastaddvar[i] =
>>> mylistproddepdc[i].Mylastadd;
>>> retailpricevar[i] =
>>> mylistproddepdc[i].Myretailprice;
>>> belongtovar[i] =
>>> mylistproddepdc[i].Mybelongto;
>>> ysblvar[i] =
>> mylistproddepdc[i].Myysbl; >
>>> }
>>>
>>>
>>> return "invoke WCF succesful";
>>> }
>>>
>>>
>>> catch
>>> (FaultException<ServiceReference.GetProddepinfoFault>
>>> ex) {
>>>
>>> System.Windows.Forms.MessageBox.Show("error
> occur&#65306;
>>> ;" + ex.Detail.Operation + " reason&#65306;" +
>>> ex.Detail.ProblemType); m_proxy.Abort()
>>> ; return "invoke WCF failed";
>>> }
>>> catch (CommunicationException ex)
>>> {
>>>
>>> System.Windows.Forms.MessageBox.Show("error
> occur&#65306;
>>> ;" + ex.ToString()); m_proxy.Abort();
>>> return "invoke WCF failed";
>>> }
>>> catch (Exception ex)
>>> {
>>>
>>> System.Windows.Forms.MessageBox.Show("error
> occur&#65306;
>>> ;" + ex.ToString()); m_proxy.Abort();
>>> return "invoke WCF failed";
>>> }
>>>
>>> finally
>>> {
>>> if (m_proxy != null)
>>> m_proxy.Close();
>>> }
>>>
>>>
>>> }
>>>
>>>
>>> }
>>> }
>>>
>>> Ken redmond@139.com
>>>
>>> best regards
>>>
>>