Just to reiterate what Anne said...

The wsdl message links to schema components in one of two ways. In doc/lit you use an attribute named "element". In rpc/enc (and rpc/lit) you use two attributes called "name" and "type".

"element" must link to a named element declaration, like:
 <element name="SubscriptionAttributes" type="typens:subscription" />

This ties together a tag name an the type information use an XML Schema construct, the element declaration.

Conceptually this is parallel to the rpc convention that uses the "name" and "type" attributes in the wsdl message. It does the same thing just outside of XML Schema.

    <message name="SubscriptionRequest">
      <part name="SubscriptionRequest" type="typens:subscription"/>
    </message>


This is a very valid looking message definition if you were building an rpc/enc message. :) But since you're not you're runnign into trouble.


So, use either the "element" or "name/type" pair.


Regards


Jim Murphy
Mindreef, Inc.




Wendy Smoak wrote:


Anne wrote:
> When using doc/literal, your message <part> definitions must reference an element
> definition rather than a type definition.
> So in your <types> section you also need to define an <element> definition for each message part.


I can't get this to work. Or rather, I _can_ get it to work when referring to a complexType, but not when referring to an element.

Here's a working (WSDL2Java will run without error and generate code, I'm not yet sure it's correct but at least it does something) WSDL document: http://www.public.asu.edu/~wsmoak/xml/webauth2.wsdl

You can see the
  <element name="SubscriptionAttributes" type="typens:subscription" />
and
  <element name="ResponseInfo" type="typens:subscriptionResponse" />
In the <types> section.

But if I try to use SubscriptionAttributes instead of subscription further down in this part:
<message name="SubscriptionRequest"> <part name="SubscriptionRequest" type="typens:subscription"/>
</message>


Then WSDL2Java says:
G:\IRM\SharedSource\services>java org.apache.axis.wsdl.WSDL2Java -v src/wsdl/webauth2.wsdl -osrc
Parsing XML file: src/wsdl/webauth2.wsdl
java.io.IOException: Type {urn:servicehandler-ns-type}SubscriptionAttributes is referenced but not defined.


Here's the broken-but-seemingly-correct one: http://www.public.asu.edu/~wsmoak/xml/webauth.wsdl

In the original message, the namespace for the type attribute looked like it was external. It had:
<xsd:element name=PriceInfo type=xsd1:PriceInfoType"> where xsd1 was:
xmlns:xsd1="http://www.tlr.bis.com/rating.xsd1";
And yet PriceInfoType was defined in the same <schema>.


I'm confused again (still!), can anyone make sense of this for me?

--
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University, PA, IRM





Reply via email to