users@jax-rpc.java.net

Re: WSCOMPILE : Invalid Entity Name

From: Vivek Pandey <Vivek.Pandey_at_Sun.COM>
Date: Mon, 14 Nov 2005 11:43:32 -0800

No, shchemaLocation attribute is not interpreted as hint. I see that
your wsdl has schemalocation which is not same as schemaLocation, try
changing schemalocation attribute to schemaLocation.

Even after that the wscompile will fail because there some problems in
the wsdl and schema, I am listing few,

* targetnamespace -> targetNamespace
* complextype ->complexType
* remove beginning/traling spaces from the targetNamepspaces and prefix
namespaces.

Though most of the errors are not so easy to report, they are not so
much of of parsing problems, rather its caught during modelling in
wscompile process.

I agree that the error reporting is not so intuitive in wscompile.
Unfortunately we can do much with jaxrpc 1.x, however with JAXWS 2.0 it
uses JAXB for parsing and XML databinding and you would see some
improvelemts there.

I am attaching the wsdls and schemas with error correction, you can diff
and see whats going on.

-vivek.

Yadav, Sharad (Cognizant) wrote:

>
> Hi Daniel,
> Thanks for the response. The "schemelocation" attribute does actually
> refer to a physical location. In order to keep things simple, I used
> the location name as the namespace.
> Before using the URI, I tried an absolute path name and have ensured
> that the wsdl & the xsd are in the same folder.
> I suspect that wscompile takes the "schemalocation" as a hint and
> doesn't crib if the schema filename is incorrect. For example, I tried
> to use "rss.doc" instead of "rss.xsd" and the behavior was identical
> and the same error message was returned.
> Is there any switch using which I can enforce schema compilation and
> confirm if it was picked up or not?
>
> The funny part is that some of the samples from sun aren't compilig
> either.
>
> Thanks
> Shayad__
>
> Date: Fri, 11 Nov 2005 11:56:33 +0000
> From: Oancea Daniel <doancea_at_gmail.com <mailto:doancea_at_gmail.com>>
> Content-Type: multipart/alternative;
> boundary="----=_Part_15863_3919963.1131710193213"
> Subject: WSCOMPILE : Invalid Entity Name
> >From what I see, in the import section of the WSDL types definition, the
> value for attribute "schemalocation" has to be schema file name itself and
> not the namespace!. Therefore, you will have to be careful to put the
> schema
> and the same directory with interface description.
>
> On 11/10/05, Yadav, Sharad (Cognizant) <Sharad.Yadav_at_cognizant.com
> <mailto:Sharad.Yadav_at_cognizant.com>> wrote:
> >
> > Hi,
> >
> > I am trying to compile a very simple WSDL that imports an XSD.
> However, I
> > have been getting a rather unintiutive error message. I have been
> stuck on
> > this problem for 2 days and some help will be really appreciated.
> >
> > I am using wscompile at the command prompt. Here is the command being
> > used:
> >
> > wscompile -verbose -gen:both -d test -f:wsi gen-config.xml
> >
> > ------------------------------
> > Error
> >
> > error: modeler error: invalid entity name: "PurchaseOrderDocument" (in
> > namespace : "http://localhost:8080/example/rss.xsd")
> > ------------------------
> > XSD
> > ------------------------
> > <?xml version="1.0" encoding="UTF-8"?>
> > <schema targetnamespace="http://localhost:8080/example/rss.xsd"
> > xmlns="http://www.w3.org/2001/XMLSchema"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xmlns:tns="http://localhost:8080/example/rss.xsd">
> >
> > <element name="PurchaseOrderDocument" type="tns:PurchaseOrder"/>
> >
> > <complextype name="Address">
> > <sequence>
> > <element name="street" type="string" nillable="false"/>
> > <element name="city" type="string" nillable="false"/>
> >
> > <element name="state" type="string" nillable="false"/>
> > <element name="zipCode" type="string" nillable="false"/>
> > </sequence>
> > </complextype>
> > <complextype name="LineItem">
> > <sequence>
> > <element name="itemname" type="string" nillable="false"/>
> > <element name="price" type="decimal" nillable="false"/>
> > <element name="quantity" type="int" nillable="false"/>
> > </sequence>
> > </complextype>
> > <complextype name="PurchaseOrder">
> > <sequence>
> > <element name="billTo" type="tns:Address" nillable="false"/>
> > <element name="createDate" type="dateTime" nillable="false"/>
> > <element name="items" type="tns:LineItem"
> > nillable="false" minoccurs="0" maxoccurs="unbounded"/>
> > <element name="poID" type="string" nillable="false"/>
> > <element name="shipTo" type="tns:Address" nillable="false"/>
> > </sequence>
> > </complextype>
> > </schema>
> >
> > ------------------------------
> > WSDL
> > ------------------------------
> >
> > <definitions
> >
> > xmlns="http://schemas.xmlsoap.org/wsdl/"
> > xmlns:ns1="http://localhost:8080/example/rss.xsd"
> > xmlns:tns="http://www.examples.com/rss.wsdl"
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> > targetnamespace="http://www.examples.com/rss.wsdl" name="RSSService">
> >
> > <types>
> > <xsd:schema targetNamespace="http://examples.com/rss.xsd">
> > <xsd:import namespace="http://localhost:8080/example/rss.xsd"
> > schemalocation="http://localhost:8080/example/rss.xsd" id="ns1" />
> > </xsd:schema>
> > </types>
> >
> > <message name="AccountCenterService_updateAccount">
> > <part name="parameter" element="ns1:PurchaseOrderDocument"/>
> > </message>
> >
> > <message name="AccountCenterService_updateAccountResponse">
> > <part name="result" element="ns1:PurchaseOrderDocument"/>
> > </message>
> >
> > <portType name="AccountCenterService">
> > <operation name="getAccountInformation">
> > <input message="ns1:AccountCenterService_updateAccount"/>
> > <output
> > message="ns1:AccountCenterService_updateAccountResponse"/></operation>
> > </portType>
> >
> > <binding name="AccountCenterServiceBinding"
> > type="tns:AccountCenterService">
> > <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
> > style="document"/>
> >
> > <operation name="getAccountInformation">
> > <soap:operation soapAction=""/>
> > <input>
> > <soap:body use="literal"/></input>
> > <output>
> > <soap:body use="literal"/></output></operation>
> > </binding>
> >
> > <service name="AccountCenterService">
> > <port name="AccountCenterServicePort"
> > binding="tns:AccountCenterServiceBinding">
> > <soap:address location="REPLACE_WITH_ACTUAL_URL"/></port>
> > </service>
> > </definitions>
> >
> >
> >
> ------------------------------------------------------------------------------------
> > I have tried to use some examples from Sun as well, but even they are
> > failing. This means that there is obviously something wrong in my
> > configuraiton. Please let me know what is amiss here ...
> >
> > Thanks in advance.
> >
> > Shayad_
>
> This e-mail and any files transmitted with it are for the sole use of
> the intended recipient(s) and may contain confidential and privileged
> information.
> If you are not the intended recipient, please contact the sender by
> reply e-mail and destroy all copies of the original message.
> Any unauthorised review, use, disclosure, dissemination, forwarding,
> printing or copying of this email or any action taken in reliance on
> this e-mail is strictly
> prohibited and may be unlawful.
>
> Visit us at http://www.cognizant.com
>

-- 
Vivek Pandey
Web Services Standards and Technologies
Sun Microsystems Inc. 


<definitions
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:ns1="http://localhost:8080/example/rss.xsd"
xmlns:tns="http://www.examples.com/rss.wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
targetNamespace="http://www.examples.com/rss.wsdl" name="RSSService">

<types>
<xsd:schema targetNamespace="http://examples.com/rss.xsd">
<xsd:import namespace="http://localhost:8080/example/rss.xsd" schemaLocation="rss.xsd" id="ns1" />
</xsd:schema>
</types>

<message name="AccountCenterService_updateAccount">
<part name="parameter" element="ns1:PurchaseOrderDocument"/>
</message>

<message name="AccountCenterService_updateAccountResponse">
<part name="result" element="ns1:PurchaseOrderDocument"/>
</message>

<portType name="AccountCenterService">
<operation name="getAccountInformation">
<input message="tns:AccountCenterService_updateAccount"/>
<output message="tns:AccountCenterService_updateAccountResponse"/></operation>
</portType>

<binding name="AccountCenterServiceBinding" type="tns:AccountCenterService">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>

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

<service name="AccountCenterService">
<port name="AccountCenterServicePort" binding="tns:AccountCenterServiceBinding">
<soap:address location="REPLACE_WITH_ACTUAL_URL"/></port>
</service>
</definitions>