I Have the following basicHttpBinding in my service config. When I consume this service any guids are serialised as strings. On closer inspection of the reference file i see that my classes and objects are being serialised with the system.xml.serialization not the datacontractserializer.
I have another service in the same project which shares the endpoint behaviours & configs and this service treats the guids as expected.
Any pointers greatly appreciated!
<service behaviorConfiguration="DefaultServiceBehaviour" name="ExtranetService.Repositories.Client.Submission.PSPSubmission.GoalRepository.GoalRepositoryService">
<endpoint address="basic"
behaviorConfiguration="basicBehaviorConfig"
binding="basicHttpBinding"
bindingConfiguration="basicBindingConfig"
name="basicEndpoint"
bindingName="basicBinding"
contract="ExtranetService.Repositories.Client.Submission.PSPSubmission.GoalRepository.GoalRepositoryService"
listenUriMode="Explicit" />
<host>
<baseAddresses>
<add baseAddress="https://blah.com/Repositories/client/submission/pspsubmission/GoalRepositoryService.svc"/>
</baseAddresses>
</host>
</service>
<basicHttpBinding>
<binding name="basicBindingConfig"
closeTimeout="00:05:00"
maxBufferPoolSize="2147483646" maxBufferSize="2147483646"
maxReceivedMessageSize="2147483646">
<readerQuotas maxDepth="32"
maxStringContentLength="2147483646"
maxArrayLength="2147483646" />
<security mode="Transport">
<message clientCredentialType="Certificate" />
</security>
</binding>
</basicHttpBinding>
<serviceBehaviors>
<behavior name="DefaultServiceBehaviour">
<serviceMetadata />
<serviceDebug />
<dataContractSerializer />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="basicBehaviorConfig">
<dataContractSerializer />
</behavior>
</endpointBehaviors>
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.0.30319.34234"), _
System.SerializableAttribute(), _
System.Diagnostics.DebuggerStepThroughAttribute(), _
System.ComponentModel.DesignerCategoryAttribute("code"), _
System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://schemas.datacontract.org/2004/07/ExtranetService.Repositories.Client.Submission.PSPSubmission.GoalRepository")> _
Partial Public Class GetGoalByIdRequestObject
Inherits Object
Implements System.ComponentModel.INotifyPropertyChanged
Private idField As String
<System.Xml.Serialization.XmlElementAttribute(Order:=0)> _
Public Property Id() As String
Get
Return Me.idField
End Get
Set
Me.idField = value
Me.RaisePropertyChanged("Id")
End Set
End Property
Public Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
Protected Sub RaisePropertyChanged(ByVal propertyName As String)
Dim propertyChanged As System.ComponentModel.PropertyChangedEventHandler = Me.PropertyChangedEvent
If (Not (propertyChanged) Is Nothing) Then
propertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs(propertyName))
End If
End Sub
End Class
Edit
This is code from another service in the same project showing the guids as expected
<System.Diagnostics.DebuggerStepThroughAttribute(), _
System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0"), _
System.Runtime.Serialization.DataContractAttribute(Name:="GetClientRecommendationListRequestObject", [Namespace]:="http://schemas.datacontract.org/2004/07/ExtranetService.Repositories.Client.Submi"& _
"ssion.PSPSubmission"), _
System.SerializableAttribute()> _
Partial Public Class GetClientRecommendationListRequestObject
Inherits Object
Implements System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged
<System.NonSerializedAttribute()> _
Private extensionDataField As System.Runtime.Serialization.ExtensionDataObject
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private CLNT_CLIENT_IDField As System.Guid
<Global.System.ComponentModel.BrowsableAttribute(false)> _
Public Property ExtensionData() As System.Runtime.Serialization.ExtensionDataObject Implements System.Runtime.Serialization.IExtensibleDataObject.ExtensionData
Get
Return Me.extensionDataField
End Get
Set
Me.extensionDataField = value
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property CLNT_CLIENT_ID() As System.Guid
Get
Return Me.CLNT_CLIENT_IDField
End Get
Set
If (Me.CLNT_CLIENT_IDField.Equals(value) <> true) Then
Me.CLNT_CLIENT_IDField = value
Me.RaisePropertyChanged("CLNT_CLIENT_ID")
End If
End Set
End Property
Public Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
Protected Sub RaisePropertyChanged(ByVal propertyName As String)
Dim propertyChanged As System.ComponentModel.PropertyChangedEventHandler = Me.PropertyChangedEvent
If (Not (propertyChanged) Is Nothing) Then
propertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs(propertyName))
End If
End Sub
End Class