Connect with WCF?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Connect with WCF?
Hi All,
I'm new to LivcCode and wanted to convert one of my iOS apps to Android using LiveCode.
My app talks to a web service published with WCF, can anyone tell me fi LiveCode is able to communicate with a WCF web service?
Thanks
Dean
I'm new to LivcCode and wanted to convert one of my iOS apps to Android using LiveCode.
My app talks to a web service published with WCF, can anyone tell me fi LiveCode is able to communicate with a WCF web service?
Thanks
Dean
Re: Connect with WCF?
Dean,
Only the documentation of the service can tell you. If you are the developer of the service software, then the answer is probably yes. How? You have to figure this out yourself, but you can probably use sockets and maybe you can even use a simpke put/get url command.
Kind regards,
Mark
Only the documentation of the service can tell you. If you are the developer of the service software, then the answer is probably yes. How? You have to figure this out yourself, but you can probably use sockets and maybe you can even use a simpke put/get url command.
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Connect with WCF?
Dean-
Web services are typically xml over http post or get connections. There's no problem doing that with LiveCode on any platform.
Web services are typically xml over http post or get connections. There's no problem doing that with LiveCode on any platform.
Re: Connect with WCF?
Hi dharry,
did you manage to use LC with WCF at the end?
Regards,
Raf
did you manage to use LC with WCF at the end?
Regards,
Raf
Re: Connect with WCF?
I finally looked at WCF. Sheesh - trust Microsoft to make anything complicated. But the heart of it is that WCF allows you to publish either SOAP or RESTful web services. And either of these are easy to consume from the client end with LiveCode. A proper wsdl document is essential for figuring out what needs to be done.
-
- Posts: 9
- Joined: Fri Apr 13, 2012 8:44 pm
Re: Connect with WCF?
Hi mwieder,
I'm curious how the problem was fixed because I have a similar one: I have to access from Livecode a .NET Soap web service ( it is not WCF ) that exposes several methods returning lists of data, single values, etc, all XML. Also some methods accept arguments. I have the WSDL definition file available.
I can connect and access the methods but I always receive back the web service definition, instead of the data. I tried a lot of different sintax with the put URL command and the POST command, with no success, always getting the XML definition of the service with the names of all methods.
Obvious statements like
put the URL"http://webservice_URL/n_ezgwebservice.asmx?op=GetMatchInfo" into tPreferencesFile
put the URL"http://webservice_URL/n_ezgwebservice.asmx?f=GetMatchInfo" into tPreferencesFile
put the URL"http://webservice_URL/n_ezgwebservice.asmx?f=GetMatchList&club=2098" into tPreferencesFile
POST "GetMatchInfo" to URL"http://webservice_URL/n_ezgwebservice.asmx"
put it into myWebResult
return the service definition, not the data associated.
I already wrote small apps in Power Builder and CSharp to access the service and the data returned is OK. The problem, I guess, is the sintax of the commands I'm using within Livecode.
So do you have an example in Livecode to access the WCF web service?
Thanks,
Paulo
I'm curious how the problem was fixed because I have a similar one: I have to access from Livecode a .NET Soap web service ( it is not WCF ) that exposes several methods returning lists of data, single values, etc, all XML. Also some methods accept arguments. I have the WSDL definition file available.
I can connect and access the methods but I always receive back the web service definition, instead of the data. I tried a lot of different sintax with the put URL command and the POST command, with no success, always getting the XML definition of the service with the names of all methods.
Obvious statements like
put the URL"http://webservice_URL/n_ezgwebservice.asmx?op=GetMatchInfo" into tPreferencesFile
put the URL"http://webservice_URL/n_ezgwebservice.asmx?f=GetMatchInfo" into tPreferencesFile
put the URL"http://webservice_URL/n_ezgwebservice.asmx?f=GetMatchList&club=2098" into tPreferencesFile
POST "GetMatchInfo" to URL"http://webservice_URL/n_ezgwebservice.asmx"
put it into myWebResult
return the service definition, not the data associated.
I already wrote small apps in Power Builder and CSharp to access the service and the data returned is OK. The problem, I guess, is the sintax of the commands I'm using within Livecode.
So do you have an example in Livecode to access the WCF web service?
Thanks,
Paulo
Re: Connect with WCF?
Hi Paulo,
if you can display the correct infomation from url in a browser then you can:
put url "your_url" into tVar
using the same url.
Simon
if you can display the correct infomation from url in a browser then you can:
put url "your_url" into tVar
using the same url.
drop the "the".put the URL"http://webservice_URL/n_ezgwebservice.asmx?op=GetMatchInfo" into tPreferencesFile
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 9
- Joined: Fri Apr 13, 2012 8:44 pm
Re: Connect with WCF?
Hi Simon,
Thank you for your reply.
Unfortunately the command removing the "the" as below
put URL"http://webservice_URL/n_ezgwebservice.asmx?op=GetMatchInfo" into tPreferencesFile
and all variations change "op" by "f", "function", "run" and etc did not work: I keep receiving copy of the WSDL service definition instead of the data.
To discard errors in the external web service (it could be returning JSON instead of XML, I don't know... ) I proceed as follows:
1. I created a web service in Visual Basic, NOT WCF, to return always a string: no input arguments, no output lists, just the same string always returned. The service I named it ezg_ws_test.
ezg_ws_test service has NO methods to expose, just always return a string.
I tested it using the Visual Studio generated testPage.html and IIS opened it: it returns the string OK, so the service is OK.
2. Now I wrote a Client in Power Builder, Visual Basic and CSharp to access the service in my local equipment. From the WSDL file I got the address "http://localhost/wwwroot/webservice/ezg_ws_test.asmx".
I ran all three (03) applications to display the returned value and the string is returned properly.
3. In LIVECODE I use the commands
put URL"http://localhost/wwwroot/webservice/ezg_ws_test.asmx" into tPreferencesFile or
put URL"http://localhost/wwwroot/webservice/ezg_ws_test.asmx" into tPreferencesFile?
receiving AGAIN the WSDL contents instead of the string returned.
I'm starting to believe that LiveCode cannot access web services via SOAP protocol, maybe only HTML sites that return only one type of data, like the Amazon web service...
Any clue will be highly appreciated !
Best,
Paulo
Thank you for your reply.
Unfortunately the command removing the "the" as below
put URL"http://webservice_URL/n_ezgwebservice.asmx?op=GetMatchInfo" into tPreferencesFile
and all variations change "op" by "f", "function", "run" and etc did not work: I keep receiving copy of the WSDL service definition instead of the data.
To discard errors in the external web service (it could be returning JSON instead of XML, I don't know... ) I proceed as follows:
1. I created a web service in Visual Basic, NOT WCF, to return always a string: no input arguments, no output lists, just the same string always returned. The service I named it ezg_ws_test.
ezg_ws_test service has NO methods to expose, just always return a string.
I tested it using the Visual Studio generated testPage.html and IIS opened it: it returns the string OK, so the service is OK.
2. Now I wrote a Client in Power Builder, Visual Basic and CSharp to access the service in my local equipment. From the WSDL file I got the address "http://localhost/wwwroot/webservice/ezg_ws_test.asmx".
I ran all three (03) applications to display the returned value and the string is returned properly.
3. In LIVECODE I use the commands
put URL"http://localhost/wwwroot/webservice/ezg_ws_test.asmx" into tPreferencesFile or
put URL"http://localhost/wwwroot/webservice/ezg_ws_test.asmx" into tPreferencesFile?
receiving AGAIN the WSDL contents instead of the string returned.
I'm starting to believe that LiveCode cannot access web services via SOAP protocol, maybe only HTML sites that return only one type of data, like the Amazon web service...

Any clue will be highly appreciated !
Best,
Paulo
Re: Connect with WCF?
Hi Paulo,
Does the server expect a specific HTTP header to know that it is expected to use the SOAP protocol?
Kind regards,
Mark
Does the server expect a specific HTTP header to know that it is expected to use the SOAP protocol?
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 9
- Joined: Fri Apr 13, 2012 8:44 pm
Re: Connect with WCF?
Hi Mark,
Thank you for the reply.
It is possible that the server expects a HTTP header to identify that is a SOAP protocol, but I don't know.
In a try clarify if the external ws has a problem, I developed a test web_service similar to the one I have to access. I wrote it with Visual Studio 2010 Ultimate and there is only one method that returns always a string, no arguments to be passed. However, VSudio generated a WSDL for me. It is NOT a WCF web service.
Looking the WSDL file will I be able to find if it needs a HTTP header?
I dont know much about the web service internals neither about the SOAP protocol. The tests were done in my local equipment and below are the lines of code extracted from the WSDL file:
<?xml version="1.0" encoding="utf-8" ?>
- <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempurl.org" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://tempurl.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
- <wsdl:types>
- <s:element name="of_get_single_value">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="ai_number" type="s:short" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="of_get_single_valueResponse">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="of_get_single_valueResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="of_get_time_now">
<s:complexType />
</s:element>
- <s:element name="of_get_time_nowResponse">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="of_get_time_nowResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
As you can see there are two (02) methods that I created in order to test the service from a Client VB, Power Builder and Livecode. All worked fine, but Livecode.
Can you tell if it needs a header saying that is SOAP? If yes, how can I generate the header?
Thank you in advance for the help.
Paulo
Can you read the
Thank you for the reply.
It is possible that the server expects a HTTP header to identify that is a SOAP protocol, but I don't know.
In a try clarify if the external ws has a problem, I developed a test web_service similar to the one I have to access. I wrote it with Visual Studio 2010 Ultimate and there is only one method that returns always a string, no arguments to be passed. However, VSudio generated a WSDL for me. It is NOT a WCF web service.
Looking the WSDL file will I be able to find if it needs a HTTP header?
I dont know much about the web service internals neither about the SOAP protocol. The tests were done in my local equipment and below are the lines of code extracted from the WSDL file:
<?xml version="1.0" encoding="utf-8" ?>
- <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempurl.org" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://tempurl.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
- <wsdl:types>
- <s:element name="of_get_single_value">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="ai_number" type="s:short" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="of_get_single_valueResponse">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="of_get_single_valueResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
- <s:element name="of_get_time_now">
<s:complexType />
</s:element>
- <s:element name="of_get_time_nowResponse">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="of_get_time_nowResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
As you can see there are two (02) methods that I created in order to test the service from a Client VB, Power Builder and Livecode. All worked fine, but Livecode.
Can you tell if it needs a header saying that is SOAP? If yes, how can I generate the header?
Thank you in advance for the help.
Paulo
Can you read the