Error when calling .net dll com in ASP page by setting SoapDocumentMethodAttribute
(too old to reply)
2006-08-18 20:57:06 UTC
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

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

namespace Test99

#region Interface published by your COM class
public interface IComClass1
string myHelloWorld();

public class Class1 :
Microsoft.Web.Services2.WebServicesClientProtocol, IComClass1
public Class1()
: base()

//if I comment the attribute below,it works

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

public string myHelloWorld()
return "My Hello World";


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
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?
2006-08-22 18:02:32 UTC
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.
Steve Bradbery
2010-09-01 19:47:14 UTC
This was *huge* help. Thanks for posting it!!!

From http://www.developmentnow.com/g/21_2006_8_0_0_807392/Error-when-calling-net-dll-com-in-ASP-page-by-setting-SoapDocumentMethodAttribute.ht

Posted via DevelopmentNow.com Group