Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 284
  • Last Modified:

How to make wsdl and xsd as a single file

Hi,

I created a sample web service using Javax-ws and jaxb in java, the wsdl generated as 2 files, one schema and wsdl, but i want that xsd content also in my wsdl file itself.

How to do that..kindly help me.
0
prabhualla
Asked:
prabhualla
1 Solution
 
mccarlIT Business Systems Analyst / Software DeveloperCommented:
XSD schema can be included within the WSDL by placing it in a <wsdl:types> element as a child under your <wsdl:definitions> element.

A basic example follows (but if you post your 2 files I could provide a more complete example)...
<definitions name="HelloService"
   targetNamespace="http://www.examples.com/wsdl/HelloService.wsdl"
   xmlns="http://schemas.xmlsoap.org/wsdl/"
   xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
   xmlns:tns="http://www.examples.com/wsdl/HelloService.wsdl"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <types>
        <xsd:schema targetNamespace="http://www.examples.com/wsdl/HelloService.wsdl">
            <xsd:element .... />
        </xsd:schema>
    </types>
   <!-- The rest of your WSDL would be here! -->
</definitions>

Open in new window

Refer to http://www.w3.org/TR/wsdl#_types for the official reference.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now