WSDL and XSD Design | Which design is perfect
Appasamy Thirugnana <[email protected]> Wed, 11 Nov 2009 11:52:17 +0530
| Newsgroups | gmane.text.xml.axis.user,gmane.comp.web.services.description |
|---|---|
| Message-ID | <[email protected]> |
--_000_A174AAD0831A0647A9DD2993F579B62717676F3EE3BANGMAILsapie_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Hi,
I have a WSDL defining fault as given below
1. ....
....
<wsdl:message name=3D"InvalidPINInfo">
<wsdl:part name=3D"parameter" element=3D"error:errorFault"/=
>
</wsdl:message>
.....
<wsdl:portType name=3D"TravelAccount">
<wsdl:operation name=3D"RegisterUser">
<wsdl:input message=3D"tns:RegisterUserRequest"/>
<wsdl:output message=3D"tns:RegisterUserResponse"/>
<wsdl:fault name=3D"InvalidPINInfo" message=3D"tns:InvalidPINI=
nfo"/>
</wsdl:operation>
....
2. I got suggestion from one of the forums to change "InvalidPINInfo" as fo=
llows to minimize changes in WSDL in future if fault definition needs to ch=
anged
<wsdl:message name=3D"InvalidPINInfo">
<wsdl:part name=3D"parameter" element=3D"account:InvalidPIN=
Info"/>
</wsdl:message>
and then define in one of the XSDs as follows(Indirect mapping), so f=
uture change only needs XSD changes
<xs:element name=3D"InvalidPINInfo" type=3D"error:errorFault"/>
Questions:
1. So always WSDL design needs to be taken care that it should not change o=
ften?
2. Even if it is XSD change it is a Service contract change.Not only WSDL. =
Is it right?
Thanks,
Appasamy
--_000_A174AAD0831A0647A9DD2993F579B62717676F3EE3BANGMAILsapie_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.6000.16788" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D597021206-11112009>Hi,</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D597021206-11112009> </SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D597021206-11112009> I have a WSDL def=
ining=20
fault as given below</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D597021206-11112009></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D597021206-11112009>1. &nbs=
p; =20
....</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D597021206-11112009> =
=20
....</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D597021206-11112009> =
=20
<FONT color=3D#000096><wsdl:message</FONT><FONT color=3D#f5844c> name</F=
ONT><FONT=20
color=3D#ff8040>=3D</FONT><FONT color=3D#993300>"InvalidPINInfo"</FONT><FON=
T=20
color=3D#000096>></FONT><BR><FONT=20
color=3D#000096>  =
; =20
<wsdl:part</FONT><FONT color=3D#f5844c> name</FONT><FONT=20
color=3D#ff8040>=3D</FONT><FONT color=3D#993300>"parameter"</FONT><FONT col=
or=3D#f5844c>=20
element</FONT><FONT color=3D#ff8040>=3D</FONT><FONT=20
color=3D#993300>"error:errorFault"</FONT><FONT color=3D#000096>/></FONT>=
<BR><FONT=20
color=3D#000096>  =
;=20
</wsdl:message></FONT></SPAN></FONT></DIV>
<DIV><FONT face=3DArial color=3D#000096 size=3D2><SPAN=20
class=3D597021206-11112009> =
=20
.....</SPAN></FONT></DIV>
<DIV><FONT color=3D#000096><SPAN class=3D597021206-11112009><FONT color=3D#=
000096>
<P><FONT face=3DArial><FONT size=3D2><SPAN=20
class=3D597021206-11112009> </SPAN><wsdl:portType</FONT></FONT></FO=
NT><FONT=20
face=3DArial><FONT size=3D2><FONT color=3D#f5844c> name</FONT><FONT=20
color=3D#ff8040>=3D</FONT><FONT color=3D#993300>"<SPAN=20
class=3D597021206-11112009>Travel</SPAN>Account"</FONT>><BR><SPAN=20
class=3D597021206-11112009> =20
</SPAN><wsdl:operation<FONT color=3D#f5844c> name</FONT><FONT=20
color=3D#ff8040>=3D</FONT><FONT color=3D#993300>"RegisterUser"</FONT>><B=
R><SPAN=20
class=3D597021206-11112009> =
=20
</SPAN><wsdl:input<FONT color=3D#f5844c> message</FONT><FONT=20
color=3D#ff8040>=3D</FONT><FONT=20
color=3D#993300>"tns:RegisterUserRequest"</FONT>/><BR><SPAN=20
class=3D597021206-11112009> =
=20
</SPAN><wsdl:output<FONT color=3D#f5844c> message</FONT><FONT=20
color=3D#ff8040>=3D</FONT><FONT=20
color=3D#993300>"tns:RegisterUserResponse"</FONT>/><BR><SPAN=20
class=3D597021206-11112009> =
=20
</SPAN><wsdl:fault<FONT color=3D#f5844c> name</FONT><FONT=20
color=3D#ff8040>=3D</FONT><FONT color=3D#993300>"InvalidPINInfo"</FONT><FON=
T=20
color=3D#f5844c> message</FONT><FONT color=3D#ff8040>=3D</FONT><FONT=20
color=3D#993300>"tns:InvalidPINInfo"</FONT>/><BR><SPAN=20
class=3D597021206-11112009> =20
</SPAN></wsdl:operation></FONT></FONT></P>
<P><FONT><SPAN class=3D597021206-11112009><FONT face=3DArial=20
size=3D2>....</FONT></SPAN></FONT></P>
<P><FONT><SPAN class=3D597021206-11112009><FONT face=3DArial=20
size=3D2></FONT></SPAN></FONT> </P>
<P><FONT><SPAN class=3D597021206-11112009><FONT face=3DArial size=3D2>2. I =
got=20
suggestion from one of the forums to change "<FONT=20
color=3D#993300>InvalidPINInfo"</FONT> as follows to minimize changes =
in WSDL=20
in future if fault definition needs to changed</FONT></SPAN></FONT></P>
<P><FONT><SPAN class=3D597021206-11112009><FONT face=3DArial size=3D2><FONT=
face=3DArial=20
size=3D2><SPAN=20
class=3D597021206-11112009> =
=20
<FONT color=3D#000096><FONT color=3D#000096><wsdl:message</FONT><FONT=20
color=3D#f5844c> name</FONT><FONT color=3D#ff8040>=3D</FONT><FONT=20
color=3D#993300>"InvalidPINInfo"</FONT><FONT color=3D#000096>></FONT><BR=
><FONT=20
color=3D#000096>  =
; =20
<wsdl:part</FONT><FONT color=3D#f5844c> name</FONT><FONT=20
color=3D#ff8040>=3D</FONT><FONT color=3D#993300>"parameter"</FONT><FONT col=
or=3D#f5844c>=20
element</FONT><FONT color=3D#ff8040>=3D</FONT><FONT=20
color=3D#993300>"account:InvalidPINInfo"</FONT><FONT=20
color=3D#000096>/></FONT><BR><FONT=20
color=3D#000096>  =
;=20
</wsdl:message></FONT></FONT></SPAN></FONT></FONT></SPAN></FONT></SPA=
N></FONT><FONT=20
face=3DArial color=3D#000096 size=3D2><SPAN=20
class=3D597021206-11112009> =
=20
</SPAN></FONT></P></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D597021206-11112009> and then def=
ine in=20
one of the XSDs as follows(Indirect mapping), so future change only needs X=
SD=20
changes</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D597021206-11112009> =
=20
</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D597021206-11112009> =
<FONT=20
color=3D#000096><xs:element</FONT><FONT color=3D#f5844c> name</FONT><FON=
T=20
color=3D#ff8040>=3D</FONT><FONT color=3D#993300>"InvalidPINInfo"</FONT><FON=
T=20
color=3D#f5844c> type</FONT><FONT color=3D#ff8040>=3D</FONT><FONT=20
color=3D#993300>"error:errorFault"</FONT><FONT=20
color=3D#000096>/></FONT></SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D597021206-11112009> =
=20
</SPAN></FONT></DIV>
<DIV align=3Dleft>
<DIV class=3DSection1>
<P class=3DMsoNormal align=3Dleft><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Verdana"><SPAN=20
class=3D597021206-11112009><FONT face=3DArial=20
color=3D#000000><STRONG><U>Questions:</U></STRONG></FONT></SPAN></SPAN></P>
<P class=3DMsoNormal align=3Dleft><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Verdana"><SPAN=20
class=3D597021206-11112009><FONT face=3DArial color=3D#000000>1. So always =
WSDL design=20
needs to be taken care that it should not change often?</FONT></SPAN></SPAN=
></P>
<P class=3DMsoNormal align=3Dleft><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Verdana"><SPAN=20
class=3D597021206-11112009><FONT face=3DArial color=3D#000000>2. Even if it=
is XSD=20
change it is a Service contract change.Not only WSDL. Is it=20
right?</FONT></SPAN></SPAN></P>
<P class=3DMsoNormal align=3Dleft><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Verdana"><SPAN=20
class=3D597021206-11112009><FONT face=3DArial=20
color=3D#000000></FONT></SPAN></SPAN><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Verdana"><SPAN=20
class=3D597021206-11112009><FONT face=3DArial=20
color=3D#000000></FONT></SPAN></SPAN> </P>
<P class=3DMsoNormal align=3Dleft><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Verdana"><SPAN=20
class=3D597021206-11112009><FONT face=3DArial=20
color=3D#000000>Thanks,</FONT></SPAN></SPAN></P>
<P class=3DMsoNormal align=3Dleft><SPAN=20
style=3D"FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: Verdana"><SPAN=20
class=3D597021206-11112009><FONT face=3DArial=20
color=3D#000000>Appasamy</FONT></SPAN></SPAN></P></DIV></DIV></BODY></HTML>
--_000_A174AAD0831A0647A9DD2993F579B62717676F3EE3BANGMAILsapie_--