473,770 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 "SubjectLis t" 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 SubjectListSubj ect
classes called Subject as a member variable. Ideally i would prefer the
"SubjectListSub ject" 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.Ser ialization.XmlT ypeAttribute([Namespace]:="http://localhost/ns/Subjects")>
_

Public Class SubjectList

<System.Xml.Ser ialization.XmlE lementAttribute ("Subject")> _

Public Subject() As SubjectListSubj ect

'WOULD PREFER

'Public Subjects() As Subject

End Class

<System.Xml.Ser ialization.XmlT ypeAttribute([Namespace]:="http://localhost/ns/Subjects")>
_

Public Class SubjectListSubj ect

'WOULD PREFER

'Public Class Subject

Public ID As String

Public Name As String

<System.Xml.Ser ialization.XmlE lementAttribute (DataType:="int eger")> _

Public SubjectCount As String

<System.Xml.Ser ialization.XmlE lementAttribute (DataType:="int eger")> _

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"
elementFormDefa ult="qualified" attributeFormDe fault="qualifie d"
targetNamespace ="http://localhost/ns/Subjects"
xmlns="http://localhost/ns/Subjects">
<xs:element name="SubjectLi stRequest" type="xs:string "></xs:element>
<xs:element name="SubjectLi st">
<xs:complexType >
<xs:sequence maxOccurs="unbo unded">
<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="SubjectCo unt" type="xs:intege r"/>
<xs:element name="DocumentC ount" type="xs:intege r"/>
</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="htt p://schemas.xmlsoap .org/wsdl/soap/">

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

<types/>

<message name="RequestMe ssage">
<part name="SubjectLe vel" element="s0:Sub jectListRequest " />
</message>
<message name="ResponseM essage">
<part name="SubjectLi st" element="s0:Sub jectList" />
</message>

<portType name="PortTypeN ame">
<operation name="GetSubjec ts">
<input message="s0:Req uestMessage" />
<output message="s0:Res ponseMessage" />
</operation>
</portType>

<binding name="SubjectsB ase" type="s0:PortTy peName">
<soap:binding
transport="http ://schemas.xmlsoap .org/soap/http"
style="document "
/>

<operation name="GetSubjec ts">
<soap:operati on soapAction="htt p://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 1418

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

Similar topics

1
9904
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 more operations were skipped. Warnings were encountered. Review generated source comments for more details.
4
5583
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 elementFormDefault="qualified" targetNamespace="http://www.test.com/"> <s:import namespace="http://www.test.com/" /> <s:element name="Process"> <s:complexType>
4
8106
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 POST methode. What benefits does a wsdl web service have? If we develope a web service should it be wsdl enabled or not?
3
3057
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 defined by hand). The .NET client on the other hand does not work at all and i get this error when i send the request. Failed to access class (2001::XMLSchema): syntax error at (eval 91) line 1, near "require 2001"
5
4915
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 that any elements that are nested elements in the schema (not global elements) have their namespaces set to the null namespace. I can see that the proxy classes have serialization attributes specifying these nested elements as unqualified: ///...
13
3436
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 error from the WSDL utility. Error: Unable to import binding 'REMSOAPHttpsBinding' from namespace 'http://www.fnfis.com/services/Services-Common/REM/20040109/v1.0'. - The operation 'REMCorporationBPOOrder' on portType 'REMInterface' from...
0
1279
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"/> </wsdl:message> <wsdl:message name="OpSoapOut">
2
16096
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. try to generate the WebService interface using wsdl.exe: C:\>wsdl /serverInterface /protocol:SOAP my.xsd 5. An error occurs and no classes are generated (see below) and Interface.cs
0
1386
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 of a package). However it runs on the Java Platform and by the looks of it uses Soap with Attachments which is not supported by Microsoft natively at present. I have checked the validity of the WSDL using the Altova WSDL
0
9618
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, 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...
0
9454
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,...
0
10260
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, 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...
0
10101
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 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...
0
9906
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
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...

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.