473,322 Members | 1,538 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,322 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 1239

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...
10
by: David | last post by:
Hi Everyone! I am working on a project for a directed study class and am having problems with webservices. I have .NET Framework version 1.1.4322.573 with IIS and Frontpage Extensions...
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.