![]() |
| ||
| Java and Web Services I know I should probably post this in Web Services of Web Development, but this may be beneficial to others that are trying to lean something about it too. I'm getting lot of strange behaviour from this assignment that at this point I'm willing to throw it away and never work on it. I have class that run various queries with database. With use of Axis2 plug-in I was able to generate WSDL (This has some red sections which I'm not able to work out). Here is small section of two methods out of it to demonstrate some errors I'm getting public Employee logEmployee(String usr, String pass) {I was able to use this WSDL to create client side and get automated files Service, ServiceLocator, _PortType, SoapBindingStub. To communicate with service I use following code try{However for example when I'm trying to log in through logEmployee(String usr, String pass) method server side receive only user name string and password is lost. (I found solution to this in sending these strings in array)Secondly when I tried to retrieve list of all employees through viewEmployees() method that is supposed to return ArrayList<Employee> I'm getting warning or error that found return is actually Object[]. Can somebody shed some light into this darkness? :?: |
| ||
| Re: Java and Web Services first issue sounds really strange, the system out doesn't print pass? with the second, are you importing Employee? |
| ||
| Re: Java and Web Services Yes of course I do import Employee |
| ||
| Re: Java and Web Services A piece of advice: use a debugger, given that we have no way of reproducing the scenario and the code posted so far looks OK. BTW, why are you catching a NullPointerException? Catching unchecked exceptions without any kind of processing is *always* a bad practice and screams of a pre-condition check. Instead put null checks before closing the database resources [like result sets and statements]. Connection conn = null; |
| ||
| Re: Java and Web Services Yeah NullPointerException is one of many small things I need to battle through as many of the things I pick up either from IDE suggestions (which is not always best to do) or following other people code and often miss the reason of the use. Hopefully with all this technical reading I'm doing I will loose some bad habits ;) Right now I'm "cracking" through Service-Oriented Architecture with Java Web Services by Mark Hansen and found nice quote Quote:
|
| All times are GMT -4. The time now is 6:17 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC