Using XML schemas in WSDL

I have a WSDL that has two operations that share a complexType (DemographicsDoc). I am attempting to pull this complexType out into it’s own schema. I have successfully created a schema for the complexType, I have imported the schema into the WSDL. I am using weblogic’s clientgen to generate a java client based on the WSDL. Clientgen appears to work properly, it creates only one set of DemographicsDoc classes.

The problem occurs when I attempt to call the web service on my 6.1 IS. The SOAP response has a different xmlnamespace (sc1:__Demographics_Doc) than is expected (customer:__Demographics_Doc). This causes the following exception to be thrown: javax.xml.soap.SOAPException: failed to deserialize xml:weblogic.xml.schema.binding.DeserializationException:.

I am assuming there is a way to get this to work so I can define shared schemas for complexTypes that are shared across operations or WSDL’s. I have read all the docs from webMethods and cannot figure out how to get this to work.

Any thoughts.

Thanks
Adam

Schema Definition
DemographicsDoc.xsd (0.6 k)

WSDL
CustomerPost.wsdl (7.2 k)

  1. The original WSDL should match what the IS service will be expecting and will return. If you change the WSDL after is it generated, you can’t be sure the it still matches. Try generating WL client from the original WSDL and turn in a bug report it that does not work.

  2. sc1:__Demographics_Doc is not necessarily a different namespace from customer:__Demographics_Doc. If both those prefixes map to “http://beavis/DemographicsDoc/”, then they are the same. What are the prefix to namespace mappings?

  3. Integration Server should generate XSD namespaces based on the namespace defined in the DocumentType definition of the input and output parameters of the service. If you define IS service signatures DocumentType references to a common DocumentType definition than there will be a single XSD definition for it and references to it will be in the appropriate service inputs and outputs.

HTH,
Fred

Fred,

Thanks for the response.
I still am a bit unclear on how to fix my issue.

  1. For what I want to accomplish I cannot use the WSDL that Developer generates. I have generated two WSDL’s for two services and consolidated this into one WSDL with two operations.

  2. I am not sure where the sc1: comes from, it appears to be some arbitrary prefix that IS uses.

In theory what I want to accomplish is simple. I want to have one WSDL for two services. This part I can accomplish by crafting by hand a WSDL that includes both services. Now, I want to break out some shared data structures into a separate XSD. I would like to do this for two reasons. #1 So when a data structure changes I can change it in one XSD and not in many WSDL’s. #2 When java code is generated from my WSDL I would like to eliminate duplicate class creation.

Do you know of any examples of what I am trying to accomplish?

Thanks
Adam

  1. That is fine. It does suck that IS does not easily allow for multiple services in one WSDL (unfortunately this won’t be enhanced until the release after the one coming out soon), but modifying the WSDL seems like more work now, just so you can do more work later.

You theory is sound, but the problem is that if you change the XSD you must also change the Integration Server services signatures to match it exactly otherwise the WSDL doesn’t match the service implementations.

  1. All prefixes in XML are arbitrary. What matters is the namespace that the prefix is set to. The following three XML elements are exactly the same.

<foo>foovalue</foo>
<a:foo>foovalue</a:foo>
<b:foo>foovalue</b:foo>

  1. Usually when generating a client from a WSDL it will generate classes named for the namespaces and XSD type names. Since the XSD type is the same in each WSDL the client generation for each should generate the same class. I do the generates into different source folders and then diff the contents to figure out what I can throw away. This isn’t as nice as having a single WSDL, but usually once you know what is duplicated, you can throw out the same classes every time you regenerate clients.

HTH,
Fred

Fred,

Thanks for your input.
I have realized that implementing what I want will not be simple.
I will be anxiously awaiting better WSDL generation tools.

Adam

We are currently running on IS Wm 6.1 and too are awaiting the feature to be able to process multiple services from a single WSDL.
At the IW2004 conference, they mentioned looking toward 6.5 as having that capability. Since the 6.5 server is now released, has anyone tried multi-services from a single WSDL or has anyone come across vendor docs that state that this feature is now added in the new release?
I plan to ask the vendor and will share my findings.
Hope we are not finding yet another enhancement for a future Feature Pack or worse, version 7.0 release !!!