Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8753505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:26:18+00:00 2026-06-13T13:26:18+00:00

I have an Ant task that takes a wsdl file and should auto generate

  • 0

I have an Ant task that takes a wsdl file and should auto generate POJO’s (client side Java) , so I can start programming my client side JAX-WS web services.

However I’m getting an error “[ERROR] The package name …. used for this schema is not a valid package name”

This error only occurs when my wsdl file has more than 1 schema import in it such as

            <xsd:import namespace="http://service.rts.cmslink.tms.com/ProcessCustomerInquiry/Response" schemaLocation="ProcessCustomerInquiryResponse.xsd"/>
            <xsd:import namespace="http://service.rts.cmslink.tms.com/ProcessCustomerInquiry/Request" schemaLocation="ProcessCustomerInquiryRequest.xsd"/>
        </xsd:schema>

Below is the entire wsdl

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:CMSLINK="http://service.rts.cmslink.tms.com/ProcessCustomerInquiry" xmlns:REQ="http://service.rts.cmslink.tms.com/ProcessCustomerInquiry/Request" xmlns:RESP="http://service.rts.cmslink.tms.com/ProcessCustomerInquiry/Response" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://service.rts.cmslink.tms.com/ProcessCustomerInquiry" name="ProcessCustomerInquiryService">
    <wsdl:types>
        <xsd:schema>
            <xsd:import namespace="http://service.rts.cmslink.tms.com/ProcessCustomerInquiry/Response" schemaLocation="ProcessCustomerInquiryResponse.xsd"/>
            <xsd:import namespace="http://service.rts.cmslink.tms.com/ProcessCustomerInquiry/Request" schemaLocation="ProcessCustomerInquiryRequest.xsd"/>
        </xsd:schema>
    </wsdl:types>
    <wsdl:message name="ProcessCustomerInquiryRequest">
        <wsdl:part name="requestData" element="REQ:ProcessCustomerInquiryRequest"/>
    </wsdl:message>
    <wsdl:message name="ProcessCustomerInquiryResponse">
        <wsdl:part name="responseData" element="RESP:ProcessCustomerInquiryResponse"/>
    </wsdl:message>
    <wsdl:portType name="ESB_ProcessCustomerInquiryService">
        <wsdl:operation name="ReqResp">
            <wsdl:input name="processRequest" message="CMSLINK:ProcessCustomerInquiryRequest"/>
            <wsdl:output name="processResponse" message="CMSLINK:ProcessCustomerInquiryResponse"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="ProcessCustomerInquiryServiceSoapBinding" type="CMSLINK:ESB_ProcessCustomerInquiryService">
        <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="ReqResp">
            <wsdlsoap:operation soapAction="process"/>
            <wsdl:input>
                <wsdlsoap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <wsdlsoap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="ProcessCustomerInquiryService">
        <wsdl:port name="ProcessCustomerInquiry" binding="CMSLINK:ProcessCustomerInquiryServiceSoapBinding">
            <wsdlsoap:address location="http://tsesbd01.tms.toyota.com:51180/v2/MF_CMSLINK_ProcessCustomerInquiryDistributed.msgflow"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

The XJC Ant task

<project name="WSDLCompile" default="wsdl2java" basedir=".">
    <target name="wsdl2java" description="Run xjc -wsdl.">
        <!-- properties -->
        <property name="sourceDir" value="temp/src" />
        <echo message="sourceDir:"/>
        <echo message="${sourceDir}"/>
        <mkdir dir="temp/classes"/>
        <property name="outputDir" value="temp/classes" />
        <echo message="outputDir:"/>
        <echo message="${outputDir}"/>
        <!-- xjc properties -->
        <property name="wsdl.url" value="src/wsdl/cmslink/ProcessCustomerInquiry.wsdl" />
        <echo message="wsdl.url:"/>
        <echo message="${wsdl.url}"/>
        <property name="wsdl.mapping.package.response" value="http://service.rts.cmslink.tms.com/ProcessCustomerInquiry/Response=com.tms.cmslink.rts.service.ProcessCustomerInquiry.Response" />
        <echo message="wsdl.mapping.package.response:"/>
        <property name="wsdl.mapping.package.request" value="http://service.rts.cmslink.tms.com/ProcessCustomerInquiry/Request=com.tms.cmslink.rts.service.ProcessCustomerInquiry.Request" />
        <echo message="wsdl.mapping.package.request:"/>
        <!--C:/Program Files/Java/jdk1.7.0_09/bin/xjc -->
        <!--xjc execution-->
        <exec executable="xjc">
            <arg value="-wsdl" />
            <arg value="${wsdl.url}" />
            <arg value="-d" />
            <arg value="${outputDir}" />
            <arg value="-p"/>
            <arg value="${wsdl.mapping.package.request}"/>
            <arg value="-p"/>
            <arg value="${wsdl.mapping.package.response}"/>
            <arg value="-verbose"/>
        </exec>
    </target>
</project>

If I remove the extra schema import either response.xsd or request.xsd, and also only include 1 “-p” package namespace argument for the ANT task, than the ANT runs without error, however my wsdl file contains multiple schema imports.

EDIT

I changed the value of “-p” arguement to adhere to package conventions, although my previous approach was based on JXC bug forum.

<project name="WSDLCompile" default="wsdl2java" basedir=".">
    <target name="wsdl2java" description="Run xjc -wsdl.">
        <!-- properties -->
        <property name="sourceDir" value="temp/src" />
        <echo message="sourceDir:"/>
        <echo message="${sourceDir}"/>
        <mkdir dir="temp/classes"/>
        <property name="outputDir" value="temp/classes" />
        <echo message="outputDir:"/>
        <echo message="${outputDir}"/>
        <!-- xjc properties -->
        <property name="wsdl.url" value="src/wsdl/cmslink/ProcessCustomerInquiry.wsdl" />
        <echo message="wsdl.url:"/>
        <echo message="${wsdl.url}"/>
        <property name="wsdl.mapping.package.response" value="com.tms.cmslink.rts.service.ProcessCustomerInquiry.Response" />
        <echo message="wsdl.mapping.package.response:"/>
        <property name="wsdl.mapping.package.request" value="com.tms.cmslink.rts.service.ProcessCustomerInquiry.Request" />
        <echo message="wsdl.mapping.package.request:"/>
        <!--C:/Program Files/Java/jdk1.7.0_09/bin/xjc -->
        <!--xjc execution-->
        <exec executable="xjc">
            <arg value="-wsdl" />
            <arg value="${wsdl.url}" />
            <arg value="-d" />
            <arg value="${outputDir}" />
            <arg value="-p"/>
            <arg value="${wsdl.mapping.package.request}"/>
            <arg value="-p"/>
            <arg value="${wsdl.mapping.package.response}"/>
            <arg value="-verbose"/>
        </exec>
    </target>
</project>

I have even tried the above ant task,with

-p <arg value="${wsdl.mapping.package.request }"/>
<arg value="${wsdl.mapping.package.response}"/>

by putting both package names on 1 line separated by space, this is according to JXC doc , explaining you can have “zero or more package namespaces separated by space”. I require XJC to be able to handle more than 1 schema import.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:26:19+00:00Added an answer on June 13, 2026 at 1:26 pm

    The -p option specifies a single Java package that should be used for all generated classes regardless of namespace. If you want each namespace URI to map to its own package then you can’t use -p, you instead need to use a binding customization file

    <bindings xmlns="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.1">
      <bindings schemaLocation="ProcessCustomerInquiryResponse.xsd" node="/xs:schema">
        <schemaBindings>
          <package name="com.example.inquiry.response"/>
        </schemaBindings>
      </bindings>
      <bindings schemaLocation="ProcessCustomerInquiryRequest.xsd" node="/xs:schema">
        <schemaBindings>
          <package name="com.example.inquiry.request"/>
        </schemaBindings>
      </bindings>
    </bindings>
    

    and pass it to xjc using the -b option

    <arg value="-b"/>
    <arg file="bindings.xjb"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Ant task to call a java process that takes a file
I have an Ant task that builds an executable JAR file, runs some JUnit
I have this ant task that creates a webstart jnlp file. It replaces tokens
I have an Ant task that needs to run in the parent directory. When
I have this simple Ant task that lists all '.png' files in a folder:
I have an ant task that executes some command on a list of files.
I have an ant task that contains javac task inside. It reports about error
I have an Ant task that creates an HTML report. Is it possible to
I have a ant target that takes a variable number of arguments that are
I have an ant task that uses an apply task to run a script

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.