none
WCF calls from a Mac

    Question

  • Hi there,

    I have written a WCF service that is being used by various application but now a colleage of mine needs to write an application for a Mac and needs to use the service from there.

    I understood that because WCF is based on SOAP that he should be able to consume the service. How would we be going about to do that?

    To keep it simple we are using BasicHttpBinding to be able to use SOAP 1.1, but we can't generate the client proxies - which is dead easy on the Windows box but not so easy on a Mac.

    Any help will do!

    Thursday, September 09, 2010 1:54 PM

Answers

All replies

  • wsdl2objc project is one way to generate proxies on Mac:

    http://code.google.com/p/wsdl2objc/

     

    also if the soap envelopes are very simple they may simply send them as is over http (without proxies).


    http://webservices20.blogspot.com/
    WCF Security, Interoperability And Performance Blog
    • Proposed as answer by Yaron Naveh Friday, September 10, 2010 11:35 AM
    • Marked as answer by Marais van Zyl Monday, September 13, 2010 7:58 AM
    Thursday, September 09, 2010 2:01 PM
  • Another alternative to the one that Yaron mentioned would be to use Silverlight to create the application (if possible), since the same SL app can be used both on PCs and on Macs. SL even supports out-of-browser applications (you'd browse to it once and then "install" it locally on the machine, so that you wouldn't need to open a browser to access it all the time). It isn't an option, however, if the application needs to do something that SL doesn't support, such as accessing the local disk.
    Thursday, September 09, 2010 4:09 PM
  • Yaron,

    Thanks for this! This tool is really helping. One question, can I use basicHttpBindings or must I make use of xml-rpc?

    Friday, September 10, 2010 11:39 AM
  • you have to use basicHttpBinding
    http://webservices20.blogspot.com/
    WCF Security, Interoperability And Performance Blog
    Friday, September 10, 2010 11:56 AM
  • Do you maybe have sample available. I know nothing about Mac and Mac development but my colleague can't get the stuff working.

    He gets a 415 invallid media type error.

    Friday, September 10, 2010 12:01 PM
  • Check out the wiki for wsdl2objc:

    http://code.google.com/p/wsdl2objc/wiki/UsageInstructions

    The comments to the page talk about this problem. Generally it means the service is expecting  soap11 but you send soap12.


    http://webservices20.blogspot.com/
    WCF Security, Interoperability And Performance Blog
    Friday, September 10, 2010 12:12 PM
  • you might need to add this:

    1. Add Content-Type to the HTTP Header

    <tt>[</tt>setObject:@"text/xml" forKey:@"Content-Type"<tt>]</tt>;


    http://webservices20.blogspot.com/
    WCF Security, Interoperability And Performance Blog
    Friday, September 10, 2010 12:16 PM
  • Hi Marais,

    If your service have to adopt the SOAP/XML format, then basicHttpBinding is the way to go for interop with other non-WCF platforms.

    If your service can also use other customized non-SOAP format(such as plain xml or even binary format), you can consider build your service as a REST service so that any consumers supported HTTP request/response handling can consume it:

    #WCF Web HTTP Programming Model
    http://msdn.microsoft.com/en-us/library/bb412169.aspx

    #Introducing WCF WebHttp Services in .NET 4
    http://blogs.msdn.com/b/endpoint/archive/2010/01/06/introducing-wcf-webhttp-services-in-net-4.aspx


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Monday, September 13, 2010 7:41 AM
    Moderator
  • I have used SOAP with a basicHttpBinding, but apparently the wsdl2objc tool generates SOAP1.2 objects which is not compatible with basicHttpBindings which is SOAP1.1.

    I don't know much about development for a Mac, but what I do know is that their development tools/support suck big time compared to the Microsoft environment.

    Monday, September 13, 2010 8:14 AM
  • WRT soap12. There are some comments in the quickstart of the wsdl2objc in the link I send you which suggest to do this:

     

    Add Content-Type to the HTTP Header

    <tt>[</tt>setObject:@"text/xml" forKey:@"Content-Type"<tt>]</tt>;


    http://webservices20.blogspot.com/
    WCF Security, Interoperability And Performance Blog
    Monday, September 13, 2010 8:18 PM