The moose likes Web Services and the fly likes Javascript problem trying to invoke Axis service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Javascript problem trying to invoke Axis service" Watch "Javascript problem trying to invoke Axis service" New topic

Javascript problem trying to invoke Axis service

Dave Pain

Joined: Sep 04, 2012
Posts: 3
I have javascript in an HTML page with which Im trying to invoke my web service (Axis2 deployed in Tomcat @ port 9090)
The javascript:

And the java function on the other other end that Im trying to call is:

The function gets called fine. And an instance of loginRequest is also provided, but the attributes inside loginRequest are all null. APIWSLoginRequest is a pojo with 3 members: userId, userPassword and an integer array.

If I put a breakpoint in login(), it does hit the breakpoint. If I poke into the call stack, I can see that Axis does have the values that are provided by the Javascript, but they dont get populated inside the loginRequest instance.

Any idea what could be wrong? This worked before, but suddenly stopped working this Monday morning.

Could it be a namespace problem? I had read an article somewhere on the net, on modifying my wsdl to remove namespaces which I had followed initially.
After introducing a new function in the Web Service class, I did regenerate the WSDL, but haven't done the same thing again. I cant find the article again!

Dave Pain

Joined: Sep 04, 2012
Posts: 3
I've also tried following the instructions at

And introducing the following line in the Javascript AJAX call (Between line 12 & 13 above):

Still no luck.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60810

How big is the request data? Too big for a GET perhaps? Have you checked the request itself to see if it has the data?

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Dave Pain

Joined: Sep 04, 2012
Posts: 3
Really small request. LoginId, password and an array of couple of integers

I can see the JSON object string (String form of JSON in the Axis message) on the server side, but it stays as a JSON string. Doesn't convert to a java object. Thus my object (APILoginRequest) ends up keeping null members after the constructor is called. None of the getters are invoked
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Javascript problem trying to invoke Axis service
Similar Threads
Consume web service in javascript
Invoking a https webservice
call object per string
Spring and Ajax
Generating WSDL