473,387 Members | 1,464 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,387 software developers and data experts.

can wsdl's choice of class names be changed?

Hi everyone,

I've been going through an article i found on MSDN
(http://msdn.microsoft.com/msdnmag/is...ervicesDesign/)
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.

CODE SNIPPET:

<System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://localhost/ns/Subjects")>
_

Public Class SubjectList

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

Public Subject() As SubjectListSubject

'WOULD PREFER

'Public Subjects() As Subject

End Class

<System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://localhost/ns/Subjects")>
_

Public Class SubjectListSubject

'WOULD PREFER

'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
XSD SCHEMA:

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="qualified"
targetNamespace="http://localhost/ns/Subjects"
xmlns="http://localhost/ns/Subjects">
<xs:element name="SubjectListRequest" type="xs:string"></xs:element>
<xs:element name="SubjectList">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element name="Subject">
<xs:complexType>
<xs:sequence>
<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"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

WSDL FILE :

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

<definitions
xmlns="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://localhost/ns/Subjects"
xmlns:s0="http://localhost/ns/Subjects"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">

<import
namespace="http://localhost/ns/Subjects"
location="http://localhost/ns/BBS_Schema.xsd"
/>

<types/>

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

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

<binding name="SubjectsBase" type="s0:PortTypeName">
<soap:binding
transport="http://schemas.xmlsoap.org/soap/http"
style="document"
/>

<operation name="GetSubjects">
<soap:operation soapAction="http://localhost/BBS/GetSubjects"
style="document" />
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
</definitions>
thanks,
Andrew
Jun 28 '06 #1
0 1357

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...
4
by: Mike | last post by:
I have a web service being consume by a new client. The WebMethod they are calling is called Process. So in the WSDL I have has 2 elements, Process and ProcessResponse. <s:schema...
4
by: MyName | last post by:
What is the advantage of a WSDL web service over an API that will be running as an XML engine accessible via an HTTP address over a special port? The client needs to access the API using the HTTP...
3
by: Ben Crinion | last post by:
Hi im having a few problems consuming a SOAP::Lite web service. I think the problem is actually with the WSDL but im not sure. I have a SOAP::Lite client which works ok using the WSDL (which i...
5
by: CindyRob | last post by:
Using .NET framework 1.1 SP1, .NET framework SDK 1.1 SP1, Visual Studio .NET 2003, hotfixes 892202 and 823639. I create a proxy class using wsdl.exe, and in the serialized XML request, I see...
13
by: ScottM | last post by:
I have run into a problem generating the class file via the WSDL utility. I have a WSDL file that was generated by XMLSpy and is able to be read by the Java code utility, but I get the following...
0
by: John Saunders | last post by:
I don't have time for a reproducer now, but I thought I'd post this and then go vent. I'm very angry. <wsdl:message name="OpSoapIn"> <wsdl:part name="parameters" element="tns:Op"/> ...
2
by: =?Utf-8?B?TWlnaHR5IE1hcms=?= | last post by:
I'd like to generate my WebService interface from an XSD schema. Here's what I've done: 1. created a XML file 2. use the xsd.exe to generate the XSD: C:\>xsd my.xml 3. my.xsd is generated 4....
0
by: =?Utf-8?B?S2FydW5ha2Fy?= | last post by:
Hi Everyone, I have reached a dead end in trying to solve the following problem. I have been given this wsdl that is already in operation in production systems throughtout the world (its part...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
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,...
0
jinu1996
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...

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.