I wanted to develop a Web Service in .NET and wanted this Web Service to be consumable in Java. What are the steps I need to follow. I have written couple of web service but client for all was .Net. Please let me know the Steps that I should follow.
Also My web Service is going to take a Binary File as the Input, please let me know how do I achieve this ?
I dont think that you need to do anything extra to accomplish this. The primary purpose of web services is that they can be accessed from any platform and this is because of the underlying XML format on which webservices are based.
So, you just need to connect to a .NET Webservice through a Java client in the same way as you connect with a Java WebService.
As far as Binary file input is concerned, this can be a problem because binary file serialization in Java and .NET can be different. i.e., only in the case if you are creating binary file on the runtime. I don't recall correctly but I think that I have read somewhere that there is a difference in the underlying byte-ordering mechanism in .NET and Java. One of them is little-endian and the other one is high-endian and due to this the serialized binaries of both platforms may be different although they might be serializing same data. (I am not 100% sure about this so if someone knows this, please correct me)
For a binary file, use a string element and return it base64 encoded. Although Java has no built in function to do base 64 encoding/decoding, it is easy enough to achieve. That way you will not need to worry about serialization issues. For Java, PHP, Python, etc.
If the binary file will ever be very large, (into the megabyte range) you may want to return it as a soap attachment. (DIME or MTOM) Sometimes a client will have XML Denial of Service prevention measures in effect (I can think of several network appliances that do this) and will try to load the entire message into a buffer to parse. If the buffer is not big enough, you lose the message. Sending a large base64 encoded binary as an attachment avoids this.
Last, .Net will let you create a target namespace that a Java client can't handle. This will cause problems. Make sure the namespace meets the standards.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With