473,398 Members | 2,212 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,398 software developers and data experts.

Creating a new Class over a webService

C#

I am developing a basic app to run on a mobile device, to interact with our
central server using WebServices. I have created a class called PacketInfo
which has a couple of properties suchs as CreateDate RecieveDate and Message.
I created this classs in a new project called MAMI, built this in Release
mode to give me a MAMI.dll.

I have added a reference to this dll in my WebService code on the central
server, and I have a WebMethod which accepts a MAMI.PacketInfo object and
sets some values in it.

[WebMethod]
public void Check(MAMI.PacketInfo packet)
{
packet.Message = "I am Here";
}

On my mobile device app I have also added a reference to the MAMI.dll, and
in here I have a WebReference to my Webservice setup. I have this code on my
mobile device:

MAMI.PacketInfo packet = new MAMI.PacketInfo()

webService.Check(packet);
MessageBox.Show(packet.Message);

The build fails though on the Mobile side, as it says I cant convert
MAMI.PacketInfo to webMAM.wsMan.PacketInfo.

Can someone point me in the right direction. Should I be doing it this way?
The idea behind this was that everytime I send a message/call from the
mobile device to the central server I can send a load of information about
the message, such as success or error messages etc etc, so I thought I could
send an instance of my PacketInfo class with the call.

Thanks

Ste
Jan 25 '06 #1
1 1001
I had this same situation. What causes it is that when you reference
the web service, it create proxy classes with the same properties as
your classes.

What I did to get around it was to open the generated proxy classes,
remove the duplicate class definitions and import my classes. That way
the web service is looking for my classes and not its own generated
classes.

The drawback to this approach is that if you ever change the web
service and have to refresh the reference in VS, then new proxy classes
will be generated and you will have to do over again.

Jan 26 '06 #2

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

Similar topics

3
by: gregory_may | last post by:
Below is a routine I use for creating log files. It works great on most VB Applications. However, for web services, it needs some help. The problem is I cant reflect properly into a web service...
1
by: Jeevan | last post by:
Hi , I am working on developing an ASP.NET server control that is based on AJAX and need to call a webservice on a remote domain. To avoid the security warning from IE , I created a proxy...
1
by: Jon Ebersole | last post by:
I am developing a webservice and a windows application that talk to each other. They are using a standard VB class library in the background. I am having problems understanding why I can't sync my...
2
by: Bert Leu | last post by:
Hi I understand, that the "normal way" in creating Web Services is: Creating Web Service -- WSDL -- Creating Client Unfortunately, I have to create a Web Service (Service, not Clinet) from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.