SiteExperts.com Logo Home | Community | Developer's Paradise
User Groups | Site Tools | Site Information | Search
 Main Menu
 Forums
SiteExperts.com Forums
All Discussions

SiteExperts Feedback
The Lounge
Dynamic HTML
Site Design/ Critiques
HTML and CSS
XML Technologies
The Wireless Internet
Internet Explorer
Microsoft .NET
The Server
Technical Support

Sponsored Links

User Groups : Forums : SiteExperts : XML Technologies :

Previous DiscussionNext Discussion
 How to call a .net web service having complex type from a java client

Hi All, I have a problem in writing a client code for a .NET web service which have complex types.
The complex types are like java classes which have getter and setter methods.
Example:

I have a class called OperationImpl and have only method "addOp".
The method body is as follows:
public Result addOp(Param a, Param b) throws RemoteException
{
Result r = new Result();
r.setValue(a.getVal()+b.getVal());
return r;
}

Result.java has following code
***********************************
public class Result
{
int value;
boolean status;

Result()
{
}
public int getValue()
{
return this.value;
}
public void setValue(int value)
{
this.value = value;
}
public boolean getStatus()
{
return this.status;
}
}

Param.java has following code
*****************************

public class Param
{
int val;

Param()
{
}
public int getVal()
{
return this.val;
}
public void setVal(int val)
{
this.val = val;
}

}


Now these things have a .NET implementation.

If I write a client code in java , how i can get reference of Result and Param?

Started By chandankp on Sep 5, 2006 at 10:20:11 PM

2 Response(s) | Reply

Earlier Replies | Replies 1 to 2 of 2 | Later Replies
MHenke on Sep 6, 2006 at 2:34:18 AM (# 1)

Your keywords: Type Mapping, Serialization, Deserialization.

If you're using a decent SOAP framework like AXIS, you can use the build in JavaBean Serializer to map your Java classes to the WSDL Schema types.

Look it up, I havn't the time by now...


clintonkollman on Feb 6, 2012 at 10:24:03 PM (# 2)
This message has been edited.

Create a new Windows Application project in Microsoft Visual Basic .Net.We gave it the name Sample 1WebService.Create a new form and add three text boxes with labels and two buttons to the form so that it looks something similar to Figure 1. The Web host text box is given a default value of localhost. This is done assuming that WSDK is installed on the same machine as Visual Basic .Net. Including this text box as a variable allows the user the chance to easily run the client application in an installation where the machine hosting the web service is running on a different machine by supplying the network name of the machine.We have included some code that validates the text in the Enter your name.. text box, so that the web service cannot be invoked if this is blank. This code is included in the code which handles the click event for the Invoke Service button and its purpose is to avoid a null pointer exception when the web service is invoked with an empty string. The text box validation is shown in Listing 1. Now we have the basic client GUI for invoking the Sample1WebService. We now need to include the code to invoke the web service and handle the returned result.

______
Ares Download


Earlier Replies | Replies 1 to 2 of 2 | Later Replies

To respond to a discussion, you must first logon.

If you are not registered, please register yourself to become a member of the SiteExperts.community.

User Name
Password
Copyright 1997-2004 InsideDHTML.com, LLC. All rights reserved.