473,738 Members | 8,397 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help in running the java program(web service client)

3 New Member
This is a java program which i need to run facing compilation error
Its consuming a third party web service method
I have the supported files(folder) which contain necessary class files org/apache/axis

The following is what i need to do but am unable to do

////////////////////////////////////////////////////////////////////////////////////////////
set classpath where the below jars are located....
axis.jar
commons-discovery.jar
commons-logging.jar
jaxrpc.jar
saaj.jar
wsdl4j.jar

I have the above jars

Run the below command
java org.apache.axis .wsdl.WSDL2Java <URL>.wsdl


Sample:
1) Setting Classpath:
a) AXISPATH = The path where all the below specifed jars are available.


b) %AXISPATH%axis. jar;%AXISPATH%c ommons-discovery.jar;% AXISPATH%common s-logging.jar;%AX ISPATH%wsdl4j.j ar;%AXISPATH%ja xrpc.jar;%AXISP ATH%saaj.jar;

Command to Execute[In console]:
c:\user>java org.apache.axis .wsdl.WSDL2Java http://************************************?wsdl

After executing the above command you can find the output java files under c:\user dir
/////////////////////////////////////////////////////////////////////////////////////////////

Also not correctly understanding where and how to set classpath while running the program


JAVA Source Code



import org.apache.axis .client.Call;
import org.apache.axis .client.Service ;
import javax.xml.names pace.QName;


public class UserRegistratio n
{


public static void main(String [] args)
{


String endpoint = "http://1.1.1.1/..............T he URL";

Service service = new Service();

String methodName="Tes t";

Call call = (Call)service.c reateCall();
call.setTargetE ndpointAddress( new java.net.URL(en dpoint) );
call.setOperati onName(new QName(methodNam e));
call.setPropert y(Call.USERNAME _PROPERTY, "testcheck" );



call.setPropert y(Call.PASSWORD _PROPERTY, "testcheck" );



String req = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><TestObjec t user=\"Test1\" password=\"Test 2\" />";


System.out.prin tln ("Invoked Operation : " + methodName);
System.out.prin tln ("End Point : " + endpoint);
Object ret = call.invoke( new Object[] {req} );
System.out.prin tln (ret);
}


}
Jun 9 '09 #1
0 2438

Sign in to post your reply or Sign up for a free account.

Similar topics

3
18902
by: Valeriu Filip | last post by:
Hello, I have a java web service, and created a wsdl file from the java class; based on the resulting wsdl file i generated the proxy C# class using wsdl.exe utility and the result i included in my window app. i am calling the web method but, i get no answer back, and after 1,2 minutes i get something like 'Operation time out'. if i check on the server where it runs the java web service, the method was called and parameters corectly...
3
6624
by: JL | last post by:
I have a VB.NET desktop program that reads/writes data to a server using a Java-based Web Service. This web service, in identical formats, is located on several servers with each server being a different customer and different data content. To connect with the Java Web Service, I downloaded the WSDL file and used wsdl.exe to create a .vb class file. In my program, I simply call the functions of the class to communicate with the server. ...
7
7114
by: David Laub | last post by:
I've also posted this issue to a Sun/java formum, but since it appears to be an integration issue, this may be the better place to posr: I have written a dot net/c# Web Services doesn't fully work with J2ME client a) c# web service works with c# WIndows Client (local & remote web service) b) c# web service works with J2ME client - when the Web Service is local c) c# web service fails with J2ME client - when the Web Service is remote ...
1
8127
by: Samudrala | last post by:
Hi, I have developed a web service developed in C#. the WSDL I gave is working fine with .net client. But when java client consumes it always raising exception. I have basic knowledge of java too but never worked on consuming/producing web services. can any body send sample source code for java client so that i can test my web service in java client. thanx in advance samudrala
1
4169
by: Vaibhav Modak | last post by:
Hi All, I have a Web Service written in Java (Web Logic) and I am trying to call it in my ASP. NET client. I am facing a problem while getting the data from the Web Service Method. My Web Service returns me an object which is a wrapper around an array of objects. (Earlier I was trying to read the array directly but could not succeed - so I wrapped that array with another object.) Now the primary issue is regarding the chunky characters...
1
2373
by: christen_mitchell | last post by:
I have written a basic .net client to call methods on a java web service. I get the call to the webservice but cannot recieve any responses. When watching a packet capture I see that my client sends "HTTP GET /wpad.dat HTTP/1.1" and then the web service responds with "HTTP HTTP/1.1 404 Not Found". Im wondering if the web service doesn't support HTTP/1.1 and only supports HTTP/1.0. If this is the case how do you force the .net client...
1
3487
by: Jay | last post by:
Hi, I am trying to connect to a java web service. I have a vb .net client which uses the service. It was working ok few days ago. The web service has been updated and i have been getting the following error. I did update my wsdl but of no avail. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at
1
2940
by: ssaini | last post by:
Hi, I am consuming a java web service in .NET C# smart client, which is based upon Microsoft's SCSF application block.The SCSF is a wrapper over WinForms. When I make a call to any of the Java webservice,for the first time its very slow (takes 600-800ms) but after the first call, if I make any subsequent calls to the same web service then it is preety fast. The same thing when I did with a Java client, the results are preety good...
0
1598
by: WatchoutMac | last post by:
I have a C# .NET client (2.0 Framework) that needs to connect to a java web service (built with Axis) and send some data for processing. The java web service is hosted on a secured Apache server ( I am not in control of this server or web service). I can create a web reference using VS2005 with the https URL of the WSDL file. When I try sending the data I receive the below error: "Unable to connect to the remote server" I added the...
1
8648
by: compurhythms | last post by:
I'm having an issue calling a java-based web service from a C#/.NET 2.0 client that uses WSE 3.0. (No WCF) There is an operation on the web service that takes a single base64 encoded parameter that is transported as a MTOM mime part in a multipart request. The web service provider has sent me a trace of a successful SOAP request and I have traced my SOAP request and I do not see any differences other than differences in how the...
0
8969
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8788
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9476
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9263
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9208
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6751
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4570
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2745
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.