Postby Sesztak » Sun Jul 10, 2016 2:21 am
Dear JS-Support,
(CSHTML5 v8.4 installed, WCF server rebuilded, client side service reference updated, client code rebuilded)
1.) WCF method call with extended-ASCII string content:
interface:
[OperationContract]
string TestNonBasicASCIIcontentExempliGratiaExtendedASCIIchars( string TestContent);
Server side implementation:
public string TestNonBasicASCIIcontentExempliGratiaExtendedASCIIchars(string TestContent)
{
// echo back :
return "server response: " + TestContent;
}
Client side call with extended-ASCII string content:
var response = _kliens.TestNonBasicASCIIcontentExempliGratiaExtendedASCIIchars("Péter Pál common Hungarian spec. chars: öüóőúéáűí ÖÜÓŐÚÉÁŰÍ");
Server side debug:
TestContent = "Péter Pál common Hungarian spec. chars: öüóőúéáűí ÖÜÓŐÚÉÁŰÍ"
Result: perfect / working as expected !
2., WCF method call with extended-ASCII characters in methode signature (e.g. parameter names, function name, type names !!!)
e.g.:
interface:
[OperationContract]
int TestNónBásicASCIIMethódeSignatőre(int TestNámber, int TestÖtherNámber);
Server side implementation:
public int TestNónBásicASCIIMethódeSignatőre(int TestNámber, int TestÖtherNámber)
{
return TestNámber + TestÖtherNámber;
}
Client side call:
var response = _kliens.TestNónBásicASCIIMethódeSignatőre(2, 3);
Client side Exception:
Error: Type 'System.Runtime.CompilerServices.CallSite`1' has not been defined.
second (3rd, 4th, etc) call from client side, exception again:
Error: A MSIL instruction of type invokecallsitetarget:int32(class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite, object, int32>::Invoke, arg_A6_0:class [mscorlib]System.Func`3<class [System.Core]System.Runtime.CompilerServices.CallSite, object, int32>, arg_A6_1:CallSite, invokecallsitetarget:object(class [mscorlib]System.Func`5<class [System.Core]System.Runtime.CompilerServices.CallSite, object, int32, int32, object>::Invoke, ldfld:class [mscorlib]System.Func`5<class [System.Core]System.Runtime.CompilerServices.CallSite, object, int32, int32, object>(class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`5<class [System.Core]System.Runtime.CompilerServices.CallSite, object, int32, int32, object>>::Target, ldsfld:class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`5<class [System.Core]System.Runtime.CompilerServices.CallSite, object, int32, int32, object>>('<>o__33'::<>p__0)), ldsfld:class [System.Core]System.Runtime.CompilerServices.CallSite`1<class [mscorlib]System.Func`5<class [System.Core]System.Runtime.CompilerServices.CallSite, object, int32, int32, object>>[exp:CallSite]('<>o__33'::<>p__0), callgetter:object(class [CSharpXamlForHtml5]System.ServiceModel.ClientBase`1<class KasszaWEB_Kliens.ServiceReference1.IServiceKassza>::get_Channel, ldloc:ServiceKasszaClient[exp:class [CSharpXamlForHtml5]System.ServiceModel.ClientBase`1<class KasszaWEB_Kliens.ServiceReference1.IServiceKassza>](this)), ldloc:int32(TestNámber), ldloc:int32(TestÖtherNámber))) could not be translated.
So, tosummarize:
-extended ascii string content: ok,
-methode signatures with extended ascii characters : client side exception.
One more info regarding extened ASCII chars in custom Types names, like: public class TéstClássWithExtendedASCIIchars
(see the 'é' and 'á' chars in type name !)
if we try to call such a methode (e.g. extended ascii chars in function parameter type name or in return type name):
[OperationContract]
TéstClássWithExtendedASCIIchars TestMetodWithCustomTypesWithExtenedASCIIcharsInName(TéstClássWithExtendedASCIIchars parameter);
We have got client exception:
"Error: Memoized value is undefined"
So, waiting for your kind reply,
Best Regards,
Péter
ps:
background info about extened ASCII chars in custom Types names:
class definition:
[Serializable()]
[DataContract(IsReference = true)]
public class TéstClássWithExtendedASCIIchars
{
[DataMember]
public int SomeTestProperty { get; set; }
}
interface:
[OperationContract]
TéstClássWithExtendedASCIIchars TestMetodWithCustomTypesWithExtenedASCIIcharsInName(TéstClássWithExtendedASCIIchars parameter);
server side implementation:
public TéstClássWithExtendedASCIIchars TestMetodWithCustomTypesWithExtenedASCIIcharsInName(TéstClássWithExtendedASCIIchars parameter)
{
return new TéstClássWithExtendedASCIIchars() { SomeTestProperty= parameter.SomeTestProperty + 1 };
}
client side call -where we have got exception:
var response = _kliens.TestMetodWithCustomTypesWithExtenedASCIIcharsInName(new TéstClássWithExtendedASCIIchars() { SomeTestProperty = 14 });
Important: everything works perfectly in simulator, problem only in real browser + real WCF server (IIS hosted).