Discussion:
Error when calling .net dll com in ASP page by setting SoapDocumentMethodAttribute
(too old to reply)
paul
2006-08-18 20:57:06 UTC
Permalink
Raw Message
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
2006-08-22 18:02:32 UTC
Permalink
Raw Message
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
Permalink
Raw Message
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
http://www.developmentnow.com/g/
Loading...