You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by Paul Fremantle <pz...@gmail.com> on 2008/01/22 17:42:43 UTC

Issue with Axiom generated namespaces

I have come across a customer who has a problem with Axiom.
They are letting Axiom generate the namespaces, but the way Axiom
seems to do this is by having a JVM-wide setting which increments each
time.

The problem is that over time the numbers are getting very large
indeed, making the messages very big

I have three proposals: 1) we maintain a cache of ns->uri mappings and
reuse them if they match.

or

2) We hash the namespace and use the hash as the prefix

or

3) we simply choose a large number like 9999 and loop round when we
get to it, on the assumption that no XML document will have 10000
namespaces in it.

Thoughts?
Paul
-- 
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair

blog: http://pzf.fremantle.org
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


Re: Issue with Axiom generated namespaces

Posted by Glen Daniels <gl...@thoughtcraft.com>.
Hi folks:

Ajith Ranabahu wrote:
> AFAIK this happens during serialization. One thing we can do is it use
> a instance wide counter (not a static jvm-wide one) so that everytime
> a document is serialized, we start from the initial state of the
> counter. I cannot think of any ill behaviors in doing that.

Absolutely!  IMO if we're keeping a *static* counter that's definitely a 
bug.  We should be behaving as you describe, starting from 1 each time 
we serialize.

We might have some difficulty doing this easily depending on how 
OMNamespace is working (I haven't been deep into this code in long 
enough that I don't recall exactly)... we need to make sure that the 
"placeholder" namespaces for autogenerated ones are resolved at 
serialization time, and not before.

Anyone up for looking into this?

--Glen

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


Re: Issue with Axiom generated namespaces

Posted by Ajith Ranabahu <aj...@gmail.com>.
I suppose you meant the ns prefix - is it ?

I'm in a bit of a dilemma about this. On one hand  we get the ability
to do the custom mapping thing if we do the caching but it definitely
increases the memory footprint. The integer solution is not elegant
but works well in a streaming scenario where you have to remember very
little.

AFAIK this happens during serialization. One thing we can do is it use
a instance wide counter (not a static jvm-wide one) so that everytime
a document is serialized, we start from the initial state of the
counter. I cannot think of any ill behaviors in doing that.

Ajith

On Jan 22, 2008 11:46 AM, Davanum Srinivas <da...@gmail.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Paul,
>
> Are they using wsdl2Java generated code?
>
> - -- dims
>
> Paul Fremantle wrote:
> | I have come across a customer who has a problem with Axiom.
> | They are letting Axiom generate the namespaces, but the way Axiom
> | seems to do this is by having a JVM-wide setting which increments each
> | time.
> |
> | The problem is that over time the numbers are getting very large
> | indeed, making the messages very big
> |
> | I have three proposals: 1) we maintain a cache of ns->uri mappings and
> | reuse them if they match.
> |
> | or
> |
> | 2) We hash the namespace and use the hash as the prefix
> |
> | or
> |
> | 3) we simply choose a large number like 9999 and loop round when we
> | get to it, on the assumption that no XML document will have 10000
> | namespaces in it.
> |
> | Thoughts?
> | Paul
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (Cygwin)
>
> iD8DBQFHlh3vgNg6eWEDv1kRAocrAKCWkQfKOzU8E2pQsvg7DtJTjTzXDACfc/X8
> 7j9Ws7+dEDes02zcXukyEn4=
> =KgXz
> -----END PGP SIGNATURE-----
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: commons-dev-help@ws.apache.org
>
>



-- 
Ajith Ranabahu

Reading, after a certain age, diverts the mind too much from its
creative pursuits. Any man who reads too much and uses his own brain
too little falls into lazy habits of thinking - Albert Einstein

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


Re: Issue with Axiom generated namespaces

Posted by Davanum Srinivas <da...@gmail.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Paul,

Are they using wsdl2Java generated code?

- -- dims

Paul Fremantle wrote:
| I have come across a customer who has a problem with Axiom.
| They are letting Axiom generate the namespaces, but the way Axiom
| seems to do this is by having a JVM-wide setting which increments each
| time.
|
| The problem is that over time the numbers are getting very large
| indeed, making the messages very big
|
| I have three proposals: 1) we maintain a cache of ns->uri mappings and
| reuse them if they match.
|
| or
|
| 2) We hash the namespace and use the hash as the prefix
|
| or
|
| 3) we simply choose a large number like 9999 and loop round when we
| get to it, on the assumption that no XML document will have 10000
| namespaces in it.
|
| Thoughts?
| Paul
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)

iD8DBQFHlh3vgNg6eWEDv1kRAocrAKCWkQfKOzU8E2pQsvg7DtJTjTzXDACfc/X8
7j9Ws7+dEDes02zcXukyEn4=
=KgXz
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


Re: Issue with Axiom generated namespaces

Posted by Alex Boisvert <bo...@intalio.com>.
On 1/22/08, Paul Fremantle <pz...@gmail.com> wrote:
>
> I have come across a customer who has a problem with Axiom.
> They are letting Axiom generate the namespaces, but the way Axiom
> seems to do this is by having a JVM-wide setting which increments each
> time.
>
> The problem is that over time the numbers are getting very large
> indeed, making the messages very big
>
> I have three proposals: 1) we maintain a cache of ns->uri mappings and
> reuse them if they match.


This would be my preference.   And a bonus if we could feed custom ns-uri
--> prefix mappings into the cache for better usability/readability.

alex