Problem
Application migration to 12c and jaxb not working on it
Description
The application is currently hosted on Weblogic 10 and consumes some web services. We send XML directly to the webservice using the HttpURLConnection. Before sending, we will issue a request and after receiving a response we will cancel them.
The application must be ported to 12c, and when we tested the application at 12c, it does not work. The request sent to the webservice had a difference. See below schema, java classes and sorted request
Refund.xsd
----------
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:avis="http://www.avis.com/XMLSchema" elementFormDefault="unqualified">
<xsd:element name="RefundRequest">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="Request" avis:usage="ups"/>
<xsd:element ref="DeliveryNumber" avis:usage="ups"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Created Refund.java and related classes using the Eclipse -> Generate -> JAxB classes. I'm behind a firewall, and in the JAXB master he asked me for a proxy. I did not provide any pose. Class generated
Refund.java
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "",propOrder = {
"request",
"barCodeDeliveryNumber"
})
@XmlRootElement(name = "TrackRequest")
public class RefundRequest{
@XmlElement(name = "Request", required = true)
protected Request request;
@XmlElement(name = "DeliveryNumber", required = true)
protected String deliveryNumber;
public Request getRequest() {
return request;
}
public void setRequest(Request value) {
this.request = value;
}
public String getDeliveryNumber() {
return barCodeDeliveryNumber;
}
public void setDeliveryNumber(String value) {
this.barCodeDeliveryNumber = value;
}
XML (. ) -. - "XML "
javax.annotation_1.0.jar
javax.annotation_1.1.jar
javax.persistence_1.0.0.0_1-0.jar
javax.persistence_1.0.1.0_1-0.jar
javax.xml.bind_2.0.jar
javax.xml.bind_2.1.1.jar
jaxb-api.jar
jaxb-impl.jar
jaxws-api.jar
jaxws-rt.jar
jsr181-api.jar
jsr250-api.jar
Weblogic 12c jrockit160_29
private static Marshaller mreqinfo;
JAXBContext jxcreq =JAXBContext.newInstance(RefundRequest.class.getPackage().getName());
mreqinfo=jxcreq.createMarshaller();
mreqinfo.marshall(refundRequestObj)
, marshalled weblogic 12c.
xmlns: ns0 = "", , ,
* * - weblogic 12c jrockit160_29
. **
xmlns: ns0 = ""
<?xml version="1.0" encoding="UTF-8"?>
<RefundRequest xmlns:ns0="">
<Request>
<TransactionReference>
<CustomerContext>YILE00010208201120.04.08.4|11/22/2013 12:28:31:085</CustomerContext>
</TransactionReference>
<RequestAction>Refund</RequestAction>
</Request>
<DeliveryNumber>974869</DeliveryNumber>
</RefundRequest>
*** Weblogic 10 ( weblogic 10 jrockit160_29
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<RefundRequest>
<Request>
<TransactionReference>
<CustomerContext>YILE00010208201120.04.08.4|11/22/2013 12:28:31:085</CustomerContext>
</TransactionReference>
<RequestAction>Refund</RequestAction>
</Request>
<DeliveryNumber>974869</DeliveryNumber>
</RefundRequest>