Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Web Services
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Web Services
Titre:
Web Services
Divers
Thread ID:
01225425
Message ID:
01225425
Vues:
130
Hi everybody,

I am trying to use sample code from "Visual FoxPro Web Services Revisited", from Rick Strahl. To expose a class to COM and then publish it to a .NET Web service.

This is the foxpro class:
DEFINE CLASS Customer AS SESSION OLEPUBLIC
	cName = "Rick Strahl"
	cCompany = "West Wind Technologies"
	cAddress = "32 Kaiea Place"
	dDate = null

	DIMENSION cName_COMATTRIB[4]
	cName_COMATTRIB[1] = 0  && Full Access
	cName_COMATTRIB[2] = "Customer Name"
	cName_COMATTRIB[3] = "cName"  && Proper capitalization.
	cName_COMATTRIB[4] = "string"        && Data type

	DIMENSION cCompany_COMATTRIB[4]
	cCompany_COMATTRIB[1] = 0  && Full Access
	cCompany_COMATTRIB[2] = "Customer Company"
	cCompany_COMATTRIB[3] = "cCompany"  && Proper capitalization.
	cCompany_COMATTRIB[4] = "string"        && Data type

	DIMENSION cAddress_COMATTRIB[4]
	cAddress_COMATTRIB[1] = 0  && Full Access
	cAddress_COMATTRIB[2] = "Customer Address"
	cAddress_COMATTRIB[3] = "cAddress"  && Proper capitalization.
	cAddress_COMATTRIB[4] = "string"        && Data type

	DIMENSION dDate_COMATTRIB[4]
	dDate_COMATTRIB[1] = 0  && Full Access
	dDate_COMATTRIB[2] = "Date this customer was entered"
	dDate_COMATTRIB[3] = "dDate"  && Proper capitalization.
	dDate_COMATTRIB[4] = "date" && Data type 

FUNCTION INIT
	dDate = DATE()
ENDFUNC
	
ENDDEFINE
this is what I got after building dll, rebuilding .NET Web service project (added reference to dll again) and testing Web Serivce through VS2005:
 <?xml version="1.0" encoding="utf-8" ?> 
- <CustomerClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/">
  <cName>Rick Strahl</cName> 
  <cCompany>West Wind Technologies</cCompany> 
  <cAddress>32 Kaiea Place</cAddress> 
  <dDate>1899-12-30T00:00:00</dDate> 
  </CustomerClass>
Everything looks good except for the date. Rick Strahl removed this line from the class
dDate_COMATTRIB[4] = "date"

and this is what I have now after rebuilding dll and NET Web service project:
System.InvalidOperationException: Unable to generate a temporary class (result=1).
error CS0122: 'System.__ComObject' is inaccessible due to its protection level
error CS0122: 'System.__ComObject' is inaccessible due to its protection level

   at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, CompilerParameters parameters, Evidence evidence)
   at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, CompilerParameters parameters, Assembly assembly, Hashtable assemblies)
   at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)
   at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Evidence evidence)
   at System.Web.Services.Protocols.XmlReturn.GetInitializers(LogicalMethodInfo[] methodInfos)
   at System.Web.Services.Protocols.XmlReturnWriter.GetInitializers(LogicalMethodInfo[] methodInfos)
   at System.Web.Services.Protocols.MimeFormatter.GetInitializers(Type type, LogicalMethodInfo[] methodInfos)
   at System.Web.Services.Protocols.HttpServerType..ctor(Type type)
   at System.Web.Services.Protocols.HttpServerProtocol.Initialize()
   at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
I don't know what I am missing or waht else I need to set.

Thanks in advance
Répondre
Fil
Voir

Click here to load this message in the networking platform