You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by sebge2 <se...@cyberplongeurs.be> on 2010/10/28 12:17:23 UTC
Add SOAP header to WSDL
Hello,
When the WSDL is auto-generated, the only way to add (in the WSDL) a SOAP
header entry is to declare an input param in the method.
For instance: void myMethod(@WebParam(header=true) MySoapHeaderEntry entry)
Unfortunately, it means that we have to declare the param in every method,
in every webservice even if we are not using it. Indeed, if some web
services are using the same header entry, it's stupid to pollute every
methods of those WS. It's preferable to use an interceptor for that purpose.
But, using an interceptor means that the WSDL is no more up-to-date.
As far as I know, it's not possible to do that in CXF.
I'm right?
Don't you think that it could be interesting to have that feature?
Thank you :)
--
View this message in context: http://cxf.547215.n5.nabble.com/Add-SOAP-header-to-WSDL-tp3240264p3240264.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Add SOAP header to WSDL
Posted by Daniel Kulp <dk...@apache.org>.
On Thursday, July 05, 2012 04:38:17 AM MiTaes wrote:
> Hi Daniel,
>
> did you ever follow-up on your suggestions. This would be exactly what I
> need for my SEI: I want to declare the header to be used but not clutter
> the operations with the header info as the header will be handled by an
> interceptor.
Never had time to pursue it. Sorry. :-(
Dan
> Thanks and Regards,
> Michael
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Add-SOAP-header-to-WSDL-tp3240264p5710638
> .html Sent from the cxf-user mailing list archive at Nabble.com.
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com
Re: Add SOAP header to WSDL
Posted by MiTaes <m....@googlemail.com>.
Hi Daniel,
did you ever follow-up on your suggestions. This would be exactly what I
need for my SEI: I want to declare the header to be used but not clutter the
operations with the header info as the header will be handled by an
interceptor.
Thanks and Regards,
Michael
--
View this message in context: http://cxf.547215.n5.nabble.com/Add-SOAP-header-to-WSDL-tp3240264p5710638.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Add SOAP header to WSDL
Posted by Daniel Kulp <dk...@apache.org>.
On Thursday 28 October 2010 6:17:23 am sebge2 wrote:
> Hello,
>
> When the WSDL is auto-generated, the only way to add (in the WSDL) a SOAP
> header entry is to declare an input param in the method.
>
> For instance: void myMethod(@WebParam(header=true) MySoapHeaderEntry entry)
>
>
> Unfortunately, it means that we have to declare the param in every method,
> in every webservice even if we are not using it. Indeed, if some web
> services are using the same header entry, it's stupid to pollute every
> methods of those WS. It's preferable to use an interceptor for that
> purpose. But, using an interceptor means that the WSDL is no more
> up-to-date.
>
> As far as I know, it's not possible to do that in CXF.
No, it's not, but you got me thinking.... :-)
> I'm right?
>
> Don't you think that it could be interesting to have that feature?
Definitely an interesting to have feature. Is it something you would be
willing to help out with?
My initial thought with 2.3.0 was to add a @SoapHeader annotation or similar
that would work something like:
SoapHeader( name = "ElmentName",
targetNamespace=".....",
[ partName = "...",]
[ type = SomeClass.class ],
[ typeName = "..."],
[ outOfBand = true/false],
direction=IN/OUT //maybe, not sure )
If added to the SEI or impl itself, it would apply to all methods in the
portType. When generating the wsdl, all the operations would have it added.
Otherwise, it could be added to the specific methods itself.
The name/targetNamespace would be used to assign the element name for the
header. The outOfBand would control if the header is mapped into the same
WSDL message as the body or if out of band messages would be created. The
type/typeName things would be used to Assign the "type" for the element. If
the class is specified, we SHOULD be able to use that at runtime for
marshalling/unmarshalling directly to the class.
What do you think? Willing to help on that? I can provide pointers of where
to start. :-)
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog