|
From: David RR W. \(XML\) <da...@dr...> - 2006-01-04 18:54:22
|
<div>Yes - exactly - that's why I was suggesting the .equals(null) method
- since it avoids that problem. Also == is comparing the pointer
value - which may or may not always be null....</div>
<div> </div>
<div>Java coding best practices ; -)</div>
<div> </div>
<div>Tricky, tricky!</div>
<div> </div>
<div>Cheers, DW<BR><BR></div>
<BLOCKQUOTE style="PADDING-LEFT: 8px; MARGIN-LEFT: 8px; BORDER-LEFT:
blue 2px solid"><BR>-------- Original Message --------<BR>Subject: RE:
[ebxmlms-general] Bug in the ebxml header<BR>From: Ladislav Urban
<lad...@we...><BR>Date: Wed, January 04, 2006 1:43
pm<BR>To: ebx...@li...<BR><BR>Hello David,<BR>I
had to revert the statement to role != null<BR>because if role is equal
null the equals method generates Null pointer<BR>exception
if (role.equals(null) == false)
<BR><BR>Ladislav<BR><BR>On Tue, 2006-01-03 at 18:23 -0700, David RR
Webber (XML) wrote:<BR>> Ladislav,<BR>> <BR>> Best to
use .equal null instead of == null<BR>> <BR>> Also - as
Sacha notes - best to omit the element altogether - if value<BR>>
represented is null.<BR>> <BR>> Thanks, DW<BR>> <BR>>
<BR>> <BR>>
-------- Original Message --------<BR>>
Subject: Re: [ebxmlms-general] Bug in the ebxml header<BR>>
From: Ladislav Urban
<lad...@we...><BR>>
Date: Tue, January 03, 2006 5:18 pm<BR>>
To: ebx...@li...<BR>>
<BR>> Is somebody against the
proposed changes?<BR>> Please let me
know.<BR>> <BR>>
<BR>> On Tue, 2005-12-27 at 20:51
-0700, Sacha Schlegel wrote:<BR>> >
Hi ebxmlms-general list<BR>> >
<BR>> > >From the ebMS2.0
specification:<BR>> > <BR>>
> <element name="To"> <BR>>
> <complexType> <BR>>
> <sequence> <BR>>
> <element ref="tns:PartyId"
maxOccurs="unbounded"/> <BR>> >
<element name="Role"
type="tns:non-empty-string"<BR>>
minOccurs="0"/><BR>> >
</sequence> <BR>> >
</complexType><BR>> >
</element><BR>> > <BR>>
> So the Role element is optional but if
present it cannot be<BR>> empty.<BR>>
> <BR>>
> If you put a "dummy" role value the receiving MSH might
not<BR>> accept the message<BR>>
> because it cannot verify the "dummy"
role in its partnership<BR>> info
or<BR>> > CPA.<BR>>
> <BR>> > Hope this
helps.<BR>> > <BR>>
> Sacha<BR>> >
<BR>> > <BR>>
> <BR>> > On Tue, 2005-12-27
at 21:30 -0500, David Webber (XML) wrote:<BR>>
> > Ladislav,<BR>> >
> <BR>> > > Best to ask Dale
Moberg - he is the expert in these<BR>>
matters.<BR>> > > <BR>>
> > DW<BR>>
> > <BR>> > > ----- Original
Message ----- <BR>> > > From:
"Ladislav Urban" <lad...@we...><BR>>
> > To:
<ebx...@li...><BR>>
> > Sent: Tuesday, December 27, 2005 6:44
PM<BR>> > > Subject: RE:
[ebxmlms-general] Bug in the ebxml header<BR>>
> > <BR>> > >
<BR>> > > > Hi David,<BR>>
> > > the problem is the setXXX
method adds new element to<BR>> ebxml
header. This<BR>> > > > element
is empty because for example role parameter of<BR>>
SetFromRole is<BR>> >
> > null.<BR>> > >
><BR>> > > ><BR>>
> > > So lets suppose I do have a
generator what pre-fills my<BR>> ebxml
message.<BR>> > > > There is no
value for role so it creates empty element<BR>>
role.<BR>> > > > Later
on I add role value but I do have one empty<BR>>
element Role and yet<BR>>
> > > another with my value.<BR>>
> > ><BR>> > >
> You are right I should print some warning message if the<BR>>
parameter role<BR>>
> > > is null too.<BR>>
> > ><BR>> > > > If I
add role "unknown" this would not be true and I am<BR>>
not sure if it<BR>>
> > > is allowed by standard.<BR>>
> > ><BR>> > >
> Ladislav<BR>> > >
><BR>> > > > PS. We work on
certification so every tiny issue in<BR>>
ebxml message is<BR>> > >
> important.<BR>> > >
><BR>> > > ><BR>>
> > ><BR>>
> > > On Tue, 2005-12-27 at 15:19 -0700, David RR Webber
(XML)<BR>> wrote:<BR>>
> > > > Ladistan,<BR>>
> > > ><BR>>
> > > > I'm not totally clear on this - why are you just
not<BR>> giving an error<BR>>
> > > > or assigning 'unknown' to the
role if they do not<BR>> provide
one?<BR>> > > > ><BR>>
> > > > DW<BR>>
> > > ><BR>>
> > > ><BR>> >
> > ><BR>> > > > >
-------- Original Message --------<BR>>
> > > >
Subject: [ebxmlms-general] Bug in the ebxml<BR>>
header<BR>> >
> > > From: Ladislav Urban<BR>>
<lad...@we...><BR>>
> > > >
Date: Tue, December 27, 2005 3:59 pm<BR>>
> > > > To:
ebxmlms-general<BR>>
<ebx...@li...>,<BR>>
> > > >
ebxmlms-develop<BR>>
<ebx...@li...><BR>>
> > > ><BR>>
> > > > Hello hermes
developers,<BR>> > > > >
I have found bug in ebxml header. For
example<BR>> if I call<BR>>
> > > >
setFromRole(null) with null value. This method<BR>>
creates empty<BR>> >
> > > Element<BR>>
> > > >
<eb:Role/> . This problem is repeated in<BR>>
setToRole and<BR>>
> > > > possibly other<BR>>
> > > >
methods.<BR>> > > > >
I fixed the problem:<BR>>
> > > ><BR>>
> > > > Do you agree with this
solution?<BR>> > > >
><BR>> > > > ><BR>>
> > > >
public void setToRole(String role) throws<BR>>
SOAPException {<BR>> >
> > >
if (role != null) {<BR>> > >
> ><BR>> > > > >
if (toRole
== null) {<BR>> > > > >
if (toPartyIds.size() > 0) {<BR>>
> > > ><BR>>
to.addChildElement(ELEMENT_ROLE, role);<BR>>
> > > >
}<BR>>
> > > >
toRole = role;<BR>>
> > > >
} else {<BR>>
> > > >
throw
new<BR>>
SOAPValidationException(<BR>> > >
> ><BR>> > > > >
SOAPValidationException.SOAP_FAULT_CLIENT,<BR>>
"<"<BR>> > > >
>
+<BR>> NAMESPACE_PREFIX_EB + ":"
+<BR>> > > > >
ELEMENT_ROLE<BR>> > >
> >
+ "> has<BR>> already been " +
"set<BR>> > > > >
in <"<BR>> >
> > >
+<BR>> NAMESPACE_PREFIX_EB
+ ":" +<BR>> > > > >
ELEMENT_TO<BR>>
> > > > + ">!");<BR>>
> > > >
}<BR>>
> > > ><BR>>
> > > >
}<BR>> > > > >
}<BR>>
> > > ><BR>> > > >
><BR>> > > > ><BR>>
> > > ><BR>>
> > > ><BR>>
> > > ><BR>> > > >
><BR>> > > > >
<eb:From><BR>>
> > > >
<eb:PartyId<BR>> > > >
><BR>> > ><BR>>
eb:type="urn:oasis:names:tc:ebxml-cppa:partyid-type:duns">AutoMateHub</eb:Pa<BR>>
> > rtyId><BR>>
> > > >
<eb:Role/><BR>> > > >
>
<eb:Role>Seller</eb:Role><BR>>
> > > >
</eb:From><BR>> > > >
> <eb:To><BR>>
> > > >
<eb:PartyId<BR>> > > >
><BR>> > ><BR>>
eb:type="urn:oasis:names:tc:ebxml-cppa:partyid-type:duns">TestDriver</eb:Par<BR>>
> > tyId><BR>>
> > > >
<eb:Role>Buyer</eb:Role><BR>>
> > > >
</eb:To><BR>> > > >
><BR>> > > > >
-- <BR>> > >
> > Ladislav Urban<BR>>
> > > >
CEO<BR>> > > > >
Webswell Inc.<BR>>
> > > > 1333 Howe Avenue, Suite
100<BR>> > > > >
Sacramento, 95825 CA<BR>>
> > > > email:
lad...@we...<BR>> >
> > > phone: +1 (916)
290-2040<BR>> > > > >
fax: +1 (916) 921-2850<BR>>
> > > >
http://www.webswell.com<BR>> > >
> ><BR>> > > >
><BR>> > > > ><BR>>
> > > ><BR>>
-------------------------------------------------------<BR>>
> > > >
This SF.net email is sponsored by: Splunk Inc.<BR>>
Do you grep<BR>> > >
> > through log files<BR>>
> > > >
for problems? Stop! Download the new AJAX<BR>>
search engine that<BR>>
> > > > makes<BR>>
> > > >
searching your log files as easy as surfing<BR>>
the web.<BR>>
> > > > DOWNLOAD
SPLUNK!<BR>> > > > ><BR>>
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click<BR>>
> > > ><BR>>
_______________________________________________<BR>>
> > > >
ebxmlms-general mailing list<BR>>
> > > >
ebx...@li...<BR>>
> > > ><BR>>
https://lists.sourceforge.net/lists/listinfo/ebxmlms-general<BR>>
> > > ><BR>>
-------------------------------------------------------
This<BR>> SF.net<BR>>
> > > > email is sponsored by: Splunk Inc. Do
you grep through<BR>> log files
for<BR>> > > > > problems?
Stop! Download the new AJAX search engine<BR>>
that makes<BR>> > > >
> searching your log files as easy as surfing the web.<BR>>
DOWNLOAD SPLUNK!<BR>>
> > > ><BR>>
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click<BR>>
> > > >
_______________________________________________<BR>>
ebxmlms-general<BR>> >
> > > mailing list
ebx...@li...<BR>>
> > > ><BR>>
https://lists.sourceforge.net/lists/listinfo/ebxmlms-general<BR>>
> > > -- <BR>>
> > > Ladislav Urban<BR>>
> > > CEO<BR>>
> > > Webswell Inc.<BR>> >
> > 1333 Howe Avenue, Suite 100<BR>>
> > > Sacramento, 95825 CA<BR>>
> > > email: lad...@we...<BR>>
> > > phone: +1 (916) 290-2040<BR>>
> > > fax: +1 (916)
921-2850<BR>> > > >
http://www.webswell.com<BR>> > >
><BR>> > > ><BR>>
> > ><BR>>
> > >
-------------------------------------------------------<BR>>
> > > This SF.net email is sponsored by:
Splunk Inc. Do you<BR>> grep through
log<BR>> > > files<BR>>
> > > for problems? Stop!
Download the new AJAX search<BR>>
engine that makes<BR>> > > >
searching your log files as easy as surfing the web.<BR>>
DOWNLOAD SPLUNK!<BR>>
> > >
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click<BR>>
> > >
_______________________________________________<BR>>
> > > ebxmlms-general mailing list<BR>>
> > >
ebx...@li...<BR>>
> > ><BR>>
https://lists.sourceforge.net/lists/listinfo/ebxmlms-general<BR>>
> > ><BR>>
> > <BR>> > > <BR>>
> > <BR>>
> >
-------------------------------------------------------<BR>>
> > This SF.net email is sponsored by:
Splunk Inc. Do you grep<BR>> through log
files<BR>> > > for problems?
Stop! Download the new AJAX search engine<BR>>
that makes<BR>>
> > searching your log files as easy as surfing the
web.<BR>> DOWNLOAD
SPLUNK!<BR>> > >
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click<BR>>
> >
_______________________________________________<BR>>
> > ebxmlms-general mailing list<BR>>
> >
ebx...@li...<BR>>
> ><BR>>
https://lists.sourceforge.net/lists/listinfo/ebxmlms-general<BR>>
> <BR>>
> <BR>> > <BR>>
>
-------------------------------------------------------<BR>>
> This SF.net email is sponsored by: Splunk
Inc. Do you grep<BR>> through log
files<BR>> > for problems?
Stop! Download the new AJAX search engine<BR>>
that makes<BR>>
> searching your log files as easy as surfing the web.<BR>>
DOWNLOAD SPLUNK!<BR>>
>
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click<BR>>
>
_______________________________________________<BR>>
> ebxmlms-general mailing list<BR>>
> ebx...@li...<BR>>
>
https://lists.sourceforge.net/lists/listinfo/ebxmlms-general<BR>>
> <BR>>
-- <BR>> Ladislav Urban<BR>>
CEO<BR>> Webswell
Inc.<BR>> 1333 Howe Avenue, Suite
100<BR>> Sacramento, 95825 CA<BR>>
email: lad...@we...<BR>>
phone: +1 (916) 290-2040<BR>>
fax: +1 (916) 921-2850<BR>>
http://www.webswell.com<BR>>
<BR>> <BR>>
<BR>>
-------------------------------------------------------<BR>>
This SF.net email is sponsored by: Splunk Inc. Do
you grep<BR>> through log files<BR>>
for problems? Stop! Download
the new AJAX search engine that<BR>>
makes<BR>> searching your log files as
easy as surfing the web.<BR>>
DOWNLOAD SPLUNK!<BR>>
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click<BR>>
_______________________________________________<BR>>
ebxmlms-general mailing list<BR>>
ebx...@li...<BR>>
https://lists.sourceforge.net/lists/listinfo/ebxmlms-general<BR>>
------------------------------------------------------- This
SF.net<BR>> email is sponsored by: Splunk Inc. Do you grep through
log files for<BR>> problems? Stop! Download the new AJAX search
engine that makes<BR>> searching your log files as easy as surfing
the web. DOWNLOAD SPLUNK!<BR>>
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click<BR>>
_______________________________________________ ebxmlms-general<BR>>
mailing list ebx...@li...<BR>>
https://lists.sourceforge.net/lists/listinfo/ebxmlms-general<BR>--
<BR>Ladislav Urban<BR>CEO<BR>Webswell Inc.<BR>1333 Howe Avenue, Suite
100<BR>Sacramento, 95825 CA<BR>email:
lad...@we...<BR>phone: +1 (916) 290-2040<BR>fax: +1
(916)
921-2850<BR>http://www.webswell.com<BR><BR><BR><BR>-------------------------------------------------------<BR>This
SF.net email is sponsored by: Splunk Inc. Do you grep through log
files<BR>for problems? Stop! Download the new AJAX search
engine that makes<BR>searching your log files as easy as surfing the
web. DOWNLOAD
SPLUNK!<BR>http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click<BR>_______________________________________________<BR>ebxmlms-general
mailing
list<BR>ebx...@li...<BR>https://lists.sourceforge.net/lists/listinfo/ebxmlms-general
</BLOCKQUOTE>
|