473,548 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Cl assLibraries.Tu rabsLogExeption {
[Serializable]
public class TurabsException Carrier
{
public TurabsException Carrier()
{}

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

A method in my webservice rescives this TurabsException Carrier object like
this:
[WebMethod]
public void SaveExceptionTo DB(TurabsExcept ionCarrier TEC)

In my Asp.net application i have to instantiate a TurabsException Carrier
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 TurabsException Carrier 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...Ban g. No
i have to diffenitions on TurabsException Carrier.

the ONLY solution i have found is to make the webreference and manually
remove the TurabsException Carrier 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 1685
I think that manually editing Proxys is needed in most cases.

"Flare" <dc*******@hotm ail.com> wrote in message
news:uW******** ******@TK2MSFTN GP10.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.Cl assLibraries.Tu rabsLogExeption {
[Serializable]
public class TurabsException Carrier
{
public TurabsException Carrier()
{}

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

A method in my webservice rescives this TurabsException Carrier object like
this:
[WebMethod]
public void SaveExceptionTo DB(TurabsExcept ionCarrier TEC)

In my Asp.net application i have to instantiate a TurabsException Carrier
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 TurabsException Carrier 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...Ban g. No i have to diffenitions on TurabsException Carrier.

the ONLY solution i have found is to make the webreference and manually
remove the TurabsException Carrier 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.....stupi d....

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*******@hotm ail.com> wrote in message news:<uW******* *******@TK2MSFT NGP10.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.Cl assLibraries.Tu rabsLogExeption {
[Serializable]
public class TurabsException Carrier
{
public TurabsException Carrier()
{}

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

A method in my webservice rescives this TurabsException Carrier object like
this:
[WebMethod]
public void SaveExceptionTo DB(TurabsExcept ionCarrier TEC)

In my Asp.net application i have to instantiate a TurabsException Carrier
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 TurabsException Carrier 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...Ban g. No
i have to diffenitions on TurabsException Carrier.

the ONLY solution i have found is to make the webreference and manually
remove the TurabsException Carrier 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
3032
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 charaters have been replaced. e.g "<" is replaced with "%3C", ">" is replaced with "%3E"
4
7687
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 System account), th BL is called from the WS. So in my Business layer I've added code to start and close the form, but I get the error: "It is...
3
7706
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 value for the UserName token. Is it possilbe at all to do this from VBScript (or jscript?)? I know I will be limited with what I can do with the SOAP...
1
2846
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 types and of more elaborate classes implementing IXmlSerializable. The resulting WSDL file for the webservice has two separate schemas in its <types>...
0
1108
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 Webservice. When sending, there's an exception thrown telling me the operation timed out. Funny thing is that this ALWAYS happens the first time. When i send...
2
3024
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 windows forms applications in different shop locations but all have to update a Web based database with products sold etc Is Web services the way to...
10
9736
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 returned. So the username and password should be ok. I'm using this code: Merchant myMerch = new Merchant();...
2
9772
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 array. Thus i'm converting a byte array to sbyte array and sending through web service. The converted SByte contains negative numbers wihch are resulting...
0
7512
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
1
7466
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6036
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5362
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5082
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3495
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3475
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1051
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
751
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.