As a part of an platform upgrade, we are moving from JAX-RPC to JAX-WS. The EJB service beans have been modified to have the JAX-WS annotations.
@WebService(name = "AdService",
serviceName="AdService",
portName="AdServicePort",
targetNamespace="http://hABC.com")
At the method level:
@WebMethod()
@WebResult(name="returnAsPCResult")
public PResult getPForInvoice(@XmlElement( required = true ) @WebParam(name="invoiceBean", targetNamespace="http://hABC.com") com.hhABC.SInvoice invoiceBean, @XmlElement( required = true ) @WebParam(name="productName", targetNamespace="http://hABC.com") java.lang.String productName, @XmlElement( required = true ) @WebParam(name="bNName", targetNamespace="http://hABC.com") java.lang.String bNName) {
if (Trace.webService) {
All the arguments in the service method have object classes which are annotated with
@XmlRootElement(namespace="java:com.hhABC.generated", name="SInvoice" )
Now when the xsd is generated using the jwsc, the xsd has both the namespace as expected:
- targetnamespace :http://hABC.com
- xml name space : java:com.hhABC.generated
But in the xsd, all the elements are all assigned with the targetnamespace. The expectation here is that all the complex type elements mentioned in the xsd have to point to the xml name space : java:com.hhABC.generated
I have added the package-info in the appropriate package of complex elements.
XSD 1 :
<xs:schema xmlns:ns1="http://hABC.com" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="java:com.hhABC.generated">
<xs:import namespace="http://hABC.com" schemaLocation="http://10.**.**.9*:7001/web-services/AService?xsd=2"/>
<xs:element name="AbstractAttachment" type="ns1:abstractAttachment"/>
<xs:element name="AbstractAttachment" type="ns1:abstractAttachment"/>
<xs:ele
XSD2:
<xs:schema xmlns:tns="http://hABC.com" xmlns:ns1="java:com.hhABC.generated" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://hABC.com">
....
<xs:extension base="tns:sInvoice">
....
<xs:element name="mInformation" type="tns:hMember" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="otherDates" type="tns:otherDate" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
What is expected is :
<xs:extension xmlns:java="java:com.hhABC.generated" base="java:SInvoice">
<xs:sequence>
.....
<xs:element maxOccurs="unbounded" minOccurs="0" name="mInformation" nillable="true" type="java:HMember"/>
Need help on resolving the name space.