javaee / jaxb-v2

Other
210 stars 100 forks source link

wsimport produces warnings when jaxb cannot resolve the types defined in imported schema. #640

Open glassfishrobot opened 15 years ago

glassfishrobot commented 15 years ago

If a wsdl defines types in multiple schema, jaxb throws warnings that it cannot resolve the types defined in imported schema.

Here is an example: [wsimport] command line: wsimport -Xnocompile -keep -s src -verbose main.wsdl -b jaxwsSchemaBindings.xml

[wsimport] parsing WSDL...

[wsimport] [WARNING] src-resolve: Cannot resolve the name 's0:BaseDTO' to a 'type definition' component. [wsimport] line 38 of porttypes/Config1_SAPGRC_AC_IDM_PROVISIONINGLOGVi_document.wsdl#types?schema4

[wsimport] [WARNING] src-resolve: Cannot resolve the name 's0:ProvisionLogResults' to a 'type definition' component. [wsimport] line 75 of porttypes/Config1_SAPGRC_AC_IDM_PROVISIONINGLOGVi_document.wsdl#types?schema5

[wsimport] generating code...

The code is generated, but these warnings persist.

Environment

Operating System: All Platform: All

Affected Versions

[2.1]

glassfishrobot commented 15 years ago

Reported by ninefinger

glassfishrobot commented 15 years ago

ninefinger said: Here is the snippet from the wsdl that causes the warnings....

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns0="urn:SAPGRC_AC_IDM_PROVISIONINGLOGVi" targetNamespace="urn:SAPGRC_AC_IDM_PROVISIONINGLOGWsd/SAPGRC_AC_IDM_PROVISIONINGLOGVi/document" xmlns:tns="urn:SAPGRC_AC_IDM_PROVISIONINGLOGWsd/SAPGRC_AC_IDM_PROVISIONINGLOGVi/document">

...
glassfishrobot commented 15 years ago

snajper said: Would you please provide full details (wsdl/schema/customization files) or attach a simple jaxb standalone test case? Thanks.

glassfishrobot commented 8 years ago

orangedog said: I don't seem able to attach anything, but you get this warning with any Salesforce outbound message SOAP import. When inspecting the generated sources, nothing seems to be amiss.

[WARNING] src-resolve: Cannot resolve the name 'ent:ID' to a(n) 'type definition' component. line 34 of file:/contact.wsdl#types?schema2

<?xml version="1.0" encoding="UTF-8"?>
<!-- 
Salesforce.com Outbound Notification Web Services API Version 1.0 
Generated on 2016-09-19 09:50:40 +0000.

Copyright 2005-2016 Salesforce.com, Inc.
All Rights Reserved
-->
<definitions targetNamespace="http://soap.sforce.com/2005/09/outbound"
             xmlns="http://schemas.xmlsoap.org/wsdl/"
             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
             xmlns:tns="http://soap.sforce.com/2005/09/outbound"
             xmlns:xsd="http://www.w3.org/2001/XMLSchema"
             xmlns:ent="urn:enterprise.soap.sforce.com"
             xmlns:ens="urn:sobject.enterprise.soap.sforce.com">
    <types>

        <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:enterprise.soap.sforce.com">
            <!-- Our simple ID Type -->
            <simpleType name="ID">
<restriction base="xsd:string">
    <length value="18"/>
    <pattern value='[a-zA-Z0-9]{18}'/>
</restriction>
            </simpleType>
        </schema>

        <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:sobject.enterprise.soap.sforce.com">
            <import namespace="urn:enterprise.soap.sforce.com" />
            <!-- Base sObject (abstract) -->
            <complexType name="sObject">
<sequence>
    <element name="fieldsToNull"       type="xsd:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
    <element name="Id" type="ent:ID" nillable="true" />
</sequence>
            </complexType>

            <complexType name="AggregateResult">
<complexContent>
    <extension base="ens:sObject">
        <sequence>
            <any namespace="##targetNamespace" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
        </sequence>
    </extension>
</complexContent>
            </complexType>

            <complexType name="Contact">
<complexContent>
    <extension base="ens:sObject">
        <sequence>
            <element name="AccountId" nillable="true" minOccurs="0" type="ent:ID"/>
            <element name="Email" nillable="true" minOccurs="0" type="xsd:string"/>
            <element name="FirstName" nillable="true" minOccurs="0" type="xsd:string"/>
            <element name="LastModifiedById" nillable="true" minOccurs="0" type="ent:ID"/>
            <element name="LastName" nillable="true" minOccurs="0" type="xsd:string"/>
            <element name="MailingCountryCode" nillable="true" minOccurs="0" type="xsd:string"/>
            <element name="Phone" nillable="true" minOccurs="0" type="xsd:string"/>
        </sequence>
    </extension>
</complexContent>
            </complexType>

        </schema>

        <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soap.sforce.com/2005/09/outbound">
            <import namespace="urn:enterprise.soap.sforce.com" />
            <import namespace="urn:sobject.enterprise.soap.sforce.com" />

            <element name="notifications">
<complexType>
    <sequence>
        <element name="OrganizationId" type="ent:ID" />
        <element name="ActionId" type="ent:ID" />
        <element name="SessionId" type="xsd:string" nillable="true" />
        <element name="EnterpriseUrl" type="xsd:string" />
        <element name="PartnerUrl" type="xsd:string" />
        <element name="Notification" maxOccurs="100" type="tns:ContactNotification" />
    </sequence>
</complexType>
            </element>

            <complexType name="ContactNotification">
<sequence>
    <element name="Id" type="ent:ID" />
    <element name="sObject" type="ens:Contact" />
</sequence>
            </complexType>

            <element name="notificationsResponse">
<complexType>
    <sequence>
        <element name="Ack" type="xsd:boolean" />
    </sequence>
</complexType>
            </element>
        </schema>
    </types>

    <!-- Method Messages -->
    <message name="notificationsRequest">
        <part element="tns:notifications" name="request"/>
    </message>
    <message name="notificationsResponse">
        <part element="tns:notificationsResponse" name="response"/>
    </message>

    <!-- PortType -->
    <portType name="NotificationPort">
        <operation name="notifications">
            <documentation>Process a number of notifications.</documentation>
            <input  message="tns:notificationsRequest"/>
            <output message="tns:notificationsResponse"/>
        </operation>
    </portType>

    <!-- Binding
         You need to write a service that implements this binding to receive the notifications
     -->
    <binding name="NotificationBinding" type="tns:NotificationPort">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

        <operation name="notifications">
            <soap:operation soapAction=""/>
            <input>
<soap:body use="literal"/>
            </input>
            <output>
<soap:body use="literal"/>
            </output>
        </operation>
    </binding>

    <!-- Service Endpoint -->
    <service name="NotificationService">
        <documentation>Notification Service Implementation</documentation>
        <port binding="tns:NotificationBinding" name="Notification">
            <soap:address location="http://www.example.com"/>
        </port>
    </service>

</definitions>
glassfishrobot commented 15 years ago

Was assigned to snajper

glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA JAXB-640