Discussion:
Problem seting and String element during WebService call
(too old to reply)
g***@gmail.com
2019-01-24 16:42:33 UTC
Permalink
Hi,

Im working developing a ISIM Adapter for an application, now i have some issues setting some attributes:

This is the object i'm setting:

<xsd:element form="qualified" maxOccurs="1" minOccurs="1" name="transactionId">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="1"/>
<xsd:maxLength value="48"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>

As far as i know this is a "string" object(The complex types indicate this also)

var RequestTestHeaderESB = new com.*************.********.******.****.*****.****.test.EsbHeaderRq();

var IDDate = new java.util.Date();
var DTM = new java.util.Date(IDDate.getYear(),
IDDate.getMonth(),
IDDate.getDate(),
IDDate.getHours(),
IDDate.getMinutes(),
IDDate.getSeconds()
);
var str = IDDate.toGMTString();
var monStr = ((IDDate.getMonth()+1)<10)?"0"+(IDDate.getMonth()+1):(IDDate.getMonth()+1);
var dayStr = (IDDate.getDate()<10)?"0"+IDDate.getDate():IDDate.getDate();
var hrStr = (IDDate.getHours()<10)?"0"+IDDate.getHours():IDDate.getHours();
var minStr = (IDDate.getMinutes()<10)?"0"+IDDate.getMinutes():IDDate.getMinutes();
var secStr = (IDDate.getSeconds()<10)?"0"+IDDate.getSeconds():IDDate.getSeconds();

var TrxID = ("XXXX"+
str.substring(8,12)+
monStr+
dayStr+
hrStr+
minStr+
secStr+
(IDDate.getTime()-DTM.getTime())
);

task.logmsg("############")
task.logmsg(TrxID)
////XXXXYYYYMMDDHHMMSSmmm
task.logmsg("############")
RequestTestHeaderESB.setTransactionId(TrxID);

When i try this the WS response with this:


11:31:21,680 DEBUG - XXXXXXX Debug: {
"@REASON_MESSAGE": "https://xxx.xxx.xxx.xxx:xxxx/timtest: cvc-elt 4.3: element {http://xxx.xxxxxxxx.xxxx/xxxx/xxxxxx/xxx/xxx/test/}transactionId xsi:type value {http://www.w3.org/2001/XMLSchema}string is not derived from anonymous element type",
"@REASONCODE": 100
}

So, i also try to set the String data as java.lang.String() and String() (in some cases this solve other issues with the IBM java and the standard java) but for this case the problem is still present.
g***@gmail.com
2019-01-25 17:25:55 UTC
Permalink
Post by g***@gmail.com
Hi,
<xsd:element form="qualified" maxOccurs="1" minOccurs="1" name="transactionId">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:minLength value="1"/>
<xsd:maxLength value="48"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
As far as i know this is a "string" object(The complex types indicate this also)
var RequestTestHeaderESB = new com.*************.********.******.****.*****.****.test.EsbHeaderRq();
var IDDate = new java.util.Date();
var DTM = new java.util.Date(IDDate.getYear(),
IDDate.getMonth(),
IDDate.getDate(),
IDDate.getHours(),
IDDate.getMinutes(),
IDDate.getSeconds()
);
var str = IDDate.toGMTString();
var monStr = ((IDDate.getMonth()+1)<10)?"0"+(IDDate.getMonth()+1):(IDDate.getMonth()+1);
var dayStr = (IDDate.getDate()<10)?"0"+IDDate.getDate():IDDate.getDate();
var hrStr = (IDDate.getHours()<10)?"0"+IDDate.getHours():IDDate.getHours();
var minStr = (IDDate.getMinutes()<10)?"0"+IDDate.getMinutes():IDDate.getMinutes();
var secStr = (IDDate.getSeconds()<10)?"0"+IDDate.getSeconds():IDDate.getSeconds();
var TrxID = ("XXXX"+
str.substring(8,12)+
monStr+
dayStr+
hrStr+
minStr+
secStr+
(IDDate.getTime()-DTM.getTime())
);
task.logmsg("############")
task.logmsg(TrxID)
////XXXXYYYYMMDDHHMMSSmmm
task.logmsg("############")
RequestTestHeaderESB.setTransactionId(TrxID);
11:31:21,680 DEBUG - XXXXXXX Debug: {
}
So, i also try to set the String data as java.lang.String() and String() (in some cases this solve other issues with the IBM java and the standard java) but for this case the problem is still present.
If anyone found this problem, we capture the XML that is being send and found this:

<ns1:transactionId xsi:type="xsd:string">TIM20190125111332599</ns1:transactionId>

Ww found that this problem is caused by the "xsi:type="xsd:string" value assigned by the AxisEasyInvoke FC, any one know how we can make the FC to stop adding this parameter?
Loading...