Jump to content

Stadiumite

Members
  • Posts

    7
  • Joined

  • Last visited

Stadiumite's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. In an XML instance based on a schema, I can have something like this:<Message xmlns="http://www.whatever.com/xxxx/myXML"'>http://www.whatever.com/xxxx/myXML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.whatever.com/xxxx/myXML {path}/ServiceXYZ.xsd">I'm declaring that this message is based on a particular namespace, which is defined in my schema, and I declare where that schema can be found.Am I correct that I can't do something similar if my Message is defined by a WSDL instead of an XSD? I can declare a namespace for a WSDL, and I can declare in my instance document that it complies with constraints of that namespace. But I can't mechanical verify that Message is really valid? This seems like something that's very natural to do. I'm really surprised that it's not there.
  2. For the last 18 months or so, I've been creating services from a Rational Rose UML object model. The model is set up sothat operations can be defined on interface classes. This definition includes input and output parameters.I have a generator tool that exports these operations to DTD, XSD, or WSDL. In the case of schema, the operation becomes two complexTypes; one for the request and one for the response. Each input parameter is an element within the request. Each output parm is an element within the response. Classes that those parameters are dependent on also become complexTypes.With DTD or Schema, I can use XMLSpy to "Generate Sample XML", and choose the Request type (or the response type) as theroot. Then I can fill in the contents of my message, and validate it against the schema. So I can produce a sample requestmessage and a sample reponse message.Then I pass the sample messages and schema on to developers who develop code that produces messages that adhere to the schema, and to architects who publish that schema as a contract with our consumers. Make sense?In today's world our services are queue-based. So it's just fine to represent them with a schema.But soon, we'll want to be doing web services. So I want to use a WSDL.I've been playing around with WSDL for the last several days to figure out how to do this, and I am baffled.There seems to be no tool that lets me generate a sample message against a WSDL, in the sense that I could with DTDor XSD. The best I can do is "Create SOAP Request" from the SOAP menu in XMLSpy Enterprise Edition. But that only generatesa request, not a response. And (annoyingly) it creates a tag for every possible element in the message, so the message is sohuge that you can't work with it.Also there's no mechanism to validate messages. So when my customer asks me, "What will our messages look likewhen we're using web services", I can't really answer them. Even though I've declared types in my WSDL, there's no mechanism to actually link the instance documents that represent the request and response to that WSDL. Why did I bother to definemy types at all?I've actually used two different approaches. In the first case, my types are defined within the WSDL itself. In thesecond case, I've imported a schema, and the types of my messages are defined by it. Like this: <xsd:complexType name="serviceXYZRequest"> <xsd:complexContent> <xsd:extension base="importXSD:serviceXYZRequest"/> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="serviceXYZReresponse"> <xsd:complexContent> <xsd:extension base="importXSD:serviceXYZResponse"/> </xsd:complexContent> </xsd:complexType> <message name="ServiceXYZRequest"> <part name="serviceXYZ" type="myWSDL:ServiceXYZRequest"/> </message> <message name="serviceXYZReponse"> <part name="serviceXYZ" type="myWSDL:ServiceXYZRequest"/> </message>Then in my request and response instance documents, I can validate the contents of the message against importXSD. But thisis still only part of what I want to do. If I were to declare attributes or additional elements on the type declaration in the WSDL, there's no way to validate them.
×
×
  • Create New...