469,148 Members | 1,567 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,148 developers. It's quick & easy.

can wsdl's choice of class names be changed?

Hi everyone,

I've been going through an article i found on MSDN
concerning designing the messages for a webservice in a schema (xsd) first
and then writing a .wsdl file that imports the schema. Following this i have
used wsdl.exe (that comes with framework 1.1) to generate an abstract class
which my webservice inherits from.

All has gone well with this until i actually looked at my abstract class -
some of the class and variable names do not seem ideal. Essentially I want
to return an xml root element called "SubjectList" which has a number of
"Subject" elements inside it. The XML looks great but wsdl.exe produces a
class with a SubjectList class that has an array of SubjectListSubject
classes called Subject as a member variable. Ideally i would prefer the
"SubjectListSubject" class to be renamed to just "Subject", also i would
like to rename the array to be called "Subjects" instead of "Subject". I
suppose these are just things that would make the proxy more usable. I'm
thinking i could alter the proxy myself but that wouldn't help me when non
..net languages use the wsdl to generate proxies in different languages.

I was hoping there was some additional way i could mark-up the wsdl file or
my xsd schema so wsdl.exe uses the appropriate names?

Sorry for the long post - i've included my wsdl file and xsd schema in case
it helps - also a code snippet showing how it currently looks and how i'd
prefer it to look.



Public Class SubjectList

<System.Xml.Serialization.XmlElementAttribute("Sub ject")> _

Public Subject() As SubjectListSubject


'Public Subjects() As Subject

End Class


Public Class SubjectListSubject


'Public Class Subject

Public ID As String

Public Name As String

<System.Xml.Serialization.XmlElementAttribute(Data Type:="integer")> _

Public SubjectCount As String

<System.Xml.Serialization.XmlElementAttribute(Data Type:="integer")> _

Public DocumentCount As String

End Class

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="qualified"
<xs:element name="SubjectListRequest" type="xs:string"></xs:element>
<xs:element name="SubjectList">
<xs:sequence maxOccurs="unbounded">
<xs:element name="Subject">
<xs:element name="ID" type="xs:string"/>
<xs:element name="Name" type="xs:string"/>
<xs:element name="SubjectCount" type="xs:integer"/>
<xs:element name="DocumentCount" type="xs:integer"/>


<?xml version="1.0" encoding="utf-8" ?>




<message name="RequestMessage">
<part name="SubjectLevel" element="s0:SubjectListRequest" />
<message name="ResponseMessage">
<part name="SubjectList" element="s0:SubjectList" />

<portType name="PortTypeName">
<operation name="GetSubjects">
<input message="s0:RequestMessage" />
<output message="s0:ResponseMessage" />

<binding name="SubjectsBase" type="s0:PortTypeName">

<operation name="GetSubjects">
<soap:operation soapAction="http://localhost/BBS/GetSubjects"
style="document" />
<soap:body use="literal"/>
<soap:body use="literal" />
Jun 28 '06 #1
0 1132

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Mike | last post: by
4 posts views Thread by MyName | last post: by
13 posts views Thread by ScottM | last post: by
reply views Thread by John Saunders | last post: by
2 posts views Thread by =?Utf-8?B?TWlnaHR5IE1hcms=?= | last post: by
reply views Thread by =?Utf-8?B?S2FydW5ha2Fy?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.