javagirl
javagirl

Reputation: 117

jax-ws how to include xml schema in wsdl instead of xsd import?

I noticed that my wsdl has a xsd:import to import the xml schema from a url. What do I have to do to display the xml schema in the wsdl itself? I anticipate that another team who will be consuming my web service will require it. I don't know why they would need it but I want to know how to do it if they ask.

<xsd:schema>
    <xsd:import schemaLocation="http://localhost:8081/MySoapFaultExample/myservice?xsd=1" namespace="http://ws.companyname.com/"/>
</xsd:schema>

Upvotes: 3

Views: 1207

Answers (1)

David Liz&#225;rraga
David Liz&#225;rraga

Reputation: 1192

Just put the whole xml schema instead of the <xsd:import> element. A simple example just to see how it will look like:

<xsd:schema>
    <xsd:element name="GetProductInfo">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="productName" type="string"/>
                <xsd:element name="productCode" type="integer"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
</xsd:schema>

You can find the WSDL basics in the W3Schools and some WSDL examples explained in here.

Upvotes: 1

Related Questions