This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills: The software developer's life manual and have John Sonmez on-line!
See this thread for details.
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Invoke web service method from Unix command line

 
Mahita Ande
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a java web service running on Unix machine with an exposed web method to get number of users logged into another application. I am trying to invoke the web method using 'wget' command from the Unix command prompt to get the users info. But I only see the the connection was established and the bytes were downloaded. I do not see any return value. I am not sure if the method is executed to gather information about users. Please advise what modifiers should I use invoke the web method using wget or if there is any other command that would accomplish this.

Thank you,
Mahita
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From your description it's not clear whether this call supplies all the parameters necessary to execute the WS call, but wget writes whatever response it gets to a file in the current directory - so check if there are any new files, and what's in them.
 
Mahita Ande
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The web method does not take any parameters. Signature of the web method is public void GetCPUUsed(). When i look into the files created by wget I do not see the returned value anywhere making me suspect if the method was executed to return the value.

Please advise.

Thank you,
Mahita
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, what is in those files? wget doesn't know the first thing about WS, it only understands HTTP.
 
Mahita Ande
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I exposed a method GetCPUUsage in my web service which returns a CPUUsed on system. When i use wget to call this method I have a file downloaded. Here is the content of the file.

<html>
<head><title>
Web Services
</title></head>
<body>
<h1>Web Services</h1>
<table width='100%' border='1'>
<tr>
<td>
Endpoint
</td>
<td>
Information
</td>
</tr>
<tr>
<td>
<table border="0"><tr><td>Service Name:</td><td>{http://Unix.Monitors.Pulse/}UnixService</td></tr><tr><td>Port Name:</td><td>{http://Unix.Monitors.Pulse/}UnixPort</td></tr></table>
</td>
<td>
<table border="0"><tr><td>Address:</td><td>http://dev05:40005/UnixMonitor/UnixMonitorService</td></tr><tr><td>WSDL:</td><td><a href="http://dev05:40005/UnixMonitor/UnixMonitorService?wsdl">http://dev05:40005/UnixMonitor/UnixMonitorService?wsdl</a></td></tr><tr><td>Implementation class:</td><td>Pulse.Monitors.Unix.Unix</td></tr></table>
</td>
</tr>
</table>
</body>
</html>

I do not see the returned value swhich gives me the CPUUsage anywhere in the file.

Thank you,
Mahita
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That looks like a WSDL - meaning, you're accessing a SOAP WS, not a REST WS. wget can't do that (unless it can somehow send content in the HTTP body, which I doubt).
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17616
38
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not a WSDL, but it is a description of presented services. And thus, it probably means that the URL that you used was not correct and should be formed in the way that the sample indicates.
service.jpg
Web Service screenshot
[Thumbnail for service.jpg]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic