Consuming .Net Web Service from Java problem

Posted on 2008-11-03
Medium Priority
Last Modified: 2013-12-17
Hi All,

I have written a simple C# web service to accept 1 string paramater and write it to a file (method attached in code snipppet).  I want to call this method from a java class and have written code to do so (attached in a code snippet).

This is kind of working.  I am able to call the method in the service successfully, however I am unable to pass the parameter.  The C# web method always recieved null as the parameter value.  Am I missing something blatant here?
C# Web Service
public string SendToMessageServer(string one)
     StreamWriter sw = new StreamWriter("C:\\ItWorked.TXT", true);
     return one;
Java call to service
     String endpoint =  "http://localhost:1093/CSL.asmx?WSDL"; 
     Service service = new Service();
     Call call= (Call) service.createCall(); 
     call.setProperty( Call.SOAPACTION_USE_PROPERTY, new Boolean(true)); 
     call.setProperty(Call.SOAPACTION_URI_PROPERTY, "http://development.datel-group.com/SendToMessageServer"); 
     call.setTargetEndpointAddress( new java.net.URL(endpoint));
     call.setOperationName(new QName("http://localhost:1093/CSL.asmx/SendToMessageServer", "SendToMessageServer"));
     call.addParameter("one", XMLType.XSD_STRING, ParameterMode.IN);
     Object[] parms = new Object[1];
     parms[0] = "HeyNow";
catch (Exception e) 

Open in new window

Question by:mdw233
1 Comment

Accepted Solution

Slava_K earned 1500 total points
ID: 22872491
You need to create a proxy in your Java code. Here is a link how to:

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Online collaboration is quickly becoming embedded in the workplace, and its benefits are tangible. See what the current landscape looks like and what the future holds for collaboration tools and the future of work.
In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month8 days, 11 hours left to enroll

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question