Error in WCF reference call when run in browser

Please report bugs here. If you are unsure whether something is a bug or an expected behavior, please post it on the "Technical Support" forum instead, and wait for a moderator to handle/move the post.
hamej
Posts: 37
Joined: Thu Oct 01, 2015 8:41 am

Error in WCF reference call when run in browser

Postby hamej » Mon Mar 14, 2016 5:07 am

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
Attachments
2016-03-14 Error in WCF service reference call.zip
(14.45 KiB) Downloaded 386 times

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: Error in WCF reference call when run in browser

Postby JS-Support @Userware » Tue Mar 15, 2016 10:39 am

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

Sesztak
Posts: 172
Joined: Fri Jun 24, 2016 2:19 am

Re: Error in WCF reference call when run in browser

Postby Sesztak » Mon Jun 27, 2016 7:23 am

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

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: Error in WCF reference call when run in browser

Postby JS-Support @Userware » Mon Jun 27, 2016 11:55 pm

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

Sesztak
Posts: 172
Joined: Fri Jun 24, 2016 2:19 am

Re: Error in WCF reference call when run in browser

Postby Sesztak » Tue Jun 28, 2016 3:23 am

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
Attachments
Reference.7z
(1.31 KiB) Downloaded 425 times

Sesztak
Posts: 172
Joined: Fri Jun 24, 2016 2:19 am

Re: Error in WCF reference call when run in browser

Postby Sesztak » Tue Jun 28, 2016 3:35 am

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

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: Error in WCF reference call when run in browser

Postby JS-Support @Userware » Tue Jun 28, 2016 3:42 am

Received it. Thanks. We are going to look into it.

Sesztak
Posts: 172
Joined: Fri Jun 24, 2016 2:19 am

Re: Error in WCF reference call when run in browser

Postby Sesztak » Wed Jun 29, 2016 5:25 am

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

Sesztak
Posts: 172
Joined: Fri Jun 24, 2016 2:19 am

Re: Error in WCF reference call when run in browser

Postby Sesztak » Wed Jun 29, 2016 7:46 am

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

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: Error in WCF reference call when run in browser

Postby JS-Support @Userware » Wed Jun 29, 2016 9:34 am

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

Sesztak
Posts: 172
Joined: Fri Jun 24, 2016 2:19 am

Re: Error in WCF reference call when run in browser

Postby Sesztak » Thu Jun 30, 2016 1:07 am

You are great and right !:
the missing [XmlSerializerFormat] was the source of the exception.

thanks again,
br,
Péter

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: Error in WCF reference call when run in browser

Postby JS-Support @Userware » Thu Jun 30, 2016 8:03 am

Great. Thanks for using CSHTML5.


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 28 guests

 

 

cron