I have a custom object that I have written which is serializable. I have
put this object in it's own dll which is referenced by both the WebService
and the Application using it. My problem is the WebService Proxy creates
it's own implementation of my CustomObject which is causing issues.
Is there some way to mark my object to use it's own namespace instead of
using the namespace of the object being recreated by the WebService Proxy?
I have a Public Static Method which is used to instantiate a new object,
load some default values and return the new object to be loaded with the
data before passing it to the webservice. The problem is the WebService
Proxy version of my custom object does not have the Public Static Method on
it. Is there a way to resolve this (besides making the constructor public)? 2 1361
Hi pal, as far as i can understand your problem, i see that the point here is that you have a custom class server-side defined, and that class is used and wrapped by 2 different webservices. The other problem is that you can't use the public static constructor client-side.
Well i hope it helps, here is my answer.
First of all, i think you won't be able to use that constructor, because the wrapped classes (objects autogenerated by the WSDL to use as proxies) only have the properties, as member variables, of the server-side custom class and the default constructor i.e. MyClass().
For the other problem the solution is to modify the reference file, because if you use xml namespaces you will continue with the same problem. To explain this let's use an example:
Suppose that you have defined a Serializable MyClass, and two webservices MyService1 and MyService2, and both use MyClass. Then, when you generate the proxies you have MyService1.MyCl ass and MyService2.MyCl ass as not compatible or casteable client-side classes. So what you have to do is to edit the reference.cs of one of the webreferences (remember to push the "See all files" button to see this file in the Solution Explorer). Now, in the file, delete de wrapper class MyClass and a "using" directive (using MyClientProject .MyService1;), and the problem is solved, MyClass will be unique for both webservices.
Hope it helps, Bye.
---
Posted via www.DotNetSlackers.com
The public static functionality makes sense as WSDL is simple by design...
My questions is on a slightly different path though. I'm only working with
a single WebService (at this point). I was mainly looking for some
attribute tag or Interface which can be declared in my Serializable
class/object which would cause both the WebService and the Proxy class
generated by WSDL to use the same namespace of my custom object (similar to
a DataSet or a DataTable). This way my client side app which consumes the
WebService can expect the object as intantiated in the WebService instead of
the one created by the Proxy Class via WSDL. In other words when returning
something of type DataTable from a WebService, the Proxy Class actually
creates a return type of System.Data.Dat aTable and not
CustomWebServic e.Proxy.DataTab le.
<Sebastian Ca?uetowrote in message
news:eC******** *****@TK2MSFTNG P02.phx.gbl...
Hi pal, as far as i can understand your problem, i see that the point here
is that you have a custom class server-side defined, and that class is
used and wrapped by 2 different webservices. The other problem is that you
can't use the public static constructor client-side.
Well i hope it helps, here is my answer.
First of all, i think you won't be able to use that constructor, because
the wrapped classes (objects autogenerated by the WSDL to use as proxies)
only have the properties, as member variables, of the server-side custom
class and the default constructor i.e. MyClass().
For the other problem the solution is to modify the reference file,
because if you use xml namespaces you will continue with the same problem.
To explain this let's use an example:
Suppose that you have defined a Serializable MyClass, and two webservices
MyService1 and MyService2, and both use MyClass. Then, when you generate
the proxies you have MyService1.MyCl ass and MyService2.MyCl ass as not
compatible or casteable client-side classes. So what you have to do is to
edit the reference.cs of one of the webreferences (remember to push the
"See all files" button to see this file in the Solution Explorer). Now, in
the file, delete de wrapper class MyClass and a "using" directive (using
MyClientProject .MyService1;), and the problem is solved, MyClass will be
unique for both webservices.
Hope it helps, Bye.
---
Posted via www.DotNetSlackers.com This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Thomas D. |
last post by:
Situation:
---------------------------
I have an 'export'-wrapper to my regular objects. For each regular object
there is also an export object. An export object derives from the regular
object and has for each property in the base object an extra boolean
property. That extra properties tells wether to include the base property in
the final export (= webservice) or not. That is because not all the
properties may be exposed all the time...
|
by: hellrazor |
last post by:
Hi there,
I'm very new to dot net programming and webservices programming. I've
managed to create simple webservices so far.
Here's my problem:
-I've been given a project which needs to have a proprietary algorithm
split into a webservice.
|
by: Sky Sigal |
last post by:
(PS: Cross post from microsoft.pulic.dotnet.framework.aspnet.webcontrols)
I've been looking lately for a way to keep the Properties panel for Controls
'clean'...
My goal is to keep similar public properties of a custom Control neatly tied
together -- rather than all over the IDE.
One such set of values that will rarely be changed, so should have little
priority in the IDE Properties panel, and therefore a good candidate for
|
by: mtv |
last post by:
Hi all,
I have the following code:
================================
Webservice side:
public class MyWS: WebService
{
private myLib.DataObject curDataObject;
|
by: Noel |
last post by:
Hello,
I'm currently developing a web service that retrieves data from an employee
table. I would like to send and retrieve a custom employee class to/from the
webservice. I have currently coded the custom employee class and have built
it as a separate library (employee.dll). This employee.dll is being
referenced by both the web service and the windows application.
I face the following problem when I send this class to the webservice.
| |
by: |
last post by:
Hi all, I have a question on reflection
Lets say I have a custom object called Address. Now, lets say I have a
string variable that holds the name of a variable in the object such as
"State.StateCode". How can I reflect upon the Address object so as to echo
the value contained in the string variable. Something like:-
Dim add as new Address
add.State.StateCode = "TX"
Dim str as string = "State.StateCode"
|
by: Brian Henry |
last post by:
Ok I've never implemented a snap location before so I dont really know what
im doing wrong here... anyways, I am making a custom slider control that
takes dates as its values instead of integers... then taking that date range
and finding dates specifiec between them (in a list of dates) and putting
snap marks, so if you slide it near one of them it should snap to that tick,
but that part i cant figure out. the rest seems ok so far... here...
|
by: Techno_Dex |
last post by:
Has anyone come up with a slick way to make Custom Serializable Objects to
behave like DataSets when using WebServices? What I'm looking for is some
way to force the WSDL generated code to create a reference to my custom
object's namespace instead of creating it's own copy of the object in it's
own WS namespace. Either that, or some easy way to move all of the
properties from the Custom Serializable Object into the WSDL generated
object...
|
by: Greger |
last post by:
Hi,
I am building an architecture that passes my custom objects to and from
webservices. (Our internal architecture requires me to use webservices to any
suggestion to use other remoting techniques are not feasible)
The question is;
Given that I have a Person object with a private set for id.
What is the recommended approac in passing that object to the web service
|
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 usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |