Discussion:
add namespaces to <soap:Header> and <soap:Envelope> tags
Marco Firrincieli
2012-10-18 08:14:04 UTC
Permalink
For some reason I cant' seem to create <soap:Header> and <soap:Envelope>
tags the way I want them to be.

I need <soap:Header> to contain the reference to a particular namespace
so something like <soap:Header xmlns:mfi="http://this.particular.ns.com">

and soap:Envelope has to be
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="
http://this.particular.com" xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/">

How is that possible?

I've tried with something like this:

List<Header> headers = new ArrayList<Header>();
QName qName = new QName(...)
Header dummyHeader = new Header(...);
headers.add(dummyHeader);
Map<String, Object> requestContext = ((javax.xml.ws.BindingProvider)
port).getRequestContext();
requestContext.put(Header.HEADER_LIST, headers);

But this adds ns to <soap:Header> sub-tags.

For the envelope part I'm not sure where to start.
Freeman Fang
2012-10-18 08:26:00 UTC
Permalink
Hi,

For the extra namespace in soap:Envelope, the property soap.env.ns.map could help, you can search this forum to get how to use soap.env.ns.map.

For the extra namespace in soap:Header, not sure if there's really a way to do so.

Freeman(Yue) Fang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042
Post by Marco Firrincieli
For some reason I cant' seem to create <soap:Header> and <soap:Envelope>
tags the way I want them to be.
I need <soap:Header> to contain the reference to a particular namespace
so something like <soap:Header xmlns:mfi="http://this.particular.ns.com">
and soap:Envelope has to be
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="
http://this.particular.com" xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/">
How is that possible?
List<Header> headers = new ArrayList<Header>();
QName qName = new QName(...)
Header dummyHeader = new Header(...);
headers.add(dummyHeader);
Map<String, Object> requestContext = ((javax.xml.ws.BindingProvider)
port).getRequestContext();
requestContext.put(Header.HEADER_LIST, headers);
But this adds ns to <soap:Header> sub-tags.
For the envelope part I'm not sure where to start.
Willem jiang
2012-10-18 08:36:22 UTC
Permalink
Here is the thread[1] for it.

[1]http://cxf.547215.n5.nabble.com/add-namespace-to-soap-header-td5716003.html

--
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang
Weibo: willemjiang
Post by Freeman Fang
Hi,
For the extra namespace in soap:Envelope, the property soap.env.ns.map could help, you can search this forum to get how to use soap.env.ns.map.
For the extra namespace in soap:Header, not sure if there's really a way to do so.
-------------
Freeman(Yue) Fang
Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042
Post by Marco Firrincieli
For some reason I cant' seem to create <soap:Header> and <soap:Envelope>
tags the way I want them to be.
I need <soap:Header> to contain the reference to a particular namespace
so something like <soap:Header xmlns:mfi="http://this.particular.ns.com">
and soap:Envelope has to be
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="
http://this.particular.com" xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/">
How is that possible?
List<Header> headers = new ArrayList<Header>();
QName qName = new QName(...)
Header dummyHeader = new Header(...);
headers.add(dummyHeader);
Map<String, Object> requestContext = ((javax.xml.ws.BindingProvider)
port).getRequestContext();
requestContext.put(Header.HEADER_LIST, headers);
But this adds ns to <soap:Header> sub-tags.
For the envelope part I'm not sure where to start.
Loading...