Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > WebService proxy class naming

Reply
Thread Tools

WebService proxy class naming

 
 
Paul
Guest
Posts: n/a
 
      07-31-2006
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="s1ersonResult" />
</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


 
Reply With Quote
 
 
 
 
Paul Wu
Guest
Posts: n/a
 
      08-01-2006
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
http://www.velocityreviews.com/forums/(E-Mail Removed)




>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="s1ersonResult" />
> </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
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
while executing my client program i get the exception javax.naming.LinkException: [Root exception is javax.naming.LinkException: [Root exception is javax.naming.NameNotFoundException: remaining if plz anybody know how to solve this problem then mahesh Java 0 03-08-2007 12:26 PM
Javax.naming Exception: name not found in naming service. Harman Java 1 07-28-2006 08:51 AM
Error creating Proxy Class for XMethods Currency Converter WebService. Joydeep ASP .Net Web Services 1 12-07-2005 10:36 AM
Problem generating c# proxy class from IBM websphere (AXIS) webservice WSDL. ffhansix@hotmail.com ASP .Net Web Services 2 03-10-2005 07:01 AM
Call a webservice with out using proxy class Madjid Nasiri ASP .Net Web Services 5 11-21-2004 06:31 AM



Advertisments