Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / August 2006

Tip: Looking for answers? Try searching our database.

Error when calling .net dll com in ASP page by setting SoapDocumentMethodAttribute

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
paul - 18 Aug 2006 21:57 GMT
I found a very interesting issue that may draw you pro's attention:

I built a COM class using VS 2005 with Framework 2.0,and the code is as
below:

//----------------------Code Begin----------------------------------
using System;
using System.Runtime.InteropServices;

namespace Test99
{

 #region Interface published by your COM class
 [Guid("FE1EB79E-3513-487e-ADFF-2B61C6CB4730"),
InterfaceType(ComInterfaceType.InterfaceIsDual)]
 public interface IComClass1
 {
    [DispId(1)]
   string myHelloWorld();
   }
 #endregion

 [Guid("3B10A420-D36E-4056-BE0F-DD085433B966"),
ProgId("Test99.Class"),
ClassInterface(ClassInterfaceType.None)]
 [System.Web.Services.WebServiceBindingAttribute()]
 public class Class1 :
Microsoft.Web.Services2.WebServicesClientProtocol, IComClass1
 {
      public Class1()
     : base()
   {
   }

   //if I comment the attribute below,it works

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("SomeURL",
RequestNamespace = "SomeURL", ResponseElementName = "SomeName",
ResponseNamespace = "SomeURL", Use =
System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle
= System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]

   [return:
System.Xml.Serialization.XmlElementAttribute("ReturnValue")]
   public string myHelloWorld()
   {
     return "My Hello World";
   }

   }
}
//--------------------------Code
End------------------------------------------------

I checked "Register for COM interop" option in Build section of the
project property,sign the assembly with a strong name key file and
register to GAC

Then I try to use this COM object in VB6,VBA and ASP,and the result is:
1.In both VB6 and VBA ,I can call this COM object without any problems
by using either early binding or late binding.
2.In ASP page,when using early binding(referenced dll and used new
object stuff in the code),it gave me error message like "Class Class1
undefined";when use late binding(used createobject stuff),it gave the
error like "Error Type:Server object, ASP 0177 (0x80131509) 80131509"

That's not all, the most interesting thing is when I comment the code
"[System.Web.Services.Protocols.SoapDocumentMethodAttribute("SomeURL",
RequestNamespace = "SomeURL", ResponseElementName = "SomeName",
ResponseNamespace = "SomeURL", Use =
System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle
= System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]" ,I can
call it from ASP page by using late binding while the early binding
still gave the same error message.

So,any ideas?
paul - 22 Aug 2006 19:02 GMT
well, I have to answer myself

There is something about the permission issue. .Net needs a place to
make some temporary assemblies.You can change this value in
machine.config or web.config file by modifying the value of
TempDirectory attribure under the <Compilation> element.See
http://msdn2.microsoft.com/en-us/library/s10awwz0.aspx. But for the DLL
application I still can not find out where to set this value. Instead
of doing it, I just authorize the "Launch IIS process
account"(IWAM_MACHINENAME ) with access right to the folder which
contains the DLL file and to the folder $WINDOWS ROOT FOLDER$\Temp.
Then I solved my problem. Hope this helps others who are stuck with
this issue.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.