Hello
i have created a very simple document structure containing two document types. One (MyDocWrapper) merely wraps the actual document (MyDoc). See pictures attached Picutres Pic1 and Pic2 as well as attached Package-Zip.
I’ve given all properties of all documents the same xml namespace. Then i created a FlowService with MyDocWrapper as InputSpec and published it as a Web Service. When trying to test the service using soapui i noticed that the element ‘document’ in MyDoc must not have any value. Looking at the wsdl i found that IS is creating an “element ref” for that property ‘document’ (see picutre Pic3).
I then changed the name of the property to ‘renamed’ and everything looked as i would have expected it (see picutre Pic4).
So my conclusion is that IS thinks that there is a clash of property names in the same namespace. I am not an xml schema expert but unitl now i thought that complex types may contain elements with the same name in the same namspace. I’ve tested the service in AXIS2 ans it generates (in my view) the proper wsdl.
So what do you think ? Is the behavior of IS correct ? Or is this a ‘feature’ ?
Tom,
Looks like you have a recursive definition going on in the schema. Was that your intention? Notice how within your complex type you have a document ref. which points back to a global element called document which in turn is typed as MyDoc which has a local element called document which references back to your global element document, recursion.
When you changed the name of the local element to renamed it, it points to a global element of renamed which is type string.
You didn’t mention which version of IS you were using.
it was not my intention to create a reference. I derived the example form a more complex project i am working on. My intention was to create a document (MyDocWrapper) that contains another one (MyDoc) and i used the same attribute names by coincidence.
I think that the creation of the element when publishing the flow service is wrong. Especially since the two attributes in my document model have different types (string and MyDoc).
I think you are confusing the WSDL generator with your naming conventions and recursive definition in your sample and it is doing its best to generate a recusive definition.
Yes that is correct. But what you are generating WSDL from is not XML schema remember. IS is doing its best to interpret what you are trying to define as XML schema. My best advice and generally accepted best practice is to create your XML Schema and WSDL outside of any tool first. You can then use that to create your stubs in webMethods IS or any other platform.
Having said that however, creating wrappers is pretty straightword and will generally generate the “correct” WSDL. You can reuse the same “document types, complex types in XML schema terms” in multiple element definitions within the same namespace. I believe there are a couple of samples on this site with document wrappers if you do a search on this forum group.
thank you for your reply mark.
following your advice to search a little bit harder i found the thread http://wmusers.com/forum/showthread.php?t=6468 which pretty much describes a similar problem. actually i already started yesterday to implement a custom soap processor (although i hoped to avoid that when i started with IS).
I have one last question:
Are the rules IS uses to generate a WSDLs from document types described somewhere ? Obviously my assumptions about that conversion where wrong. And since we coded a lot of flow services already, which we are gradually publishing now, having a written document about the conversion would be nice.
i’ve search the documentation on that topic already as hard as i could
P.S.:
Actually I dervied this example from a more complex problem, where i created XSD and WSDL first and then imported them in IS, following best practice.
Custom soap processor in 7.1.2? Can you explain in a little more detail what is not working correctly for you? You shouldn’t need to implement custom logic to wrap a document. The example link you found below is a little out of date. The 7.x IS is a lot different than previous versions when it comes to Web Services. Are you using the new WSD generator to generate your service interface definition?
You are right about document/wrapped working very well since IS_7-1-2_WebSvcsXML_Fix2. i think i did not express myself to good.
The thread i was referring to actually contains a solution that might work for my problem (soap processor).
Generally i face the problem that document types do not have the samce capabilities as XML schemas. And the import of schmeas which are part of a wsdl produces odd results (for example what i described in this thread). Another example are abstract complex types ([URL]wmusers.com). In that example i cannot use the connector created although i am sending valid soap message to the flow service.
So my problem is not so much the wsdls generated but the schemas generated from document types when i publish services.
Anyway, the result is that i can not use some of my schemas. At the moment the only solution i see is to write a custom soap processor in which i programm the soap-to-document transformation.