[Mono-list] Problem with mono WCF (compatibility with .NET ??)
Atsushi Eno
atsushieno at veritas-vos-liberabit.com
Tue Apr 27 20:04:30 EDT 2010
Hello,
Well, can you please file a bug on bugzilla with the actual *runnable*
code? I don't think asking often for missing parts of code (for example,
Identity type) is very worth in this list.
Atsushi Eno
On 2010/04/27 18:32, Jspoon wrote:
> Hi, thank you for your answer.
>
>
>>> If there are not allowed characters in XML, then it will be raised. But
>>> there are couple of other chances that it's not receiving expected XMLs.
>>> For example, some people use BinaryMessageEncodingBindingElement with
>>> HttpTransportBindingElement, which might bring wrong (unexpected) binary
>>> format error.
>>> Can you post the actual code that reproduces your problem?
>>>
> There is my service model configuration. I use default basicHttpBinding
> <system.serviceModel>
>
> <behaviors>
> <serviceBehaviors>
> <behavior name="bAuthentication">
> <serviceMetadata httpGetEnabled="true" httpGetUrl="wsdl" />
> <serviceDebug includeExceptionDetailInFaults="true"/>
> </behavior>
> </serviceBehaviors>
> </behaviors>
>
> <services>
> <service behaviorConfiguration="bAuthentication"
>
> name="WASOLIC.ServiceLogic.AuthenticationService.Authentication">
> <endpoint address="" binding="basicHttpBinding"
>
> contract="WASOLIC.ServiceLogic.AuthenticationService.IAuthenticationService"/>
> </service>
> </services>
>
> </system.serviceModel>
>
> In my wcf operations I return this data contract (wrap data as Result and
> Error):
> [DataContract]
> public class ServiceReturnValueWrapper<T>
> {
> [DataMember]
> public ServiceData<T> Result { get; set; }
>
> [DataMember]
> public WasolicException Error { get; set; }
> }
>
> where ServiceData<T> is generic type (because I return from different
> function different result):
> [DataContract]
> public class ServiceData<T>
> {
> [DataMember]
> public T Data { get; set; }
> }
>
> If error occured, it is after call this function (error occured 3 times from
> 5):
> public ServiceReturnValueWrapper<SecurityToken> IssueNewSecurityToken()
> {
> return new ServiceReturnValueWrapper<SecurityToken>
> {
> Result = new ServiceData<SecurityToken>
> {
> Data = new SecurityToken
> {
> Identity = new Identity()
> {
> UserName = string.Empty,
> PasswordHash = string.Empty,
> PasswordSalt =
> Encoding.ASCII.GetString(Hash.GetSalt(5)),
> IsAuthenticated = false,
> Roles = new List<string>(),
> Profile = -1,
>
> DateCreated = DateTime.Now,
> DateLastUpdate = DateTime.Now
> }
> }
> },
>
> Error = null
> };
> }
> Security token contains Identity which contains data member above in code.
>
> I think that problem is with PasswordSalt in Identity. Because error
> occured sometimes (3 times from 5) because Salt is random generated -
> sometimes generated chars which is ok for wcf, but sometimes it is no ok.
> Generating salt is from this function:
>
> public static byte[] GetSalt(int _size)
> {
> byte[] saltBytes = new byte[_size];
>
> RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider();
>
> rng.GetNonZeroBytes(saltBytes);
>
> return saltBytes;
> }
>
>
>
>>> And it'd be a lot nicer if you try mono from trunk instead of old 2.6.3.
>>>
> How can I simply get trunk version for Windows? And how install it?
>
More information about the Mono-list
mailing list