Then i created a wsdl and tested it in SOAP UI. There I can see that the service is returning a null object as response.
The wsdl was created using Apache AXIS v1.4.
This means the wsdl getting generated is not correct since all my code is working fine when i run it as java client application.
When the return type of a method present in the web service is integer, then the value is getting returned correctly while invoking the Web Service using SOAP UI. But when i try to return a model, a null response object is returned.
Please help. Ask if you need some more information about this.
I tried running the Web Service as a java application by adding a main method in the service,
A web service is usually hosted by a web "container" which provides the logic for listening at a port and composing a request object, also creating a response object.
In your modified service code, what performs these functions?
Thanks for a reply.
I wrote the Web service. Basically, in the service layer, we have all the signatures of the methods(i.e. the return typr, method name and parameters to be passed for the method) which will be exposed to the outside world by sharing the WSDL file.
Just for testing purpose, i added a main method in the service layer(which contains all the method signature). Then i invoked all the methods one by one inside the main method and tested it by running the file as a java application. In this way i did the unit testing of each and every method present in the web service.
Finally, once confirmed that everything is working fine, i removed the main method and created the WSDL file for my service by New => Web Service option.
Hope you understand what i am trying to explain.
Please help me out of this, if you want some further information then please ask.
empId is the request related information that the method of my service is expecting.
EmployeeDetails is the model which will be returned by my service.
I apologise if i did n't get you this time also.
Another thing I am noticing is like when i create the WSDL, then the _SEI is not created for my service. Again, the _helper, _ser and _deser are not getting created for the model.
Thanks & Regards,
What is hosting your web service? Something has to receive the socket connection created by the client software HTTP request. What is it?
For example, Tomcat web server can host a web service application. Getting a "null object as response" may indicate that the host did not recognize the request. Tomcat can record each attempt to connect - the log would show how your client is trying to connect.
William Brogden wrote:Let me try another approach since you seem to have missed my point entirely.
Your Java client or SOAPUI creates an HTTP request to your web service.
In you stand alone java application run from a main method, what receives this request? How?
He is using the main method to unit test the backend methods outside of a web container. I am assuming the input to these methods from the main method are simply populated POJOs.
Thanks for your reply.
You got it correct. Since its called by a main method for unit testing, hence its simple POJO. Thats why i posted the code for the main method present in the service layer.
Thanks for your reply.
It is hosted in Apache Tomcat v6.0. While creating the web service, i commented out the main method(posted above for unit testing). Hence the main method is not present in the generated WSDL file.
Please ask if you have further queries. Please inform how to make it work
Another surprising thing is while creating the web service, i cant see any _SEI, or any of the ser,deser or helper getting generated. WHY?
Thanks & Regards,
Ok fine I solved the problem. The problem was with the connection with DB issue. I placed the jar file classes12.jar in the lib folder of WEB_INF and it worked for me.
I am not able to understand a few things:
1) Why is there no _SEI, ser, deser and helper created (i asked in the previous post)
2) what are the use of _SEI, ser, deser and helper files? In IBM RSA and WebSphere i can see these files (in that case I use the RPC approach, use the webservices.jar rather than using axis.jar). Is it like these generated files are needed for AXIS but not for IBM RPC?
Totally confused with these two questions
Please clear my confusion.
Think of how stupid the average person is. And how half of them are stupider than that. But who reads this tiny ad?
The WEB SERVICES and JAX-RS Coursehttps://coderanch.com/t/690789/WEB-SERVICES-JAX-RS