panthulu Posted October 1, 2014 Report Posted October 1, 2014 I have a wsdl with three xsd's have same target namespace. But the jaxws wsimport is not generating the custom package name. <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:import namespace="abc" schemaLocation="A.xsd" /> <xsd:import namespace="abc" schemaLocation="B.xsd" /> <xsd:import namespace="abc" schemaLocation="C.xsd" /> </xsd:schema> But there is another xsd in the wsdl with different target namespace is generating java classes in the given custom package. <jaxws:bindings node="wsdl:definitions/wsdl:types/xsd:schema[@targetNamespace='xxxx']"> <jaxb:schemaBindings> <jaxb:package name="com.test" /> </jaxb:schemaBindings> </jaxws:bindings> Can you please tell me how to achieve this?
panthulu Posted October 2, 2014 Author Report Posted October 2, 2014 Calling Jailer, Inno,... *<:( *<:( *<:(
ZuniorVentiyar Posted October 2, 2014 Report Posted October 2, 2014 jailer vere DB lo untadu bhayya .... LTT .. plz help this guy Calling Jailer, Inno,... *<:( *<:( *<:(
afuser Posted October 2, 2014 Report Posted October 2, 2014 If i understand it correct your issue is that classes are not getting generated as per the target namespace when you use wsimport? Now, when you generate the schema using wsimport do you see any objectfactory classes getting generated? If so then see the target namespace in those classes if they atch with what your xsd. Also when you create instances of generated classes you will use methods from in those object factory class and not using new operator? If you need the packages as per the target namespaces you might need to provide custom binding file to JAXB compiler while wsimport BTW what env are doing this for, I mean which application server
ZuniorVentiyar Posted October 2, 2014 Report Posted October 2, 2014 :3D_Smiles: :3D_Smiles: :3D_Smiles: Your issue is that classes are not getting generated as per the target namespace? When you generate the schema using as import do you see any objectfactory classes getting generated? If so then see the target namespace in those classes. Also when you create instances it will use the namespace in those object factory? BTW what env are doing this for, I mean which application server
afuser Posted October 2, 2014 Report Posted October 2, 2014 :3D_Smiles: :3D_Smiles: :3D_Smiles: Nee reaction ardhamu enti??
ZuniorVentiyar Posted October 2, 2014 Report Posted October 2, 2014 intha complicated undhi enti ani :3D_Smiles: :3D_Smiles: Nee reaction ardhamu enti??
ParmQ Posted October 2, 2014 Report Posted October 2, 2014 baa aa stack trace emaina unte post cheyyiraadu, aa 3 XSDs lo emaina elements same unnaya? Ayina 3 XSDs with same namespace endhuku? Look at this ..emaina help avuthundhemo? http://amadei.com.br/blog/index.php/the-danger-of-importing-multiple
panthulu Posted October 3, 2014 Author Report Posted October 3, 2014 If i understand it correct your issue is that classes are not getting generated as per the target namespace when you use wsimport? Now, when you generate the schema using wsimport do you see any objectfactory classes getting generated? If so then see the target namespace in those classes if they atch with what your xsd. Also when you create instances of generated classes you will use methods from in those object factory class and not using new operator? If you need the packages as per the target namespaces you might need to provide custom binding file to JAXB compiler while wsimport BTW what env are doing this for, I mean which application server If i understand it correct your issue is that classes are not getting generated as per the target namespace when you use wsimport? Issue is I have a wsdl with 4 XSD's (3 XSD's have same namespace) I use maven wsimport to generate classes. and use jaxws bindings to generate classes in a custom package. (com.companyname.....) otherwise we have package collisions. (you can see the sample binding how I am trying this) It is working fine if all the XSD's in the wsdl has different target namespaces. Since the current wsdl has 3 xsd's with same target namespace, it is generating the java classes in the same package as target namespace ignoring my jaxws bindings. (the other xsd is generating classes in the custom package (com.companyname....) Please let me know if the issue is clear.
panthulu Posted October 3, 2014 Author Report Posted October 3, 2014 baa aa stack trace emaina unte post cheyyiraadu, aa 3 XSDs lo emaina elements same unnaya? Ayina 3 XSDs with same namespace endhuku? Look at this ..emaina help avuthundhemo? http://amadei.com.br/blog/index.php/the-danger-of-importing-multiple Ayina 3 XSDs with same namespace endhuku? We got this from 3rd party, we have no control on this.
ZuniorVentiyar Posted October 3, 2014 Report Posted October 3, 2014 PM pettinaa .. aa solution work kaledhaaa ???? Ayina 3 XSDs with same namespace endhuku? We got this from 3rd party, we have no control on this.
panthulu Posted October 4, 2014 Author Report Posted October 4, 2014 PM pettinaa .. aa solution work kaledhaaa ???? No...it is ignoring the jaxws bindings to create classes in custom package. used the following to create in custom package but it is not working. <jaxws:bindings node="wsdl:definitions/wsdl:types/xsd:schema[@targetNamespace='namespace specified in the xsd']"> <jaxb:schemaBindings> <jaxb:package name="com.companyname" /> </jaxb:schemaBindings> </jaxws:bindings>
ParmQ Posted October 4, 2014 Report Posted October 4, 2014 PM pettinaa .. aa solution work kaledhaaa ???? Baa aa solution edho naakkuda pm cheyi.
Recommended Posts