why XSD apart from WSDL

gudii9
gudii9 used Ask the Experts™
on
for consuming web service apart from WSDL why we need to provide XSD of XML again?

WSDL it self has all information about request and responses right?

in <wsdl:types> element of wsdl has the xsd name in it?
xmls:tns means what in wsdl
what is
xmlns:soap means?
targetNamespace="http://xyz.com/courses"> means what?
in <wsdl:types> what is <xs:complexType name="courseDetails"> means?
why we use it?
Please advise with any good links, references, code examples, video tutorials etc
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Distinguished Expert 2018

Commented:
The WSDL, without the <types> element, does not define the types, only the operations. If you want to define the types you need to use the <types> element with an embedded or external schema (xsd).

The xmlns:soap means that the types are taken from the soap namespace.

For understanding schema namespaces have a look here.

Author

Commented:
The WSDL, without the <types> element, does not define the types, only the operations. If you want to define the types you need to use the <types> element with an embedded or external schema (xsd).

Type element defined in WSDL right not XSD

Lets say i develop web service application and i need to expose to my client  named xyz

In this case why i have to give xyz XSD as well apart from WSDL

Any end to end examples, links, resources on this

Please advise
Theo KouwenhovenApplication Consultant
Commented:
Hi Gudii9,

"WSDL it self has all information about request and responses right?"

In case of a perfect world you are right but:
Wsdl is describing the webservice and the Xsd is describing the encapsulated data.
Normally it would be a part of the wsdl, but I see a lot of lazy developers who are seperating the two.

So you get one wsdl for all webservices containing an <any> element that can contain "any" data.
I even see that they don't use an <any> element, but use there own tag.
Most of these cases there art 2 tags <messageType/> and <messageData/>, so that you are able to tell what kind of message you are sending.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Distinguished Expert 2018

Commented:
In this case why i have to give xyz XSD as well apart from WSDL

Because there is no other way to define the type of the xyz service. You either define the schema in the WSDL file itself, or externally.

Author

Commented:
Because there is no other way to define the type of the xyz service. You either define the schema in the WSDL file itself, or externally.
is it either wsdl or xsd

But i was thinking it must be bot wsdl and xsd
Distinguished Expert 2018
Commented:
It is WSDL with XSD. The choice comes down to

1. WSDL with XSD embedded in the WSDL.
2. WSDL with external XSD that the WSDL references.

Author

Commented:
that make sense now thank you

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial