You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Richard Grantham <rg...@limehousesoftware.co.uk> on 2008/05/07 10:15:15 UTC

Namespaces on attributes

Hi list,

I have been porting our current application from XFire to CXF. I think
I'm 80% of the way there now but have run into an issue with the SOAP
output from a Web service.

As shown in the below output the id attribute on the message is in the
namespace ns1. XFire would put this in no namespace. This is a big issue
for me because we do a lot of XSLT work with SOAP results and unless I
can supress adding namespaces to attributes I will need to rewrite a
huge number of XSLTs. Any assistance on how I can do this?

<ns1:message ns1:id="132">
	<ns1:createdBy>1</ns1:createdBy>
	<ns1:createdOn>2007-11-21T12:56:33.257Z</ns1:createdOn>
	<ns1:messageXml>
		<messageXml>Do it NOW!</messageXml>
	</ns1:messageXml>
</ns1:message>

Also, the only other issue I have is that on my development machine a
service can take up to 30 seconds to initialise. Given that I have over
30 services I've found the startup time for the app server is about 10
minutes. Any way I could bring this down?

rgds,

Richard



Richard Grantham
Development

-------------------------------
rgrantham@limehousesoftware.co.uk
Limehouse Software Ltd
DDI: (020) 7566 3336
Main: (020) 7566 3320
Fax: (020) 7566 3321
Limehouse Software Ltd
4th Floor
1 London Bridge
London
SE1 9BG
Manchester Office:
3rd Floor, The Triangle, Exchange Square, Manchester M4 3TR
Tel: (0161) 240 2440, Fax: (0161) 240 2441, ISDN: 08700 119 400
Check out Limehouse Software's innovative solutions
www.limehousesoftware.co.uk - Transforming the way you publish and consult on information
The information contained in this e-mail or in any attachments is confidential and is intended solely for the named addressee only. Access to this e-mail by anyone else is unauthorised. If you are not the intended recipient, please notify Limehouse Software Ltd immediately by returning this e-mail to sender or calling 020 7566 3320 and do not read, use or disseminate the information. Opinions expressed in this e-mail are those of the sender and not necessarily the company. Although an active anti-virus policy is operated, the company accepts no liability for any damage caused by any virus transmitted by this e-mail, including any attachments.

Re: Namespaces on attributes

Posted by Benson Margulies <bi...@gmail.com>.
OK, I see. I'll try to read code tonight and see if there's a buried
configuration option for Aegis.

On Thu, May 8, 2008 at 4:12 AM, Richard Grantham
<rg...@limehousesoftware.co.uk> wrote:
> With org.apache.cxf.aegis.type.java5.XmlAttribute:
>
> @XmlAttribute(name = "id")
> public Long getId() {
>    return this.id;
> }
>
> -----Original Message-----
> From: Benson Margulies [mailto:bimargulies@gmail.com]
> Sent: 08 May 2008 01:42
> To: users@cxf.apache.org
> Subject: Re: Namespaces on attributes
>
> I didn't know Aegis would ever put things into attributes at all, with
> or without namespaces.
>
> What is the java declaration of the thing that turns into an attribute
> with a namespace?
>
> On Wed, May 7, 2008 at 7:13 AM, Richard Grantham
> <rg...@limehousesoftware.co.uk> wrote:
>> I'm running 2.0.6. I assume I need to set
>> attributeFormDefault="unqualified" somewhere. But where? My config
>> looks  like this:
>>
>>         <bean id="dataBinding"
>>  class="org.apache.cxf.aegis.databinding.AegisDatabinding"
>>  scope="prototype" />
>>         <bean id="serviceFactory"
>>  class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean"
>>  scope="prototype">
>>                 <property name="dataBinding" ref="dataBinding" />
>>                 <property name="serviceConfigurations">
>>                         <list>
>>                                 <bean
>>  class="org.apache.cxf.jaxws.support.JaxWsServiceConfiguration" />
>>                                 <bean
>>  class="org.apache.cxf.aegis.databinding.AegisServiceConfiguration" />
>>                                 <bean
>>  class="org.apache.cxf.service.factory.DefaultServiceConfiguration" />
>>                         </list>
>>                 </property>
>>         </bean>
>>
>>         <jaxws:endpoint id="messageService"
>>  implementor="#messageServiceImpl" address="/messageService">
>>                 <jaxws:serviceFactory>
>>                         <ref bean="serviceFactory" />
>>                 </jaxws:serviceFactory>
>>         </jaxws:endpoint>
>>
>>
>>
>>
>>  Richard Grantham
>>  Development
>>
>>  -------------------------------
>>  rgrantham@limehousesoftware.co.uk
>>  Limehouse Software Ltd
>>  DDI: (020) 7566 3336
>>  Main: (020) 7566 3320
>>  Fax: (020) 7566 3321
>>  Limehouse Software Ltd
>>  4th Floor
>>  1 London Bridge
>>  London
>>  SE1 9BG
>>  Manchester Office:
>>  3rd Floor, The Triangle, Exchange Square, Manchester M4 3TR
>>  Tel: (0161) 240 2440, Fax: (0161) 240 2441, ISDN: 08700 119 400
>> Check out Limehouse Software's innovative solutions
>> www.limehousesoftware.co.uk - Transforming the way you publish and
>> consult on information  The information contained in this e-mail or in
>
>> any attachments is confidential and is intended solely for the named
>> addressee only. Access to this e-mail by anyone else is unauthorised.
>> If you are not the intended recipient, please notify Limehouse
>> Software Ltd immediately by returning this e-mail to sender or calling
>
>> 020 7566 3320 and do not read, use or disseminate the information.
>> Opinions expressed in this e-mail are those of the sender and not
>> necessarily the company. Although an active anti-virus policy is
>> operated, the company accepts no liability for any damage caused by
>> any virus transmitted by this e-mail, including any
>> attachments.-----Original Message-----
>>  From: Benson Margulies [mailto:bimargulies@gmail.com]
>>  Sent: 07 May 2008 12:01
>>  To: users@cxf.apache.org
>>  Subject: Re: Namespaces on attributes
>>
>>
>>
>>  What version of CXF are you running?
>>
>

Re: Namespaces on attributes

Posted by Benson Margulies <bi...@gmail.com>.
unqualified attributes are on the trunk, at least for users of @XmlAttribute.

RE: Namespaces on attributes

Posted by Richard Grantham <rg...@limehousesoftware.co.uk>.
I'm inclined to agree with Dan. But I'm sure people would appreciate
having the option.

Thanks for your help on this.




Richard Grantham
Development

-------------------------------
rgrantham@limehousesoftware.co.uk
Limehouse Software Ltd
DDI: (020) 7566 3336
Main: (020) 7566 3320
Fax: (020) 7566 3321
Limehouse Software Ltd
4th Floor
1 London Bridge
London
SE1 9BG
Manchester Office:
3rd Floor, The Triangle, Exchange Square, Manchester M4 3TR
Tel: (0161) 240 2440, Fax: (0161) 240 2441, ISDN: 08700 119 400
Check out Limehouse Software's innovative solutions
www.limehousesoftware.co.uk - Transforming the way you publish and consult on information
The information contained in this e-mail or in any attachments is confidential and is intended solely for the named addressee only. Access to this e-mail by anyone else is unauthorised. If you are not the intended recipient, please notify Limehouse Software Ltd immediately by returning this e-mail to sender or calling 020 7566 3320 and do not read, use or disseminate the information. Opinions expressed in this e-mail are those of the sender and not necessarily the company. Although an active anti-virus policy is operated, the company accepts no liability for any damage caused by any virus transmitted by this e-mail, including any attachments.-----Original Message-----
From: Benson Margulies [mailto:bimargulies@gmail.com] 
Sent: 14 May 2008 20:48
To: users@cxf.apache.org
Subject: Re: Namespaces on attributes

I started to work on something like what you suggested. I then realized
that the element aspect of this would be really tough, but the attribute
side would be not too bad. So I'm inclined to go ahead with attributes.
Dan even suggests de-qualifying them by default.

Re: Namespaces on attributes

Posted by Benson Margulies <bi...@gmail.com>.
I started to work on something like what you suggested. I then
realized that the element aspect of this would be really tough, but
the attribute side would be not too bad. So I'm inclined to go ahead
with attributes. Dan even suggests de-qualifying them by default.

Re: Namespaces on attributes

Posted by Benson Margulies <bi...@gmail.com>.
Yup, and don't even go near changing how elements work?

Re: Namespaces on attributes

Posted by Daniel Kulp <dk...@apache.org>.
The "simple" fix might be to make aegis make all attribute unqualifed  
by default (to match what most people expect) and then provide the  
configuration overrides (either via xml config or from the  
annotations) to change that on a per-attribute basis.

For example, in this case, if he had done:

> @XmlAttribute(name = "id", namespace="http://the.namespace")


then it would have been qualified.   If no namespace attribute, then  
unqualified.

Dan





On May 8, 2008, at 9:13 PM, Benson Margulies wrote:

> I read the code.
>
> As the code exists in CXF, Aegis has no feature for creating
> unqualified attributes.
>
> However, the WSDL should correctly describe their qualified status, so
> conformant clients should work.
>
> The annotation you are using is based on JAXB. In JAXB, you would use,
> I think, a package-level annotation to set the qualification default.
> Aegis lacks a concept of package-level options.
>
> I could add a databinding option to make attributes unqualified, it
> wouldn't be too tough. I would, however, add it to 2.1.x, not 2.0.x.
> Can you move to that stream?

---
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog





RE: Namespaces on attributes

Posted by Richard Grantham <rg...@limehousesoftware.co.uk>.
Yes. I don't really have a timescale to switch to CXF but it would be
useful for the future for our application to do so. That would be good
feature to have.




Richard Grantham
Development

-------------------------------
rgrantham@limehousesoftware.co.uk
Limehouse Software Ltd
DDI: (020) 7566 3336
Main: (020) 7566 3320
Fax: (020) 7566 3321
Limehouse Software Ltd
4th Floor
1 London Bridge
London
SE1 9BG
Manchester Office:
3rd Floor, The Triangle, Exchange Square, Manchester M4 3TR
Tel: (0161) 240 2440, Fax: (0161) 240 2441, ISDN: 08700 119 400
Check out Limehouse Software's innovative solutions
www.limehousesoftware.co.uk - Transforming the way you publish and consult on information
The information contained in this e-mail or in any attachments is confidential and is intended solely for the named addressee only. Access to this e-mail by anyone else is unauthorised. If you are not the intended recipient, please notify Limehouse Software Ltd immediately by returning this e-mail to sender or calling 020 7566 3320 and do not read, use or disseminate the information. Opinions expressed in this e-mail are those of the sender and not necessarily the company. Although an active anti-virus policy is operated, the company accepts no liability for any damage caused by any virus transmitted by this e-mail, including any attachments.-----Original Message-----
From: Benson Margulies [mailto:bimargulies@gmail.com] 
Sent: 09 May 2008 02:13
To: users@cxf.apache.org
Subject: Re: Namespaces on attributes

I read the code.

As the code exists in CXF, Aegis has no feature for creating unqualified
attributes.

However, the WSDL should correctly describe their qualified status, so
conformant clients should work.

The annotation you are using is based on JAXB. In JAXB, you would use, I
think, a package-level annotation to set the qualification default.
Aegis lacks a concept of package-level options.

I could add a databinding option to make attributes unqualified, it
wouldn't be too tough. I would, however, add it to 2.1.x, not 2.0.x.
Can you move to that stream?

RE: Namespaces on attributes

Posted by Richard Grantham <rg...@limehousesoftware.co.uk>.
Hi Benson,

BTW, would the change be to the attribute, or would you make enable me
to set a property on my service which I could set like the following?

<jaxws:endpoint id="messageService" implementor="#messageServiceImpl"
address="/messageService">
	<jaxws:serviceFactory>
		<ref bean="serviceFactory" />
	</jaxws:serviceFactory>
	<jaxws:properties>
		<entry key="attributeFormDefault" value="unqualified" />
		<entry key="elementFormDefault" value="qualified" />
	</jaxws:properties>
</jaxws:endpoint> 

The ability to set a property may be more useful.

rgds,

Richard




Richard Grantham
Development

-------------------------------
rgrantham@limehousesoftware.co.uk
Limehouse Software Ltd
DDI: (020) 7566 3336
Main: (020) 7566 3320
Fax: (020) 7566 3321
Limehouse Software Ltd
4th Floor
1 London Bridge
London
SE1 9BG
Manchester Office:
3rd Floor, The Triangle, Exchange Square, Manchester M4 3TR
Tel: (0161) 240 2440, Fax: (0161) 240 2441, ISDN: 08700 119 400
Check out Limehouse Software's innovative solutions
www.limehousesoftware.co.uk - Transforming the way you publish and consult on information
The information contained in this e-mail or in any attachments is confidential and is intended solely for the named addressee only. Access to this e-mail by anyone else is unauthorised. If you are not the intended recipient, please notify Limehouse Software Ltd immediately by returning this e-mail to sender or calling 020 7566 3320 and do not read, use or disseminate the information. Opinions expressed in this e-mail are those of the sender and not necessarily the company. Although an active anti-virus policy is operated, the company accepts no liability for any damage caused by any virus transmitted by this e-mail, including any attachments.-----Original Message-----
From: Benson Margulies [mailto:bimargulies@gmail.com] 
Sent: 09 May 2008 02:13
To: users@cxf.apache.org
Subject: Re: Namespaces on attributes

I read the code.

As the code exists in CXF, Aegis has no feature for creating unqualified
attributes.

However, the WSDL should correctly describe their qualified status, so
conformant clients should work.

The annotation you are using is based on JAXB. In JAXB, you would use, I
think, a package-level annotation to set the qualification default.
Aegis lacks a concept of package-level options.

I could add a databinding option to make attributes unqualified, it
wouldn't be too tough. I would, however, add it to 2.1.x, not 2.0.x.
Can you move to that stream?

Re: Namespaces on attributes

Posted by Benson Margulies <bi...@gmail.com>.
I read the code.

As the code exists in CXF, Aegis has no feature for creating
unqualified attributes.

However, the WSDL should correctly describe their qualified status, so
conformant clients should work.

The annotation you are using is based on JAXB. In JAXB, you would use,
I think, a package-level annotation to set the qualification default.
Aegis lacks a concept of package-level options.

I could add a databinding option to make attributes unqualified, it
wouldn't be too tough. I would, however, add it to 2.1.x, not 2.0.x.
Can you move to that stream?

RE: Namespaces on attributes

Posted by Richard Grantham <rg...@limehousesoftware.co.uk>.
With org.apache.cxf.aegis.type.java5.XmlAttribute:

@XmlAttribute(name = "id")
public Long getId() {
    return this.id;
} 

-----Original Message-----
From: Benson Margulies [mailto:bimargulies@gmail.com] 
Sent: 08 May 2008 01:42
To: users@cxf.apache.org
Subject: Re: Namespaces on attributes

I didn't know Aegis would ever put things into attributes at all, with
or without namespaces.

What is the java declaration of the thing that turns into an attribute
with a namespace?

On Wed, May 7, 2008 at 7:13 AM, Richard Grantham
<rg...@limehousesoftware.co.uk> wrote:
> I'm running 2.0.6. I assume I need to set  
> attributeFormDefault="unqualified" somewhere. But where? My config 
> looks  like this:
>
>         <bean id="dataBinding"
>  class="org.apache.cxf.aegis.databinding.AegisDatabinding"
>  scope="prototype" />
>         <bean id="serviceFactory"
>  class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean"
>  scope="prototype">
>                 <property name="dataBinding" ref="dataBinding" />
>                 <property name="serviceConfigurations">
>                         <list>
>                                 <bean
>  class="org.apache.cxf.jaxws.support.JaxWsServiceConfiguration" />
>                                 <bean
>  class="org.apache.cxf.aegis.databinding.AegisServiceConfiguration" />
>                                 <bean
>  class="org.apache.cxf.service.factory.DefaultServiceConfiguration" />
>                         </list>
>                 </property>
>         </bean>
>
>         <jaxws:endpoint id="messageService"
>  implementor="#messageServiceImpl" address="/messageService">
>                 <jaxws:serviceFactory>
>                         <ref bean="serviceFactory" />
>                 </jaxws:serviceFactory>
>         </jaxws:endpoint>
>
>
>
>
>  Richard Grantham
>  Development
>
>  -------------------------------
>  rgrantham@limehousesoftware.co.uk
>  Limehouse Software Ltd
>  DDI: (020) 7566 3336
>  Main: (020) 7566 3320
>  Fax: (020) 7566 3321
>  Limehouse Software Ltd
>  4th Floor
>  1 London Bridge
>  London
>  SE1 9BG
>  Manchester Office:
>  3rd Floor, The Triangle, Exchange Square, Manchester M4 3TR
>  Tel: (0161) 240 2440, Fax: (0161) 240 2441, ISDN: 08700 119 400  
> Check out Limehouse Software's innovative solutions  
> www.limehousesoftware.co.uk - Transforming the way you publish and 
> consult on information  The information contained in this e-mail or in

> any attachments is confidential and is intended solely for the named 
> addressee only. Access to this e-mail by anyone else is unauthorised. 
> If you are not the intended recipient, please notify Limehouse 
> Software Ltd immediately by returning this e-mail to sender or calling

> 020 7566 3320 and do not read, use or disseminate the information. 
> Opinions expressed in this e-mail are those of the sender and not 
> necessarily the company. Although an active anti-virus policy is 
> operated, the company accepts no liability for any damage caused by 
> any virus transmitted by this e-mail, including any 
> attachments.-----Original Message-----
>  From: Benson Margulies [mailto:bimargulies@gmail.com]
>  Sent: 07 May 2008 12:01
>  To: users@cxf.apache.org
>  Subject: Re: Namespaces on attributes
>
>
>
>  What version of CXF are you running?
>

Re: Namespaces on attributes

Posted by Benson Margulies <bi...@gmail.com>.
I didn't know Aegis would ever put things into attributes at all, with
or without namespaces.

What is the java declaration of the thing that turns into an attribute
with a namespace?

On Wed, May 7, 2008 at 7:13 AM, Richard Grantham
<rg...@limehousesoftware.co.uk> wrote:
> I'm running 2.0.6. I assume I need to set
>  attributeFormDefault="unqualified" somewhere. But where? My config looks
>  like this:
>
>         <bean id="dataBinding"
>  class="org.apache.cxf.aegis.databinding.AegisDatabinding"
>  scope="prototype" />
>         <bean id="serviceFactory"
>  class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean"
>  scope="prototype">
>                 <property name="dataBinding" ref="dataBinding" />
>                 <property name="serviceConfigurations">
>                         <list>
>                                 <bean
>  class="org.apache.cxf.jaxws.support.JaxWsServiceConfiguration" />
>                                 <bean
>  class="org.apache.cxf.aegis.databinding.AegisServiceConfiguration" />
>                                 <bean
>  class="org.apache.cxf.service.factory.DefaultServiceConfiguration" />
>                         </list>
>                 </property>
>         </bean>
>
>         <jaxws:endpoint id="messageService"
>  implementor="#messageServiceImpl" address="/messageService">
>                 <jaxws:serviceFactory>
>                         <ref bean="serviceFactory" />
>                 </jaxws:serviceFactory>
>         </jaxws:endpoint>
>
>
>
>
>  Richard Grantham
>  Development
>
>  -------------------------------
>  rgrantham@limehousesoftware.co.uk
>  Limehouse Software Ltd
>  DDI: (020) 7566 3336
>  Main: (020) 7566 3320
>  Fax: (020) 7566 3321
>  Limehouse Software Ltd
>  4th Floor
>  1 London Bridge
>  London
>  SE1 9BG
>  Manchester Office:
>  3rd Floor, The Triangle, Exchange Square, Manchester M4 3TR
>  Tel: (0161) 240 2440, Fax: (0161) 240 2441, ISDN: 08700 119 400
>  Check out Limehouse Software's innovative solutions
>  www.limehousesoftware.co.uk - Transforming the way you publish and consult on information
>  The information contained in this e-mail or in any attachments is confidential and is intended solely for the named addressee only. Access to this e-mail by anyone else is unauthorised. If you are not the intended recipient, please notify Limehouse Software Ltd immediately by returning this e-mail to sender or calling 020 7566 3320 and do not read, use or disseminate the information. Opinions expressed in this e-mail are those of the sender and not necessarily the company. Although an active anti-virus policy is operated, the company accepts no liability for any damage caused by any virus transmitted by this e-mail, including any attachments.-----Original Message-----
>  From: Benson Margulies [mailto:bimargulies@gmail.com]
>  Sent: 07 May 2008 12:01
>  To: users@cxf.apache.org
>  Subject: Re: Namespaces on attributes
>
>
>
>  What version of CXF are you running?
>

RE: Namespaces on attributes

Posted by Richard Grantham <rg...@limehousesoftware.co.uk>.
I'm running 2.0.6. I assume I need to set
attributeFormDefault="unqualified" somewhere. But where? My config looks
like this:

	<bean id="dataBinding"
class="org.apache.cxf.aegis.databinding.AegisDatabinding"
scope="prototype" /> 
	<bean id="serviceFactory"
class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean"
scope="prototype">
		<property name="dataBinding" ref="dataBinding" />
		<property name="serviceConfigurations">
			<list>
				<bean
class="org.apache.cxf.jaxws.support.JaxWsServiceConfiguration" />
				<bean
class="org.apache.cxf.aegis.databinding.AegisServiceConfiguration" />
				<bean
class="org.apache.cxf.service.factory.DefaultServiceConfiguration" /> 
			</list>
		</property>
	</bean>

	<jaxws:endpoint id="messageService"
implementor="#messageServiceImpl" address="/messageService">
		<jaxws:serviceFactory>
			<ref bean="serviceFactory" />
		</jaxws:serviceFactory>
	</jaxws:endpoint>




Richard Grantham
Development

-------------------------------
rgrantham@limehousesoftware.co.uk
Limehouse Software Ltd
DDI: (020) 7566 3336
Main: (020) 7566 3320
Fax: (020) 7566 3321
Limehouse Software Ltd
4th Floor
1 London Bridge
London
SE1 9BG
Manchester Office:
3rd Floor, The Triangle, Exchange Square, Manchester M4 3TR
Tel: (0161) 240 2440, Fax: (0161) 240 2441, ISDN: 08700 119 400
Check out Limehouse Software's innovative solutions
www.limehousesoftware.co.uk - Transforming the way you publish and consult on information
The information contained in this e-mail or in any attachments is confidential and is intended solely for the named addressee only. Access to this e-mail by anyone else is unauthorised. If you are not the intended recipient, please notify Limehouse Software Ltd immediately by returning this e-mail to sender or calling 020 7566 3320 and do not read, use or disseminate the information. Opinions expressed in this e-mail are those of the sender and not necessarily the company. Although an active anti-virus policy is operated, the company accepts no liability for any damage caused by any virus transmitted by this e-mail, including any attachments.-----Original Message-----
From: Benson Margulies [mailto:bimargulies@gmail.com] 
Sent: 07 May 2008 12:01
To: users@cxf.apache.org
Subject: Re: Namespaces on attributes

What version of CXF are you running?

Re: Namespaces on attributes

Posted by Benson Margulies <bi...@gmail.com>.
What version of CXF are you running?