473,394 Members | 1,715 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,394 software developers and data experts.

Converting C# Web Services to Java Web Services

greetings all. I am now coding in Java due to a new employer and was previously a C#/vb.net coder.

I wanted to know how to accomplish the below in Java (NetBeans). In C# I always separated my web method logic into their own class files for ease of development and future portability.

Your assistance is appreciated.

C# Sample Web Method:

[WebMethod(Description = "sell a house sample.")]
public SellHouse sellHouse(Int32 transactionId, Int32 customerId, string assetId, int assetPrice)
{
return new SellHouse(transactionId, customerId, assetId, assetPrice);
}

C# SellHouse.cs Class File

public class SellHouse
{

#region " Private Members "

private Int32 _transactionID = 0;
private Int32 _customerId = 0;
private string _assetID = String.Empty;
private int _assetPrice = 0;
private int _resultCode = 0;

#endregion

#region " Default "

public SellHouse()
{
}

#endregion

#region " Non-Default "

public SellHouse(Int32 transactionID, Int32 customerId, string assetID, int assetPrice)
{
_transactionID = transactionID;
_customerId = customerId;
_assetID = assetID;
_assetPrice = assetPrice;

purchaseAsset();
}

#endregion

#region " Read/Write Properties "

public int resultCode
{
get
{
return _resultCode;
}
set
{
_resultCode = value;
}
}

#endregion

public void sellHouse()
{
LOGIC
}
}
Jul 10 '07 #1
2 1703
*********bump********
Jul 11 '07 #2
r035198x
13,262 8TB
greetings all. I am now coding in Java due to a new employer and was previously a C#/vb.net coder.

I wanted to know how to accomplish the below in Java (NetBeans). In C# I always separated my web method logic into their own class files for ease of development and future portability.

Your assistance is appreciated.

C# Sample Web Method:

[WebMethod(Description = "sell a house sample.")]
public SellHouse sellHouse(Int32 transactionId, Int32 customerId, string assetId, int assetPrice)
{
return new SellHouse(transactionId, customerId, assetId, assetPrice);
}

C# SellHouse.cs Class File

public class SellHouse
{

#region " Private Members "

private Int32 _transactionID = 0;
private Int32 _customerId = 0;
private string _assetID = String.Empty;
private int _assetPrice = 0;
private int _resultCode = 0;

#endregion

#region " Default "

public SellHouse()
{
}

#endregion

#region " Non-Default "

public SellHouse(Int32 transactionID, Int32 customerId, string assetID, int assetPrice)
{
_transactionID = transactionID;
_customerId = customerId;
_assetID = assetID;
_assetPrice = assetPrice;

purchaseAsset();
}

#endregion

#region " Read/Write Properties "

public int resultCode
{
get
{
return _resultCode;
}
set
{
_resultCode = value;
}
}

#endregion

public void sellHouse()
{
LOGIC
}
}
I assume you've read a Java tutorial ?
Jul 11 '07 #3

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

Similar topics

2
by: parthan | last post by:
We are running our c++ program, which uses JNI, as Windows services. Program is getting CLASSPATH env variable correctly and also initializes JVM successfully. After initializing JVM, programs...
2
by: Liza | last post by:
I've learnt that there are 3 types of web services...........one that provide information, once that provide a transaction, ones are an integration of webservices. WHy bother have a web service...
1
by: asj | last post by:
Just when I say web services may be hyped, here comes a news report that says Swedish Referendum Results will be delivered in real time over the internet using Java web services. In one sense,...
10
by: asj | last post by:
BIG news from the web services front. Amazon will use web services to tie all its vendors together. The company implementing the system will be using Java/C++ (migrating to all-java later). ...
24
by: cs_hart | last post by:
I have an application in Java that I would like to port to c++ to integrate with existing c++ app. Is anyone aware of any tools to help? I found microsft has a java->c# convert, but the java app...
1
by: BestofAbhi | last post by:
I am consuming Java Web Services in .NET. The Java Web Services have been coded using Apache Axis. The binding style in the WSDL is 'Document' and type is 'Literal'. I have added these Java...
0
by: Abhijit Salvi | last post by:
I am consuming Java Web Services in .NET. The Java Web Services have been coded using Apache Axis. The binding style in the WSDL is 'Document' and type is 'Literal'. I have added these Java...
1
by: bugnthecode | last post by:
Hi, I am trying to put together a small app that uses one of my company's web service. Originally I interfaced with this web service using java, and have the example code. I believe the web...
1
by: vani1987 | last post by:
Hi, I'm new to the web services. I've to call the two java web services from other network system from classic ASP page. There are two java webservices are hosted in one server and this ASP...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
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...
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
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...

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.