Page 1 of 1

Error in WCF reference call when run in browser

Posted: Mon Mar 14, 2016 5:07 am
by hamej
Please see attached file. I have a call to a WCF service, which works fine, when run in debug mode, but fails when run in browser.

Can you give me a hint where to look?

hamej

Re: Error in WCF reference call when run in browser

Posted: Tue Mar 15, 2016 10:39 am
by JS-Support @Userware
Thanks. We are going to look into it as soon as possible. We plan to greatly improve WCF support in the coming months.

Regards,
JS-Support

Re: Error in WCF reference call when run in browser

Posted: Mon Jun 27, 2016 7:23 am
by Sesztak
We had the same problem, and not related to 'dynamic' keyword:

background info:
we have a cshtml5 webpage:
http://188.142.254.194:14460/
we have a very basic test WCF service:
http://188.142.254.194:14460/wcf/Service1.svc

(both hosted under IIS, tested and worked perfectly)

When we try to call WCF service from cshtml5 webpage code, we have got the following exception:

JSIL.Core.js?20166271622:10477 Uncaught Error: Type 'System.Runtime.CompilerServices.CallSite`1' has not been defined.

just for your kind information the related client code:

ServiceReference1.Service1Client _soapClient =
new ServiceReference1.Service1Client(
new System.ServiceModel.BasicHttpBinding(),
new System.ServiceModel.EndpointAddress(
new Uri("http://188.142.254.194:14460/wcf/Service1.svc")));


TextBlock2.Text= _soapClient.GetData(7);

We use CSHTML5 8.2 beta.

Any idea, any help?
Thanks for your kind help in advance,
best regards,
Péter

Re: Error in WCF reference call when run in browser

Posted: Mon Jun 27, 2016 11:55 pm
by JS-Support @Userware
Hi,

We saw this error in the past on VS 2015 only (not on VS 2012/2013). It was supposed to be have been fixed, but apparently we need to look again into it. Can you please send us (either as an attachment to this topic, or to support@cshtml5.com) the file "Reference.cs" that is located in the "Service Reference" subfolder of your project folder?

Thank you.
Regards,
JS-Support

Re: Error in WCF reference call when run in browser

Posted: Tue Jun 28, 2016 3:23 am
by Sesztak
sent to both places:

for your kind help.

enviroment:
Microsoft Visual Studio Enterprise 2015
Version 14.0.25123.00 Update 2
Microsoft .NET Framework
Version 4.6.01038

thanks for your kind reply,
Péter

Re: Error in WCF reference call when run in browser

Posted: Tue Jun 28, 2016 3:35 am
by Sesztak
One more background info -maybe it's should help to you:
from IIS point of view:
we use the following configuration:
-CSHTML5 app : a normal web page
-WCF service: hosted under the virtual directory of above - mentioned (to eliminate CORS related problem: we use same IP address + same port number, only the virtual sub path is different : /wcf)

Best Regards,
Péter

Re: Error in WCF reference call when run in browser

Posted: Tue Jun 28, 2016 3:42 am
by JS-Support @Userware
Received it. Thanks. We are going to look into it.

Re: Error in WCF reference call when run in browser

Posted: Wed Jun 29, 2016 5:25 am
by Sesztak
Any progress ?
(unfortunately, we do not have VS2012/13 to try, only VS2015)

Are you able to reproduce the issue ?

If you need more info (sources, test enviroment, etc.), just mention: our development is blocked actually because of above-mentioned problem/exception.

br,
Péter

Re: Error in WCF reference call when run in browser

Posted: Wed Jun 29, 2016 7:46 am
by Sesztak
I asked a favour from one of my friends to install CSHTML5 8.2 under VS2013 as you advised (not VS2015 !!), and rebuild the solution:

our test result when we try to call WCF from CSHTML client:
http://188.142.254.194:14470
http://188.142.254.194:14470/wcf/Service1.svc

"CSharpXamlForHtml5.js?20166291619:9166 Uncaught System.NotSupportedException: The following type is not supported in the current WCF implementation: System.String. Please report this issue to support@cshtml5.com"

hmm ?

br,
Péter

Re: Error in WCF reference call when run in browser

Posted: Wed Jun 29, 2016 9:34 am
by JS-Support @Userware
Hi Péter,

Yes, we have been able to successfully reproduce the issue with your "Reference.cs" file.

It appears that the "service reference" was created while the service did not have the "[XmlSerializerFormat]" attribute.

Can you please double-check that the service has this attribute and then re-create the service reference? You will find the instructions under the "Limitations" section of the following URL:
http://cshtml5.com/links/wcf-limitations-and-tutorials.aspx#soap-limitations

Thanks.
Regards,
JS-Support

Re: Error in WCF reference call when run in browser

Posted: Thu Jun 30, 2016 1:07 am
by Sesztak
You are great and right !:
the missing [XmlSerializerFormat] was the source of the exception.

thanks again,
br,
Péter

Re: Error in WCF reference call when run in browser

Posted: Thu Jun 30, 2016 8:03 am
by JS-Support @Userware
Great. Thanks for using CSHTML5.