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

BIG problem when sending complex datatype to a webservice

OK. I'll try explain my problem so simple as possible.

I have to send a complex data type to a WebService from a Asp.net
webapplication.

My Data type look like this. (A class with a porperty)

-------------
namespace Elsam.Turabs.ClassLibraries.TurabsLogExeption{
[Serializable]
public class TurabsExceptionCarrier
{
public TurabsExceptionCarrier()
{}

private DateTime m_TimeOccured = DateTime.MinValue;
public DateTime TimeOccured
{
public DateTime TimeOccured
{
set { m_TimeOccured = value; }
get { return m_TimeOccured; } }}
-------------

A method in my webservice rescives this TurabsExceptionCarrier object like
this:
[WebMethod]
public void SaveExceptionToDB(TurabsExceptionCarrier TEC)

In my Asp.net application i have to instantiate a TurabsExceptionCarrier
object, fill it, and send it to my webservice method....

I do this by creating a webreference with Visual studio .net 2003. BUT. the
proxy class's TurabsExceptionCarrier object and the one in my ASP.net
application is in diffrent namespaces now, and is therefor apperently not
compatible. hmmmmmm. Right it try to force them in same namespace...Bang. No
i have to diffenitions on TurabsExceptionCarrier.

the ONLY solution i have found is to make the webreference and manually
remove the TurabsExceptionCarrier wich is created in my proxy. But tha means
i have to do this every time i update my webreference.

Was that clear at all?

REALLY hope someone has a solution.

Regards
Anders, Denmark

Nov 17 '05 #1
4 1674
I think that manually editing Proxys is needed in most cases.

"Flare" <dc*******@hotmail.com> wrote in message
news:uW**************@TK2MSFTNGP10.phx.gbl...
OK. I'll try explain my problem so simple as possible.

I have to send a complex data type to a WebService from a Asp.net
webapplication.

My Data type look like this. (A class with a porperty)

-------------
namespace Elsam.Turabs.ClassLibraries.TurabsLogExeption{
[Serializable]
public class TurabsExceptionCarrier
{
public TurabsExceptionCarrier()
{}

private DateTime m_TimeOccured = DateTime.MinValue;
public DateTime TimeOccured
{
public DateTime TimeOccured
{
set { m_TimeOccured = value; }
get { return m_TimeOccured; } }}
-------------

A method in my webservice rescives this TurabsExceptionCarrier object like
this:
[WebMethod]
public void SaveExceptionToDB(TurabsExceptionCarrier TEC)

In my Asp.net application i have to instantiate a TurabsExceptionCarrier
object, fill it, and send it to my webservice method....

I do this by creating a webreference with Visual studio .net 2003. BUT. the proxy class's TurabsExceptionCarrier object and the one in my ASP.net
application is in diffrent namespaces now, and is therefor apperently not
compatible. hmmmmmm. Right it try to force them in same namespace...Bang. No i have to diffenitions on TurabsExceptionCarrier.

the ONLY solution i have found is to make the webreference and manually
remove the TurabsExceptionCarrier wich is created in my proxy. But tha means i have to do this every time i update my webreference.

Was that clear at all?

REALLY hope someone has a solution.

Regards
Anders, Denmark

Nov 17 '05 #2
> I think that manually editing Proxys is needed in most cases.

It just seems quite.....stupid....

Anders
Nov 17 '05 #3
The problem is becuase when you generate your proxy the type
definition falls under your proxy class namespace. You should use this
type instead when passing it up to the webservice. The webservice will
figure the rest out.
We had the same problem when we tried to create an assembly that
contained nothing but type definitions on both the client side and the
server side. But because the proxy puts the types in it's own
namespace we couldn't pass our known type in the assembly to the proxy
because it expected it's own type in it's own namespace.
So simply expose your webservice and create a proxy for it. Then on
the client use the type definition for your object that will be
created within the proxy namespace.
If you absolutly need them to fall in the same namespace you will have
to modify the proxy each time you re-generate it. To modify the proxy
simply delete your type definition from it and add a 'using
MyAssembly' at the top of the class.

Darren Mombourquette.

"Flare" <dc*******@hotmail.com> wrote in message news:<uW**************@TK2MSFTNGP10.phx.gbl>...
OK. I'll try explain my problem so simple as possible.

I have to send a complex data type to a WebService from a Asp.net
webapplication.

My Data type look like this. (A class with a porperty)

-------------
namespace Elsam.Turabs.ClassLibraries.TurabsLogExeption{
[Serializable]
public class TurabsExceptionCarrier
{
public TurabsExceptionCarrier()
{}

private DateTime m_TimeOccured = DateTime.MinValue;
public DateTime TimeOccured
{
public DateTime TimeOccured
{
set { m_TimeOccured = value; }
get { return m_TimeOccured; } }}
-------------

A method in my webservice rescives this TurabsExceptionCarrier object like
this:
[WebMethod]
public void SaveExceptionToDB(TurabsExceptionCarrier TEC)

In my Asp.net application i have to instantiate a TurabsExceptionCarrier
object, fill it, and send it to my webservice method....

I do this by creating a webreference with Visual studio .net 2003. BUT. the
proxy class's TurabsExceptionCarrier object and the one in my ASP.net
application is in diffrent namespaces now, and is therefor apperently not
compatible. hmmmmmm. Right it try to force them in same namespace...Bang. No
i have to diffenitions on TurabsExceptionCarrier.

the ONLY solution i have found is to make the webreference and manually
remove the TurabsExceptionCarrier wich is created in my proxy. But tha means
i have to do this every time i update my webreference.

Was that clear at all?

REALLY hope someone has a solution.

Regards
Anders, Denmark

Nov 17 '05 #4
> The problem is becuase when you generate your proxy the type
definition falls under your proxy class namespace. You should use this
type instead when passing it up to the webservice. The webservice will
figure the rest out.
We had the same problem when we tried to create an assembly that
contained nothing but type definitions on both the client side and the
server side. But because the proxy puts the types in it's own
namespace we couldn't pass our known type in the assembly to the proxy
because it expected it's own type in it's own namespace.
So simply expose your webservice and create a proxy for it. Then on
the client use the type definition for your object that will be
created within the proxy namespace.
If you absolutly need them to fall in the same namespace you will have
to modify the proxy each time you re-generate it. To modify the proxy
simply delete your type definition from it and add a 'using
MyAssembly' at the top of the class.


Ok. Could sound like an solution. Ill try that tomorrow on work. Thx alot
for now :)

Anders
Nov 17 '05 #5

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

Similar topics

2
by: anonymous | last post by:
Hi, I'am sending an xml string to a web service(which is written in c#) using the microsoft web services behavior. When I check this string from the web service I observed that some of the...
4
by: anders | last post by:
I have a 'solution' with a Webservice, Business layer and a data layer. In the Business layer I've added a form that need to be started on the server(this site has full rights, runs with Local...
3
by: Sydney | last post by:
Hi, I am trying to construct a WSE 2.0 security SOAP request in VBScript on an HTML page to send off to a webservice. I think I've almost got it but I'm having an issue generating the nonce...
1
by: louis_la_brocante | last post by:
Dear all, I am having trouble generating a client proxy for a webservice whose methods return a "complex" type. The type is complex in that it is a class whose members are a mix of primitive...
0
by: Willem_at_work | last post by:
Hi, I've got an application on a PDA that interacts with a webservice through a wireless connection. All data transfers work fine, untill i try to send a DataSet from the PDA to the...
2
by: steve | last post by:
Hi All I need to learn how to update a SQl server or Access database located on a web server from my windows forms application, via the internet I have a customer who wants to run several...
10
by: Anton | last post by:
Hi, when accessing a secured 3rd party webservice i'm getting a 401 HTTP Statuscode (unauthorized). When entering the url in a browser and entering the username and password manually, the wsdl is...
2
by: ksheerasagar17 | last post by:
Hello All, Scenario: Sending an image through webservice as byte array to an Java webservice. The Problem1: The webservice method image property expects (data type) SByte rather than Byte...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.