471,050 Members | 1,123 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,050 software developers and data experts.

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
2 1664
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
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.