467,211 Members | 1,213 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,211 developers. It's quick & easy.

NullReferenceException when creating wsdl

Hi @all,

this is not my first webservice and everytime it worked that way, by now i
got following exception when trying to call http://<url>?wsdl in my
browser:

System.NullReferenceException: Object reference not set to an instance of an
object.
at
System.Runtime.Remoting.MetadataServices.WsdlGener ator.RealSchemaType.PrintMessageWsdl(TextWriter
textWriter, StringBuilder sb, String indent, ArrayList refNames)
at
System.Runtime.Remoting.MetadataServices.WsdlGener ator.XMLNamespace.PrintMessageWsdl(TextWriter
textWriter, StringBuilder sb, String indent, ArrayList refNames)
at System.Runtime.Remoting.MetadataServices.WsdlGener ator.PrintWsdl()
at System.Runtime.Remoting.MetadataServices.WsdlGener ator.Generate()
at
System.Runtime.Remoting.MetadataServices.MetaData. ConvertTypesToSchemaToStream(ServiceType[]
serviceTypes, SdlType sdlType, Stream outputStream)
at
System.Runtime.Remoting.MetadataServices.SdlChanne lSink.GenerateSdl(SdlType
sdlType, IServerResponseChannelSinkStack sinkStack, ITransportHeaders
requestHeaders, ITransportHeaders responseHeaders, Stream& outputStream)
at
System.Runtime.Remoting.MetadataServices.SdlChanne lSink.ProcessMessage(IServerChannelSinkStack
sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream
requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders,
Stream& responseStream)
at
System.Runtime.Remoting.Channels.Http.HttpServerTr ansportSink.ServiceRequest(Object
state)
at System.Runtime.Remoting.Channels.SocketHandler.Pro cessRequestNow()

The class is more than simple:

class UserProvider : MarshalByRefObject {

public UserProvider() {
}

public User[] search(User user, int offset, int limit) {

User[] users = user.Search(offset, limit);
return users;
}
}
W/o the method it works (but also w/o any function ;-).

This class gets registered as WellKnownService in an HttpChannel to provide
the webservice functionality. It is the second Service registered there,
but as the only one it doesn't work either.

Any hint?

Thanks Thorsten
Jul 27 '06 #1
  • viewed: 1501
Share:
2 Replies
Thorsten Viel wrote:

it seems that my Object User is the problem. But I work sometimes with own
classes. And normally they got defined as complex types in wsdl.
Hi @all,

this is not my first webservice and everytime it worked that way, by now i
got following exception when trying to call http://<url>?wsdl in my
browser:

System.NullReferenceException: Object reference not set to an instance of
an object.
at
System.Runtime.Remoting.MetadataServices.WsdlGener ator.RealSchemaType.PrintMessageWsdl(TextWriter
textWriter, StringBuilder sb, String indent, ArrayList refNames)
at
System.Runtime.Remoting.MetadataServices.WsdlGener ator.XMLNamespace.PrintMessageWsdl(TextWriter
textWriter, StringBuilder sb, String indent, ArrayList refNames)
at System.Runtime.Remoting.MetadataServices.WsdlGener ator.PrintWsdl()
at System.Runtime.Remoting.MetadataServices.WsdlGener ator.Generate()
at
System.Runtime.Remoting.MetadataServices.MetaData. ConvertTypesToSchemaToStream(ServiceType[]
serviceTypes, SdlType sdlType, Stream outputStream)
at
System.Runtime.Remoting.MetadataServices.SdlChanne lSink.GenerateSdl(SdlType
sdlType, IServerResponseChannelSinkStack sinkStack, ITransportHeaders
requestHeaders, ITransportHeaders responseHeaders, Stream& outputStream)
at
System.Runtime.Remoting.MetadataServices.SdlChanne lSink.ProcessMessage(IServerChannelSinkStack
sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream
requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders,
Stream& responseStream)
at
System.Runtime.Remoting.Channels.Http.HttpServerTr ansportSink.ServiceRequest(Object
state)
at System.Runtime.Remoting.Channels.SocketHandler.Pro cessRequestNow()

The class is more than simple:

class UserProvider : MarshalByRefObject {

public UserProvider() {
}

public User[] search(User user, int offset, int limit) {

User[] users = user.Search(offset, limit);
return users;
}
}
W/o the method it works (but also w/o any function ;-).

This class gets registered as WellKnownService in an HttpChannel to
provide the webservice functionality. It is the second Service registered
there, but as the only one it doesn't work either.

Any hint?

Thanks Thorsten
Jul 27 '06 #2
Huh, this is really weird!

It is because, the base class of User implements a simple interface with two
methods. Shouldn't be the problem, or?

Thorsten
Thorsten Viel wrote:
Thorsten Viel wrote:

it seems that my Object User is the problem. But I work sometimes with own
classes. And normally they got defined as complex types in wsdl.
>Hi @all,

this is not my first webservice and everytime it worked that way, by now
i got following exception when trying to call http://<url>?wsdl in my
browser:

System.NullReferenceException: Object reference not set to an instance of
an object.
at
System.Runtime.Remoting.MetadataServices.WsdlGener ator.RealSchemaType.PrintMessageWsdl(TextWriter
>textWriter, StringBuilder sb, String indent, ArrayList refNames)
at
System.Runtime.Remoting.MetadataServices.WsdlGener ator.XMLNamespace.PrintMessageWsdl(TextWriter
>textWriter, StringBuilder sb, String indent, ArrayList refNames)
at System.Runtime.Remoting.MetadataServices.WsdlGener ator.PrintWsdl()
at System.Runtime.Remoting.MetadataServices.WsdlGener ator.Generate()
at
System.Runtime.Remoting.MetadataServices.MetaData. ConvertTypesToSchemaToStream(ServiceType[]
>serviceTypes, SdlType sdlType, Stream outputStream)
at
System.Runtime.Remoting.MetadataServices.SdlChanne lSink.GenerateSdl(SdlType
>sdlType, IServerResponseChannelSinkStack sinkStack, ITransportHeaders
requestHeaders, ITransportHeaders responseHeaders, Stream& outputStream)
at
System.Runtime.Remoting.MetadataServices.SdlChanne lSink.ProcessMessage(IServerChannelSinkStack
>sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream
requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders,
Stream& responseStream)
at
System.Runtime.Remoting.Channels.Http.HttpServerTr ansportSink.ServiceRequest(Object
>state)
at System.Runtime.Remoting.Channels.SocketHandler.Pro cessRequestNow()

The class is more than simple:

class UserProvider : MarshalByRefObject {

public UserProvider() {
}

public User[] search(User user, int offset, int limit) {

User[] users = user.Search(offset, limit);
return users;
}
}
W/o the method it works (but also w/o any function ;-).

This class gets registered as WellKnownService in an HttpChannel to
provide the webservice functionality. It is the second Service registered
there, but as the only one it doesn't work either.

Any hint?

Thanks Thorsten
Jul 27 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Chris Dunaway | last post: by
2 posts views Thread by CroDude | last post: by
2 posts views Thread by Patrick Spence | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.