473,406 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Latest approach to calling a .NET C# Web Service with a java program

4
I know how to call a method written in a .NET C# Web Service(SOAP Service) using a c# application. But how to do it with a .NET C# Web Service and a java application. I have found a link regarding this. But it seems a bit outdated. So someone please suggest me a latest approach. As I am quite new to programming please give me a Hello World code example. Thanks in advance.

Following is the link that I found:
http://javaclaus.wordpress.com/2013/...avajsp-client/
Sep 18 '14 #1
1 1812
rajujrk
107 100+
Use Axis2 Client to call your webservices.

The Axis2 client API is very convenient and it has cool features like asynchronous web service utilization, multiple transport selection, and so on. Once you run the samples you will understand the basics of the Axis2 client API. To understand the rest of the API you need to write complex code.

Example Code:

Expand|Select|Wrap|Line Numbers
  1.  public static void clientInvokeExample() {
  2.     try {
  3.       String endpoint = "http://host_or_ip:8080/service_or_action";
  4.  
  5.       Service   service = new Service();
  6.       Call      call    = (Call)service.createCall();
  7.  
  8.       call.setTargetEndpointAddress(new URL(endpoint));
  9.       call.setOperationName(new QName("urn:xmethods-delayed-quotes", "getQuote"));
  10.  
  11.       String symbol = "TCS";
  12.       Float ret = (Float)call.invoke(new Object[] { symbol } );
  13.  
  14.       System.out.println("Results (clientInvokeExample):");
  15.       System.out.println("   symbol = " + symbol);
  16.       System.out.println("   return = " + ret);
  17.     } catch (Exception e) {
  18.       e.printStackTrace();
  19.     }
  20.   }
  21.  

Thanks
Raju
Jan 21 '15 #2

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

Similar topics

2
by: Martin Hampl | last post by:
Hi, I couldn't compile php with java support on Mac OS X so I thought I'd call my java program with shell_exec(). It does work for simple programs ("hello world") but if the program gets more...
1
by: chandan | last post by:
Is it possible to call an external java program from a trigger in oracle 8i. I know that you can call a stored procedure in java from a trigger but i want to know is it possible to call an...
1
by: John Bailo | last post by:
What do you guys know about calling a java.class from .Net ? -- http://www.texeme.com http://www.interpolny.com on Jay Leno, Oct 1 --- Outgoing mail is certified Virus Free.
6
by: David | last post by:
Hi, I am writing a C# program and want to run a java application and pass it a filename as a parameter. I want to be able to write a method in C# that will run this Java app for me. Eg. I want...
1
by: Dan Gelder | last post by:
Hi, I'm new to PHP but learning fast. I'm already a Java programmer and was wondering if there is a way to have a PHP script pass parameters to a Java program and put the data back into the page. ...
11
by: jobs239 | last post by:
Can I use this line inside C program "system(java -jar <jarfilename>)" to run a java program from C? Or do I have to use some JNI interface.?
1
by: peggitt | last post by:
I need help. I need code to connect my java program with a mysql database hosted by an internet service provider(domain). The java program should run locally but read and write to a database on the...
4
by: Quill_Patricia | last post by:
I have a Python script which is used to load data into a database. Up to now this script has been run by customers from the Windows command prompt using "python edg_loader.pyc". Any error messages...
0
by: Siyodia | last post by:
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...
0
Malathi
by: Malathi | last post by:
Hi, Im calling a vb.net exe(console app) in java program. The exe will return 1/0 as per success/failure of its task. Now in java I want to capture the return value of .net exe and show it in a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.