- This topic has 2 replies, 1 voice, and was last updated 16 years, 6 months ago by Pierre LIROULET.
-
AuthorPosts
-
Pierre LIROULETParticipantHello,
I have generated a Web Service (rpc/litteral) that returns a java.util.List<MyObject>, MyObject are fully qualified beans (e.g. with public getters/setters) as weel as my service which has a getter/setter for the List. I have successfully published it to the XFire servlet. Surprinsingly, I can successfully test my web service using the test interface, the WSDL seems ok … However when I try to generate the client I got validation issues and I cannot generate the java files.
Here is a pseudo extract of my WSDL
<wsdl:definitions ..... xmlns:ns2="http://services.blah.blih.bluh.com" ... xmlns:tns="http://webservices.blah.blih.bluh.com" targetNamespace="http://webservices.blah.blih.bluh.com"> <xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://services.blah.blih.bluh.com"> <xsd:complexType name="ArrayOfMyObject"> <xsd:sequence> <xsd:element maxOccurs="unbounded" minOccurs="0" name="MyObject" nillable="true" type="ns2:MyObject" /> </xsd:sequence> </xsd:complexType> <xsd:complexType name="MyObject"> <xsd:sequence> <xsd:element minOccurs="0" name="xxxx" nillable="true" type="xsd:string" /> <xsd:element minOccurs="0" name="yyyy" nillable="true" type="xsd:string" /> </xsd:sequence> </xsd:complexType> </xsd:schema> ..... </wsdl:definitions>
Then when I try to generate client I got the following error :
Error resolving component ‘ns2:ArrayOfMyObject’. It was detected that ‘ns2:ArrayOfMyObject’ is in namespace ‘http://services.blah.blih.bluh.com’, but components from this namespace are not referenceable from schema document …
Problem is that this message extends on a very long length, I cannot give the exact message.Any clue appreciated
Thanks by advance
Pierre LIROULETParticipantI have found one quick & dirty solution : put everything on the same java package. But still I do not understand the problem … Now I face also another strange problem, All my client classes are created however instead of accessing the row types on my setters (like String, List, …) I have to pass thru’ a
JAXBElement<?>
and the objet factory which is somehow weird and not user friendly … I would like to access directly my objects thru’ a
setXXX(String xxx)
or
getXXX(String xxx)
not to do stuff like
setXXX(objectFactory.createBlahXXX("dummy"))
and
getXXX().getValue()
…
Any clue ?
Thanks by advance
Pierre LIROULETParticipantI have found out how to change the JAXB<?> to ? directly, I have changed the minOccurs from 0 to 1 … Now everything is ok !
Except the problem linked with the Java packages !Thanx
-
AuthorPosts