.Net Code Monkey RSS 2.0
 Monday, March 31, 2008

Well it has been a steep learning curve of languages and syntax of the last two years since I started at NewLook. I came in with only HTML and what I thought was a reasonable knowledge of VB script in the form of classic ASP. Since then it's been Web and Windows programming in VB.Net and last year a move to C#. So what next?

Well, our team are aware that there is a plan in the company to have a new team of Java developers employed in the not too distant future. So I guess at some point it will be prudent to get a bit of back ground knowledge of this Java stuff.

Now I get a bit scared when thinking about learning another new programming language, incase it dilutes what little knowledge I have of my other languages. But I guess in reality, apart from forgetting not to put a semi-colon here and a curly brace there for the first 10 minutes of reworking an old project in another language, there is probably no disadvantage other than the time to learn the new syntax or new IDE to write it in. Infact from reading other developers blogs it appears it can help to improve your programming prowess in your original languages by exposing you to different architectures and ways of going about tackling problems.

What better way to give it a go than a need arising from an actual project! Seeing as we use a few Oracle products it seemed logical to find the JDeveloper set up file on the network and install and use that. I always find it disconcerting the way that you just unzip the files and flop them in a folder and create a shortcut to your start menu, if you feel like it. There is something to be said for MSI installer packages; if they complete without failure, you at least you have some confidence that the app will run! But run it did, and apart from having to point a setting to the folder that contained what I assume was the compiler, it was all good.

To be continued...

Monday, March 31, 2008 2:21:44 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
Java

As part of the preliminary research and design process for a prospective new project at work one of the requirements will be for the application to provide a webservice that can be consumed from a third party's Java application.

So without further ado a quick .Net webservice was nocked up in C# with a single WebMethod. The WebMethod would return a formatted string containing within it the value passed in as a string parameter. The Webservice was deployed to localhost and tested using the simple webform test that is present on a local instal.

All good so far.

Next is to build a small Java web project that can consume the webservice. So having never written a Java application before, it's a quick trip to see Mr Google for a working example of how to call a webservice from Java. ( See My First Java App ) Google thankfully turned up David Hobbs' example "How to consume an ASP.NET webservice from Java via SOAP" on CodeProject. After a an hour or after nocking up a quick Java webpage with an embedded applet that will call the webservice and display the result, it should be a case of running it and seeing it work like clockwork.... After all the whole idea of a webservice is to platform unspecific, isn't it?....

Well, I shouldn't really have expected miracles, should I? After a whole afternoon of checking and double checking that the code was correct and using a free trial of ExamDiff Pro to ensure that XML that the java code was out putting was exactly what the XML that the server was expecting to receive I came to the conclusion that it must be something perculiar to our network. The XML output was identical except for the physical value of the parameter.

So at the end of the day I was at a loss. I'm not sure if it is an error in the code, or if the webservice expects different XML than what the description page offers up. Or if there is a network security issue which isn't allowing communication between the two applications. One of my .Net Windows applications calls a .Net webservice which is built in the same way as this test one perfectly, and has done for the last year! Event the third party representative was at a bit of a loss.

So I am at a bit of a loss with this one. May be a fresh look in a new week will shed some light. Who knows? If any one else has come accross this issue, and resolved or not resolved it, please post and let me know your findings!


Postscript: #1
I have just noticed on the botttom of David's CodeProject artical the following:

Notes
Some Java Virtual Machines (like the Microsoft one) only allow you to make a socket connection to the same machine that hosts the Java class files. Therefore, if you're using an applet like me, you will need to host the Java class files on the same machine where the webservice resides.

I wonder if this has anything to do with the problem... Oh well, maybe tomorrow I'll waste another fruitless afternoon trying to find out!! ;-)

Postscript: #2
Well after further investigation I haven't managed to determin the fault, but today we tried a different approach and used the "Web Service proxy" object from the Business Tier > Web Services category in the New Gallery.

We then followed the wizard and let it generate the code. The outputted code was tested and hey presto!!

So I guess this topic is closed for me now!

Monday, March 31, 2008 2:07:10 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
.Net | Java | SOAP | Web Services | XML | JDeveloper
Archive
<September 2010>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789
Blogroll
 Clemens Vasters
 Harry Pierson
Passion * Technology * Ruthless Competence
 Joshua Flanagan
A .NET Software Developer
 Michael Schwarz's Blog
Developing applications on the Microsoft platform since Windows 3.1!
 Omar Shahine
Yet another Microsoft blogger
 Scot GU
Scott Guthrie lives in Seattle and builds a few products for Microsoft
 Scott Hanselman
Programming Life and the Zen of Computers
 Tom Mertens
Tom's corner
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
Duane Wingett
Sign In
Statistics
Total Posts: 32
This Year: 6
This Month: 1
This Week: 1
Comments: 35
Themes
Pick a theme:
All Content © 2010, Duane Wingett
DasBlog theme 'Business' created by Christoph De Baene (delarou)