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

Have Problem while invoking a method in C# Web Services ... Urgen

Hi all,

I create a Web Service project called 'eSelectService' and another Class
Library project called 'MonerisVO', and a Windows Form project called 'maps'
as well.

The reason why I need the Class Library project is because I don't want to
pass more than 30 parameters when I try to invoke the Web Method. I used the
class in Class Library as a value object to contain all the information I
need.

Here is the problem:

When I debug the Web Service project, I add the Class Library project's
output (Trans.dll) as a reference. Everything works fine.
But when I want to invoke the Web Service via my Windows Form project the
compiler says "cannot convert the MonerisVO.ValueObject from
eSelectService.ValueObject." So I remove the Trans.dll from the Windows Form
project's references. But the new problem is I cannot see the methods in
Trans.dll, even the overloaded constructor.

My guess is maybe I get some configuration options wrong.

Here are the codes:
Here is the source code:

//Web Services
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
using MonerisVO;

namespace eSelectService
{
public class GateWay : System.Web.Services.WebService
{
public GateWay()
{
InitializeComponent();
}

[WebMethod]
public string test(string host, Trans tr)
{
//Can invoke the method here in the Web Services.
return "host=" + host
+ ", order_id=" + tr.OrderID
+ ", amount=" + tr.TotalAmount;
}
}
}

//Web Forms
using eSelectService;

....

private void btStart_Click(object sender, System.EventArgs e)
{
eSelectService.GateWay gt = new eSelectService.GateWay();
eSelectService.Trans = new eSelectService.Trans();
trans.Init("order_id_test", "4.01");
MessageBox.Show(" result=" + gt.process);
}

//Class Library: Trans.class

....

public class Trans
{
private string order_id;
private string amt;

public TransactionVO(){}

public string OrderID
{
get
{
return order_id;
}
set
{
order_id = OrderID;
}
}

public string TotalAmount
{
get
{
return amt;
}
set
{
amt = OrderID;
}
}
public Init(string id, string amt)
{
this.orderID = id;
this.TotalAmount = amt;
}
}

Is there anybody has the same problem like me? Or is there any good ideas?
Please help me out.

Thanks a lot.

Grace

Nov 23 '05 #1
0 1315

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Java Web Services | last post by:
Hi, I am invoking a JAXM SAAJ based Web Service from a Standalone Client.. Sometime back the application was working fine, but suddenly I encountered this exception. This is the exception...
3
by: Yitzhak | last post by:
I am having "Permission denied" error while calling LogEvent method of WScript.Shell component. Basically, ASP page calls Windows Script Host Shell component to log events to the OS Application...
2
by: Jeff | last post by:
I am trying to dynamically load an assembly via reflection and then invoke a method of that assembly that will populate a custom type collection passed into the method byref. I am able to...
0
by: graciezzzzz | last post by:
Hi all, I create a Web Service project called 'eSelectService' and another Class Library project called 'MonerisVO', and a Windows Form project called 'maps' as well. The reason why I need...
2
by: Ajit | last post by:
Is it possible to have a web service name in localized string. Let's say, can I have a web service developed in C# having class name in Japanese? I am trying to build a web service as follows ...
0
by: swatitalati | last post by:
Hello when i invoke a method of web service i m getting error like Server was unable to process request. --> Requested registry access is not allowed. syntex for invoking method is as below ...
5
by: mahesh.nimbalkar | last post by:
When I transform XML, XSLT automatically adds extra attributes to the node which are declared in DTD (default DTD attributes) . I just want XSLT not to add these extra default attributes from DTD....
3
by: Rotsey | last post by:
Hi, I am getting a Exception has been thrown by the target of an invocation error when invoking a method Here is the crux of the code. I realise it could be a few things, any one give me...
0
by: Niks | last post by:
I am facing a very strange problem in my websevice which is working on socket communication. While i am publishing my webservice to the IIS and invoking a method, a data loss problem in occuring....
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.