Hi Ann,

Thanks for the help! I had a little bit of trouble getting the WSDL2Java tool to ingest my XML. It was complaining about a type that as referenced but undefined. I ended up putting my <xsd:import> element inside the <complexType> element and it worked.

I also needed to use the "schemaLocation" attribute instead of "location".

So the end wsdl looked like:
<wsdl:types>

  ...

<schema targetNamespace="http://scmwebagent.library.jhu.edu";>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="SCMOperationOutput">
<xsd:import namespace="http://scmwebagent.library.jhu.edu"; schemaLocation="http://scmwebagent.library.jhu.edu/xsd/SCMOperationOutput.xsd"/>
</complexType>
</schema>

  ...

</wsdl:types>


Thanks again for your help!

Elliot

Anne Thomas Manes wrote:
You can import the schema into your XSD or WSDL file:

<xsd:import namespace="schema-targetnamespace-uri" location="schema-url"/>

Note that when importing an XSD into WSDL, you must import it within a
<schema> section within the <types> section, and you must use <xsd:import>
rather than <wsdl:import>. You also must declare the imported namespace.

e.g.,

<wsdl:definitions name="this-wsdl" targetNamespace="this-wsdl-ns"
  xmlns:wsdl="wsdl-ns"
  xmlns:soap="wsdl-soap-ns"
  xmlns:xsd="schema-ns"
  xmlns:intf="this-wsdl-ns"
  xmlns:import="imported-schema-ns">
  <wsdl:types>
   <xsd:schema targetNamespace="this-wsdl-ns">
    <xsd:import namespace="imported-schema-ns" location="xsd-file-url"/>
   </xsd:schema>
  </wsdl:types>
</wsdl:definitions>

Anne



Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to