Help! Remoting objects in IIS ... not working :(

Posts   
 
    
mshe
User
Posts: 167
Joined: 02-Feb-2006
# Posted on: 19-May-2006 08:38:05   

Hi all,

I'm trying to remote the following class:

Public Class TestCampaignController Inherits TestBaseController

Public Function GetCampaigns() As EntityClasses.CampaignEntity

End Function

End Class

It seems EntityClassses.CampaignEntity is not remotable. I get the following error when I try to access the WSDL file from IE:

System.NullReferenceException: Object reference not set to an instance of an object. at System.Runtime.Remoting.MetadataServices.RealSchemaType.PrintMessageWsdl(TextWriter textWriter, StringBuilder sb, String indent, ArrayList refNames) at System.Runtime.Remoting.MetadataServices.XMLNamespace.PrintMessageWsdl(TextWriter textWriter, StringBuilder sb, String indent, ArrayList refNames) at System.Runtime.Remoting.MetadataServices.WsdlGenerator.PrintWsdl() at System.Runtime.Remoting.MetadataServices.WsdlGenerator.Generate() at System.Runtime.Remoting.MetadataServices.SUDSGenerator.Generate() at System.Runtime.Remoting.MetadataServices.SdlChannelSink.GenerateSdl(SdlType sdlType, IServerResponseChannelSinkStack sinkStack, ITransportHeaders requestHeaders, ITransportHeaders responseHeaders, Stream& outputStream) at System.Runtime.Remoting.MetadataServices.SdlChannelSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream) at System.Runtime.Remoting.Channels.Http.HttpHandlerTransportSink.HandleRequest(HttpContext context) at System.Runtime.Remoting.Channels.Http.HttpRemotingHandler.InternalProcessRequest(HttpContext context)

If I remove EntityClasses.CampaignEntity and replace it with a hashtable... it works.

Are LLBLGen entities compatible with remoting?

mshe
User
Posts: 167
Joined: 02-Feb-2006
# Posted on: 19-May-2006 08:44:45   

I did more test, this doesn't work either:


Public Class TestCampaignController
    Inherits TestBaseController

    Public Function GetCampaigns() As HelperClasses.EntityCollection

    End Function
End Class

But this does:


Public Class TestCampaignController
    Inherits TestBaseController

    Public Function GetCampaigns() As TestObject
    End Function
End Class

Public Class TestObject
End Class

Seems like whenever I use a LLBLGen return type IIS Remoting bombs. Has anyone encountered this issue before?

I'm using 1.0.2005.1 LLBLGen with the SubClass templates.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 19-May-2006 09:20:23   

That's not remoting, that's a webservice. These things are completely different: one (remoting) is done using binary or soap formatters, the other (webservices) is done using XmlSerializer.

This all according to your first exception.

So what's it that you use? WSDL suggests webservices, so you should use [WebMethod] attributes. If you use remoting, you should add a serializable constructor to your class.

Frans Bouma | Lead developer LLBLGen Pro
Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 19-May-2006 09:20:52   

Please check the following thread: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=1050

It might be helpful, if not please come back.

mshe
User
Posts: 167
Joined: 02-Feb-2006
# Posted on: 19-May-2006 09:25:57   

Hi Ya,

I'm indeed using remoting... When you're hosting objects in IIS, a lot of articles recommend that you run the command:

httpdisappointed /localhost/mydir/ObjectURI?wsdl

To generate the WSDL definition (just as a test).

However, it seems to crash when LLBLGen objects are used.

I did some further tests - remoting IS working... tho the WSDL generation does not.

I wonder why?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 19-May-2006 09:33:17   

Please read the section "Caveats using wsdl.exe" under "Using the generated code -> XML Webservices support" in the LLBLGen Pro documentation manual.

mshe
User
Posts: 167
Joined: 02-Feb-2006
# Posted on: 19-May-2006 23:58:06   

Hmm interesting - I guess when IIS tries to generate the WSDL file for HTTP remoting it craps out.

I'm looking forward to LLBLGen Pro 2.0 simple_smile