Meaningless Drivel is fun!*
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 Java 8 in Action this week in the Java 8 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
Author

Javascript problem trying to invoke Axis service

Dave Pain
Greenhorn

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
Greenhorn

Joined: Sep 04, 2012
Posts: 3
I've also tried following the instructions at
http://axis.apache.org/axis2/java/core/docs/json_support.html

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


Still no luck.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

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
Greenhorn

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Javascript problem trying to invoke Axis service
 
Similar Threads
Generating WSDL
call object per string
Consume web service in javascript
Spring and Ajax
Invoking a https webservice