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

WebService proxy class naming

I have simple web method like the following:

[WebMethod(Description = "Gets an instance of the Person class.",
MessageName = "Person")]
public Person GetPerson()
{
return CreatePerson();
}

When I compile the web service, it generates the following WSDL snippet:
<s:element name="PersonResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" ref="s1:PersonResult" />
</s:sequence>
</s:complexType>
</s:element>

On the WS consumer side, WDSL.EXE generates a "PersonResult" instead of a
"Person" class. Is there a way to decorate my WS code so the class generated
is named "Person"?
Paul
Jul 31 '06 #1
1 1007
In your web service's xml attribute decoration, make sure you provide the root element name to be used by the XmlSerializer. For example:

[System.Xml.Serialization.XmlRootAttribute(Namespac e="http://namespace", ElementName="Person")]
public class Person {}
-------------------------------------
Paul Wu
pa*****@biztalkdev.com

>I have simple web method like the following:

[WebMethod(Description = "Gets an instance of the Person class.",
MessageName = "Person")]
public Person GetPerson()
{
return CreatePerson();
}

When I compile the web service, it generates the following WSDL snippet:
<s:element name="PersonResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" ref="s1:PersonResult" />
</s:sequence>
</s:complexType>
</s:element>

On the WS consumer side, WDSL.EXE generates a "PersonResult" instead of a
"Person" class. Is there a way to decorate my WS code so the class generated
is named "Person"?
Paul

Aug 1 '06 #2

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

Similar topics

1
by: ffhansix | last post by:
Hi, I am having problems with generating a c# proxy class from a IBM websphere WSDL file, when running the wsdl.exe to create the c# proxy file command i recieve an error: Warning: one or...
5
by: Benne Smith | last post by:
Hi, I have three enviroments; a development, a testing and a production enviroment. I'm making a big application (.exe), which uses alot of different webservices. I don't use the webservices...
6
by: Davie | last post by:
I want to authorise a user of a web service by using the AuthHeaderValue for some reason I keep getting a null reference exception when I try to run the following code: It seems to work fine on a...
4
by: Flare | last post by:
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)...
7
by: stephan querengaesser | last post by:
hi ng, i try to invoke a webservice-method with an filter-object, that contains value types. if i don´t want to filter the return value of the method, i have to pass a new instance of the...
4
by: MacLanca | last post by:
Hi, I've done the HelloWorld WebService, installed in a WebServer (INTERNET) When I call it with Windows App it works, if I use a webform it doesn’t (INTERNET) Both of them work in the INTRANET...
7
by: Nalaka | last post by:
Hi, I created a sinple web service that returns a dataSet. Then I created a client program that uses this web service (that returns the Dataset). My question is, how did the client figure...
2
by: Techno_Dex | last post by:
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...
3
by: Mark | last post by:
I'm consuming a webservice that makes a simple object available. The object class is marked in the web service as . I have a web application that consumes and uses this web service's class. When...
0
by: joymac | last post by:
How to create a proxy class for a webservice? I have a simple webservice ("Hello World") and I am trying to create a proxy class for this webservice using below command - wsdl /l:CS...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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...
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...

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.