Consuming .Net Web Service from Java problem

Posted on 2008-11-03
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, ""); 

     call.setTargetEndpointAddress( new;

     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
    LVL 2

    Accepted Solution

    You need to create a proxy in your Java code. Here is a link how to:

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Suggested Solutions

    For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK ( for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
    A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
    Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
    The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now