Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

uhs61074

macrumors newbie
Original poster
Feb 22, 2008
6
0
Hello

1)Is it possible to use web service created in C# (.net 2.0) to use on MAC machine using apple script or any other language.?

2) Is it possible to write something similar to window service on MAC ?

3) Does Applescript parse the xml file ?

4) what are the systme variable in MAC

5) How to edit registry if MAC has something similar to Registry in Window OS?



Thanks in Advance.
regards
 

Cromulent

macrumors 604
Oct 2, 2006
6,810
1,100
The Land of Hope and Glory
Hello

1)Is it possible to use web service created in C# (.net 2.0) to use on MAC machine using apple script or any other language.?

2) Is it possible to write something similar to window service on MAC ?

3) Does Applescript parse the xml file ?

4) what are the systme variable in MAC

5) How to edit registry if MAC has something similar to Registry in Window OS?



Thanks in Advance.
regards

1. What is this C# web service?

2. No idea what it is you are talking about. If you could provide some more information it would be helpful.

3. I believe you can use Applescript to parse XML. Not entirely sure. If not there is a Cocoa framework for this I think, or you can always use Python which is nice and easy.

4. The what variable?

5. No registry on Macs. Nothing even remotely similar to it either (thank God).
 

uhs61074

macrumors newbie
Original poster
Feb 22, 2008
6
0
[uhs61074]: Thanks for reply.

1. What is this C# web service?

[uhs61074]:A web service allows a site to expose programmatic functionality via the Internet. Web services can accept messages and optionally return replies to those messages. communication can be done by XML.(i.e i can deply logic of calulater on one server (IIS server -Microsoft prodcut) - one can call that program by providing URL and attach parameter to that) and you will get the result in xml - to ur browser.)
http://www.c-sharpcorner.com/Upload...52005045531AM/IntroductionToWebServicesT.aspx



2. No idea what it is you are talking about. If you could provide some more information it would be helpful.

[uhs61074]: It is a program that runs without any ineteraction of user like running in background -it can be configured that this program start when computer start or user can manually start stop and resume. This kind of programing is usefull when we want to do excute logic on specific time interval up to user logs off. (i.e keep checking speific folder if some files are added or removed OR on specific interval download some files from server - same way like dispalying current date time on bottom system status bar of machine.

3. I believe you can use Applescript to parse XML. Not entirely sure. If not there is a Cocoa framework for this I think, or you can always use Python which is nice and easy.
[uhs61074]: I am new to MAC. I am not sure which language is powerfull to do programin on MAC OS

4. The what variable?
[uhs61074]: In Windows operating system - There are some default system folder where programs are installed and where user profile is stored.
You can visit this site: http://www.wilsonmar.com/1envvars.htm

5. No registry on Macs. Nothing even remotely similar to it either (thank God).
 

Cromulent

macrumors 604
Oct 2, 2006
6,810
1,100
The Land of Hope and Glory
[uhs61074]: Thanks for reply.

1. I'm well aware of what a web service is in general. I'm just wondering what the C# web service is that you are talking about. You make it sound like something specific, is it based around the same technology as ASP.NET?

2. Yes. It is called a daemon in the Unix world.

3. Any of them. C / C++ / Objective-C / Python / Ruby / Applescript / Java etc etc.

4. The same as pretty much any Unix system. They are pretty easy to look up if you do a search for Mac OS X Environment Variables.
 

kuwisdelu

macrumors 65816
Jan 13, 2008
1,323
2
1)Is it possible to use web service created in C# (.net 2.0) to use on MAC machine using apple script or any other language.?

C# is a Microsoft language. It won't work on a Mac.

2) Is it possible to write something similar to window service on MAC ?

From your description, yes you can write something like that for a Mac, but not in C#. And it won't be able to automatically run once a user logs in unless the user gives it permission to always run on startup in System Preferences.

3) Does Applescript parse the xml file ?

I don't know...it may be able too. But Applescript isn't meant to be a real programming language. It's a simple automation language for users to tell their computer how to do some kind of repetitive task that they don't feel like doing or otherwise automate their computing experience.

4) what are the systme variable in MAC

From your description, I think you just need to look up at how Unix works. System and cross-user applications are just stored up in the /Applications directory, and user information and files are stored in the /Users/username directory.

5) How to edit registry if MAC has something similar to Registry in Window OS?

Again, no such thing as a registry on a Mac, thank god.

If you want to program exclusively and at best for a Mac, look into Objective-C and the Cocoa framework. That's what most OS X applications are written in. If you're very used to C#, you can use C or C++ instead, as those will work if compiled for Mac. You're best bet if you really want to be cross-platform with the least trouble is Java.
 

kuwisdelu

macrumors 65816
Jan 13, 2008
1,323
2
Not quite true. Mono is an open source clone of the .NET frameworks and includes a C# compiler and works quite well on Mac OS X by all accounts.

Hmm, I am wrong, then. I didn't think any such frameworks were available for OS X. Well, won't work as well or without as much trouble on a Mac. :rolleyes:

(I'm not the biggest of fan of C# anyway.)
 

uhs61074

macrumors newbie
Original poster
Feb 22, 2008
6
0
Hmm, I am wrong, then. I didn't think any such frameworks were available for OS X. Well, won't work as well or without as much trouble on a Mac. :rolleyes:

(I'm not the biggest of fan of C# anyway.)

Thanks for reply.so overall based on all reply - we cant use webservice made in .net - Or need to convert in Java and then use Java web service from MAC client ?

i have some query at
https://forums.macrumors.com/showthread.php?p=5031696#post5031696

any of you have some information it will be great.
I am new to MAC - i have devloped one app in Windows and now same need to do in MAC - so checking how possible it is.

regards
 
Thanks for reply.so overall based on all reply - we cant use webservice made in .net - Or need to convert in Java and then use Java web service from MAC client ?

Just to clear this up because it isn't clear from your post - I can't tell if you are running the server or writing the client (or both). "Use" a web service, to me, suggests you are the client, as does your thread title. "Run" a web service suggests you are running a server.

Your server needs to run Windows if you have written the server code in .NET. If you want to run the web service server on a Mac, you will need to rewrite it (ignoring Mono for simplicity).

Your client needs to be developed using something other than .NET, such as Java, to run on your Mac. A Mac client can use a remote web service built using .NET.
 

Krevnik

macrumors 601
Sep 8, 2003
4,101
1,312
Your client needs to be developed using something other than .NET, such as Java, to run on your Mac. A Mac client can use a remote web service built using .NET.

As some more information, .NET web services use the SOAP standard. Apple provides some documentation on how to use SOAP web services as a client.
 

numero

macrumors regular
Jul 23, 2002
106
3
OR
1)Is it possible to use web service created in C# (.net 2.0) to use on MAC machine using apple script or any other language.?

2) Is it possible to write something similar to window service on MAC ?

3) Does Applescript parse the xml file ?

4) what are the systme variable in MAC

5) How to edit registry if MAC has something similar to Registry in Window OS?


1) As a previous poster said, both are possible it will just depend on if you are talking about the client side or server side as to how much work it will be.

2) Look up launchd. The short version is that you get your application written and then you create an XML file that gives the path to the executable and some other info like how often to run it (for something that would be scheduled) or whether to restart it if it should crash, in a particular place that the OS scans at startup (or login) and then you have a "service".

3) Don't know on this one. Sure it can parse text if you want to do all of the work yourself, but I don't know if it has an scripting additions that would make it easy. You shouldn't limit yourself to AppleScript. If there is a tool that is built for this then use that instead. Might be easier to whip up a Cocoa app.

4) You probably are looking for Unix environment variables here. Type "echo $PATH" at the command line. If you have Tomcat installed you probably have a $JAVA_HOME defined.

5) No Registry. Sorry. Well, not really sorry. :)
 

satyam90

macrumors regular
Jul 30, 2007
242
0
Bangalore, India
If you are using soap protocol for your webservices, you basically need to write "gsoap" functionality to access your webservice. You can't write "soap" functionality directly.
There is a open source product "iFolder"(visit http://www.ifolder.com). It is similar to what you might be expecting. It has a UI, and back end will be gsoap service that will contact server webservice and so on......
 

uhs61074

macrumors newbie
Original poster
Feb 22, 2008
6
0
1) As a previous poster said, both are possible it will just depend on if you are talking about the client side or server side as to how much work it will be.

2) Look up launchd. The short version is that you get your application written and then you create an XML file that gives the path to the executable and some other info like how often to run it (for something that would be scheduled) or whether to restart it if it should crash, in a particular place that the OS scans at startup (or login) and then you have a "service".

3) Don't know on this one. Sure it can parse text if you want to do all of the work yourself, but I don't know if it has an scripting additions that would make it easy. You shouldn't limit yourself to AppleScript. If there is a tool that is built for this then use that instead. Might be easier to whip up a Cocoa app.

4) You probably are looking for Unix environment variables here. Type "echo $PATH" at the command line. If you have Tomcat installed you probably have a $JAVA_HOME defined.

5) No Registry. Sorry. Well, not really sorry. :)


Thanks to all for reply.

well i am talking about consuming the web service which is made in .net and deplyed on Window Server.
MAC machine will be client for that web service.


So overall it seems multiple languages need to be used to create one app on MAC. And again it is too hard or still there will be some limitations.
 

dernhelm

macrumors 68000
May 20, 2002
1,649
137
middle earth
Thanks to all for reply.

well i am talking about consuming the web service which is made in .net and deplyed on Window Server.
MAC machine will be client for that web service.


So overall it seems multiple languages need to be used to create one app on MAC. And again it is too hard or still there will be some limitations.

I'm not sure you understand correctly even now. With Web Services, the client can be a separate physical computer than the server, possibly even running a different OS - and the server need not ever know.

You can use ANY programming language on your make that is capable of using the OS/X system (POSIX, whatever) libraries to open up a TCP/IP connection and making SOAP style calls over HTTP.

There is nothing magic or hard going on here. On the Mac, you can use perl, ruby, Objective-C, Java, Mono (.net), Javascript, or just about anything else you can get a compiler for. Simply take the WSDL from the windows machine (which is an XML file) and make correctly formed HTTP requests to the web service on the windows computer.

You can pick ONE language you like, and use only it - there is no need for "multiple" languages.
 

Krevnik

macrumors 601
Sep 8, 2003
4,101
1,312
You can pick ONE language you like, and use only it - there is no need for "multiple" languages.

Well, plus there is an upshot to using Obj-C in this case... Apple has documentation for calling SOAP services from Obj-C, and how to do so pretty easily.

EDIT: Posting some links to information and samples on how to use WebServicesCore.framework on OS X 10.2 and later to access Soap in C and Obj-C apps.

Web Services Core Programming Guide

Sample/Tutorial for using Core Foundation and Web Services Core to access a SOAP server
 

Monkaaay

macrumors 6502
Jun 19, 2006
258
0
Richmond, VA
There is a lot of incorrect knowledge transfer going on in this thread. If you see the poster asking about C# web services and you don't fully understand what those are, offering your "knowledge" is probably a bad idea.

If there is a web service running on a remote server, whether it be written in .NET or Java, you can use it from a Mac client regardless of whether you use Objective-C, C++, or Java (among others). As long as your programming language can send a HTTP request and interpret an XML response, you'll be able to interact with .NET and Java web services.
 

sadilak

macrumors member
Feb 27, 2008
62
0
NY
Yes you can, what you could always do is to return a typed dataset or
a regular dataset. For Non microsoft consumers, the data will be interpreted as an XML string . It is upto you to parse and get the info needed.
 

Krevnik

macrumors 601
Sep 8, 2003
4,101
1,312
Another option, PHP + NUSOAP. Not saying it's the best solution but it does work well on the Mac.

b e n

Not as a client, really. If you wanted to run the server on a Mac it would be a pretty good and inexpensive one.
 

lazydog

macrumors 6502a
Sep 3, 2005
709
6
Cramlington, UK
Not as a client, really. If you wanted to run the server on a Mac it would be a pretty good and inexpensive one.

I guess if you're writing an app with a UI then, yes, Php wouldn't be ideal. But for a client tool running from the command line, cronjob or whatever, then it's a pretty good combination. Perhaps not the best, but still worth considering. I can say this because I've just finished a project using PHP/NUSOAP and Microsoft's AdCenter web services. To be honest PHP wouldn't have been my first choice but I had no choice in the matter. And as it turned out it wasn't too bad an experience!

b e n
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.