creating input/output for WSDL

Good Morning.

I have a best practice type question for anyone who may want to add thier opinion. I have generated document literal type WSDL’s using webMethods IS v6.5. The input and output “Constraint Type” that I have defined is “Document Type”. wM also gives you the option of a constraint type of “Schema Component”. I am wondering what the difference is if I use a schema or a wM document type. Is there more functionality or validation if I use a schema component? What are the benefits of both and which one is recommended as a Web Service best practice? I notice that the wM user documentation says that if we use a schema component as a constraint type then the XML Schema you identify must be located on the Web and must be accessible to consumers of the WSDL. We are not providing schemas on the web right now, but we will look into doing that if it is considered best practice.
Any advice would be appreciated.
Thanks
Sara

Where is this “constraint type” setting that you are looking at? In the WSDL generator?

Mark

Hi Mark,

Yes, it is in the WSDL Generator. I have read through some other similar threads on this topic. Specifically the thread entitled "Document / Literal (SOAP-MSG) Example". It appears to me that it is good practice to have the input/output documents of the web service to be the name of the operation plus the string “Request” or “Response”. I am using a common document called “generalAcknowledgement” as output for my web service. I have followed your example of creating a new document within my web service package that references the common generalAcknowledgement document that I have defined in another package.

After doing this, I select my service and select “Generate WSDL”. The protocol is “SOAP-MSG”. When I browse to my input/output documents I have the option to choose a constraint type (document type or schema component). I have been selecting document type and browsing to the new document that I created which references the common acknowledgement wM document. But I am wondering if I am losing any functionality or “web service-type” benefits by doing this. Similar to this issue, I am not quite sure what the difference is between validating XML within webMethods against a wM document or a wM schema component when using the wM validate function. They both seem to have the same validation results to me and I am runnig into the same thing with this issue.

The only other thing I would like to mention is that the wM user documentation says that if we use a schema component as a constraint type then the XML Schema you identify must be located on the Web and must be accessible to consumers of the WSDL. Currently we are providing our xsd files to our web service clients and we have not made them accessible via URI. I am not sure that we will be ready or able to do this for external clients (outside our firewall). In order to determine whether we should explore this route I would like to know the difference between the two constraint types.

Sorry to be so wordy, but I hope that explains a little more of what I am trying to figure out. Thanks for your help.
Sara

Hmmm. I have not ever worked with a “Constraint Type” of XML schema before. This option appears to let you choose an element from an XSD that describes the input or output message.

The requirement to have your XSD hosted in some publically-accessible location could be avoided if you or the service consumer is capable of updating the schemaLocation of the input and output imported XSD’s to a local folder.

However, remember that WSDL’s generated by Developer can only contain a single operation (method). While this is functional, it is far, far from ideal assuming your attempting to build a Service (capital “S”) that contains multiple operations and describe that Service using a single WSDL.

I like the approach of having the WSDL import its message definitions from an external XSD. In that way, you can change the message structures without changing the WSDL (as long as the message names don’t change). Also, your XSD can contain elements describing multiple messages so that only a single XSD need be imported into your WSDL.

BTW, I think in my original post which you referenced, I suggested naming the request messages with the convention Request and the response messages with Response. I think to match more closely the “document / literal wrapped” style the convention for the request messages should just be .

Mark