Question

I am trying to generate client artifacts from the WSDL file as mentioned below using wsimport <>. The WSDL file and the error am getting is mentioned below. The wsimport is not able to resolve the namespace - tns, but it is the same namespace as thetarget namespace of the wsdl. Tried compiling using catalog file and binding file but nothing works. Am not clear why the tns namespace is not resolving when its the same as target name space. Any help will be highly appreciated. Thanks .

WSDL File

<?xml version='1.0' encoding='UTF-8'?>
<!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Oracle JAX-WS 2.1.3-07/10/2008 08:41 PM(bt). --><!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Oracle JAX-WS 2.1.3-07/10/2008 08:41 PM(bt). -->
<definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://webservice.statementprofile.billing.aosoft.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://webservice.statementprofile.billing.aosoft.com/" name="StatementprofileWebservice">
<message name="getSIRIStatementprofile">
<part name="StatementprofileRequestBean" type="tns:statementprofileRequest" />
</message>
<message name="getSIRIStatementprofileResponse">
<part name="return" type="tns:StatementprofileResponse" />
</message>
<portType name="StatementprofileWebservice">
<operation name="getSIRIStatementprofile">
<input message="tns:getSIRIStatementprofile" />
<output message="tns:getSIRIStatementprofileResponse" />
</operation>
</portType>
<binding name="StatementprofileWebservicePortBinding" type="tns:StatementprofileWebservice">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" />
<operation name="getSIRIStatementprofile">
<soap:operation soapAction="" />
<input>
<soap:body use="literal" namespace="http://webservice.statementprofile.billing.aosoft.com/" />
</input>
<output>
<soap:body use="literal" namespace="http://webservice.statementprofile.billing.aosoft.com/" />
</output>
</operation>
</binding>
<service name="StatementprofileWebservice">
<port name="StatementprofileWebservicePort" binding="tns:StatementprofileWebservicePortBinding">
<soap:address location="https://webdev.ams1907.com:443/Statementprofile/StatementprofileWebservice" />
</port>
</service>
</definitions>

D:\bea3\jdk160_05\bin>wsimport StatementProfile.wsdl
parsing WSDL...

Error

[ERROR] XML type "{http://webservice.statementprofile.billing.ups.com/}statementprofileRequest" could not be resolved, XML to JAVA binding failed! Please check the wsdl:part "StatementprofileRequestBean" in the wsdl:message "{http://webservice.statementprofile.billing.aosoft.com/}getSIRIStatementprofile".
  line 5 of file:/D:/bea3/jdk160_05/bin/StatementProfile.wsdl

Tried using this binding file

<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer=" system"> 
    < system systemId="http://mahapps.inside.ups.com/AccountProfile/AccountProfileWebservice?wsdl" uri="AccountProfileWebservice.wsdl"/> 
</catalog> 

**Tried using binding file**

<bindings
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:tns="http://webservice.accountprofile.billing.ups.com/"
    wsdlLocation="http://mahapps.inside.ups.com/AccountProfile/AccountProfileWebservice?wsdl"
    xmlns="http://java.sun.com/xml/ns/jaxws">
        <package name="com.test">

        </package>
    </bindings>
Was it helpful?

Solution

Where is your <types> element? It should contain the XSD declarations for the types your process is complaining about. Your WSDL should either have an import somewhere to import the XSD type declarations:

<types>
    <schema xmlns="http://www.w3.org/2001/XMLSchema">
        <import namespace="http://webservice.statementprofile.billing.aosoft.com/" schemaLocation="your-schema.xsd" />             
    </schema>
</types>

or the XSD embedded in your <types> element:

<types>
    <xsd:schema elementFormDefault="qualified" xmlns="http://webservice.statementprofile.billing.aosoft.com/" targetNamespace="http://webservice.statementprofile.billing.aosoft.com/"> 
        <xsd:complexType name="statementprofileRequest">
            ...
        </xsd:complexType>
        <xsd:complexType name="StatementprofileResponse">
            ...
        </xsd:complexType>
    </xsd:schema>
</types>

or some other way to feed the wsimport app with that XSD (perhaps via bindings), but if you can insert the <types> info, you should be able to validate.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top