Freigeben über


WS Interoperability Tip of the Week. What's wrong with this?

This week's tip is in two parts. First comes the question: 

Scenario: You are creating your first Web service. You have been told to create a service that accepts a price (which for this example can be a float) and return a boolean. You are working in Java, but you know that you want to expose the Web service to a number of .NET clients. Interoperability of this service is key to the success of the project.

You start by creating your method:

public boolean MyWebMethod(float price)

{     

      //some code goes here     

       return true;

}

 

Although technically this may work, there are potentially two things wrong with this approach - especially if you are designing with interoperability in mind. What?

Answer tomorrow...

Comments

  • Anonymous
    May 17, 2004
    Probably the 'boolean' and 'float' data types are not spec-compliant?

    Or 'true' is platform dependent on its numeric value?

    Or is it that "Java"-thing that's wrong to you? :-D
  • Anonymous
    May 17, 2004
    the problem is with the mapping of the java primitive types to c# types

    this document explains it better than i will ever be able to

    http://www.systinet.com/doc/wasp_jserver-451/waspj/netintegration.html

    <i>scroll down a bit to find the solution</i>