Hello, Andreas!
This message
"
The server
was unable to process the request due to an internal error. For more
information about the error, either turn on IncludeExceptionDetailInFaults
(either from ServiceBehaviorAttribute or from the <serviceDebug>
configuration behavior) on the server in order to send the exception
information back to the client, or turn on tracing as per the Microsoft .NET
Framework 3.0 SDK documentation and inspect the server trace
logs.
"
tells that IncludeExceptionDetailInFaults is set to false. Set it to true
this will give more info about the problem.
You wrote on Mon, 18 Dec 2006 08:37:06 +0100:
AH> The error messages I get are
AH> ###
AH> If you would like more help, type "svcutil /?"
AH> Error: Cannot obtain Metadata from
http://localhost:8081/Search
AH> If this is a Windows (R) Communication Foundation service to which you
AH> have access, please check that you have enabled metadata publishing at
AH> the specified address. For help enabling metadata publishing, please
AH> refer to the MSDN documentation at
AH>
http://go.microsoft.com/fwlink/?LinkId=65455.
AH> WS-Metadata Exchange Error
AH> URI:
http://localhost:8081/Search
AH> Metadata contains a reference that cannot be resolved:
AH> 'http://localhost:8081/Search'.
AH> There was no endpoint listening at
http://localhost:8081/Search that
AH> could accept the message. This is often caused by an incorrect address
AH> or SOAP action. See InnerException, if present, for more details.
AH> The remote server returned an error: (404) Not Found.
AH> HTTP GET Error
AH> URI:
http://localhost:8081/Search
AH> There was an error downloading 'http://localhost:8081/Search'.
AH> The request failed with the error message:
AH> --
AH> <HTML><HEAD><STYLE type="text/css">#content{ FONT-SIZE: 0.7em;
AH> PADDING-BOTTOM: 2em; MARGIN-LEFT: 30px}BODY{MARGIN-TOP: 0px;
AH> MARGIN-LEFT: 0px; COLOR: #000000; FONT-FAMILY: Verdana;
AH> BACKGROUND-COLOR: white}P{MARGIN-TOP: 0px; MARGIN-BOTTOM: 12px; COLOR:
AH> #000000; FONT-FAMILY: Verdana}PRE{BORDER-RIGHT: #f0f0e0 1px solid;
AH> PADDING-RIGHT: 5px; BORDER-TOP: #f0f0e0 1px solid; MARGIN-TOP: -5px;
AH> PADDING-LEFT: 5px; FONT-SIZE: 1.2em; PADDING-BOTTOM: 5px; BORDER-LEFT:
AH> #f0f0e0 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: #f0f0e0 1px solid;
AH> FONT-FAMILY: Courier New; BACKGROUND-COLOR:
AH> #e5e5cc}.heading1{MARGIN-TOP: 0px; PADDING-LEFT: 15px; FONT-WEIGHT:
AH> normal; FONT-SIZE: 26px; MARGIN-BOTTOM: 0px; PADDING-BOTTOM: 3px;
AH> MARGIN-LEFT: -30px; WIDTH: 100%; COLOR: #ffffff; PADDING-TOP: 10px;
AH> FONT-FAMILY: Tahoma; BACKGROUND-COLOR: #003366}.intro{MARGIN-LEFT:
AH> -15px}</STYLE><TITLE>Service</TITLE></HEAD><BODY><DIV id="content"><P
AH> class="heading1">Service</P><BR/><P class="intro">The server was unable
AH> to process the request due to an internal error. For more information
AH> about the error, either turn on IncludeExceptionDetailInFaults (either
AH> from ServiceBehaviorAttribute or from the <serviceDebug> configuration
AH> behavior) on the server in order to send the exception information back
AH> to the client, or turn on tracing as per the Microsoft .NET Framework
AH> 3.0 SDK documentation and inspect the server trace
AH> logs.</P></DIV></BODY></HTML>
AH> --.
AH> ###
AH> This only happens as soon as I try to include the property that returns
AH> a Passengers object (Renamed from PassengerList). Below is the object
AH> graph that is exposed in my ServiceContract. SearchPararametersBase is
AH> the type thats is the service contract. If I replace the Passengers
AH> property (on the SearchParametersBase class) with a string property,
AH> then the client application
AH> has no problem to add the Service Reference.
AH> <DataContract()> _
AH> Public Class SearchParametersBase
AH> #Region "Passengers"
AH> <DebuggerBrowsable(DebuggerBrowsableState.Never)> _
AH> Protected mPassengers As Passengers = New Passengers()
AH> Public Property Passengers() As Passengers
AH> <DebuggerStepThrough()> _
AH> Get
AH> Return Me.mPassengers
AH> End Get
AH> <DebuggerStepThrough()> _
AH> Set(ByVal value As Passengers)
AH> If (value Is Nothing) Then
AH> Throw New ArgumentNullException("Passengers",
AH> "Passengers cannot be null.")
AH> End If
AH> Me.mPassengers = value
AH> End Set
AH> End Property
AH> #End Region
AH> End Class
AH> <CollectionDataContract(), KnownType("GetKnownType")> _
AH> Public Class Passengers
AH> Inherits List(Of Passenger)
AH> #Region "GetKnownType"
AH> Private Function GetKnownType() As Type()
AH> Return New Type() {GetType(Passenger)}
AH> End Function
AH> #End Region
AH> End Class
AH> <DataContract()> _
AH> Public Class Passenger
AH> #Region "Age"
AH> <DebuggerBrowsable(DebuggerBrowsableState.Never)> _
AH> Protected mAge As Integer = 0
AH> <DataMember()> _
AH> Public Property Age() As Integer
AH> <DebuggerStepThrough()> _
AH> Get
AH> Return Me.mAge
AH> End Get
AH> <DebuggerStepThrough()> _
AH> Set(ByVal value As Integer)
AH> If ((value < 0) OrElse (value > 99)) Then
AH> Throw New ArgumentOutOfRangeException("Age", value, "Age cannot be
AH> less than zero or larger than 99.")
AH> End If
AH> Me.mAge = value
AH> End Set
AH> End Property
AH> #End Region
AH> End Class
AH> "Vadym Stetsyak" <vadym_s@ukr.net> skrev i meddelandet
AH> news:eDeiKIHIHHA.1248@TK2MSFTNGP02.phx.gbl...
??>> Hello, Andreas!
??>>
??>> what error do you get?
??>>
??>> Have a look at (
??>>
http://msdn2.microsoft.com/en-us/library/ms730167.aspx ) to known more
??>> about how to handle inheritance in data contracts You wrote on Thu,
??>> 14 Dec 2006 13:55:13 +0100:
AH>>> Im trying out WCF for the first time and have hit a small snag. In my
AH>>> project I have a class called Passenger which simplified look like
??>> this
??>>
AH>>> <DataContract> _
AH>>> Public Class Passenger
??>>
AH>>> <DebuggerBrowsable(DebuggerBrowsableState.Never)> _
AH>>> Protected mAge As Integer = 0
??>>
AH>>> <DataMember()> _
AH>>> Public Property Age() As Integer
AH>>> <DebuggerStepThrough()> _
AH>>> Get
AH>>> Return Me.mAge
AH>>> End Get
AH>>> <DebuggerStepThrough()> _
AH>>> Set(ByVal value As Integer)
AH>>> Me.mAge = value
AH>>> End Set
AH>>> End Property
??>>
AH>>> End Class
??>>
AH>>> I then have a strong type collection of Passengers with an additional
AH>>> method
??>>
AH>>> <DataContract()> _
AH>>> Public Class PassengerList
AH>>> Inherits List(Of Passenger)
??>>
AH>>> Public Function FooBar() As Boolean
AH>>> ' Some code that doesn't matter
AH>>> End Function
??>>
AH>>> End Class
??>>
AH>>> The PassengerList object is then exposed through my service contract.
AH>>> When I try to add a Service Reference in my client project I get an
AH>>> error. Now I assume
AH>>> this has to do that since the members of List(Of T) which I inherit
??>> do
AH>>> not have the DataMember attribute added to its members (like the
AH>>> items). How is this kind of
AH>>> stuff done in a "Correct WFC way" ?
??>>
AH>>> Thanks for your advice!
??>>
??>> With best regards, Vadym Stetsyak. E-mail:
vadym_s@ukr.net
??>>
With best regards, Vadym Stetsyak. E-mail:
vadym_s@ukr.net