简体   繁体   中英

Issue in WSDL2Java

I am trying to use wsdl2java utility to generate POJOs. It's working fine for complete WSDL file. However, if a WSDL has

<wsdl:import>

it fails. What's the way to generate POJOs from such WSDLs?

Sample WSDL is:

<?xml version="1.0" encoding="UTF-8" ?> 
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:bns0="urn:OFTCoreLookupDataWsd/OFTCoreLookupDataConfig/document" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" name="OFTCoreLookupDataWsd" targetNamespace="urn:OFTCoreLookupDataWsd">
<wsdl:import location="https://TARGET:443/OFTCoreLookupData/OFTCoreLookupDataConfig/bindings?wsdl&style=document" namespace="urn:OFTCoreLookupDataWsd/OFTCoreLookupDataConfig/document"/>
<wsdl:service name="OFTCoreLookupData">
<wsdl:port name="OFTCoreLookupDataConfigPort_Document" binding="bns0:OFTCoreLookupDataConfigBinding">
<soap:address location="https://TARGET:443/OFTCoreLookupData/OFTCoreLookupDataConfig?style=document"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

The error I am getting is:

The reference to entity "style" must end with the ';' delimiter.

This is on

<wsdl:import>

location in WSDL. Please help.

This is just a guess but you may need to replace the & character in the location attributes URL value with &amp; to have a proper WSDL document. The problem is probably due to XML parsing and not the WSDL itself. Here is how it would look:

<wsdl:import location="https://TARGET:443/OFTCoreLookupData/OFTCoreLookupDataConfig/bindings?wsdl&amp;style=document" namespace="urn:OFTCoreLookupDataWsd/OFTCoreLookupDataConfig/document"/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM