You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Davide Gesino <wi...@libero.it> on 2007/12/18 16:25:46 UTC

org.apache.cxf.binding.soap.SOAPMessage information organization

I have some problems with the logical organizations of data in the
SOAPMessage class.

I am trying to manage Message informations in the header: at this point I
have problems figuring out how the header infos are organized in this class.

Considering a message such as:

# BEFORE SENDING
in the PRE_PROTOCOL phase debugging I have found the infos with this (maybe
unorthodox) code:
ArrayList  obj = (ArrayList)message.get("client.holders");	
Holder<HeaderT> holder = (Holder<HeaderT>)obj.get(0);
HeaderT represents my header bean.

# AFTER RECEIVING
I can't understand how the info is organized.
in the POST_RECEIVE phase i do not get anything with the
message.get("client.holders") method.

using:
MessageInfo fuffa =
(MessageInfo)message.get("org.apache.cxf.service.model.MessageInfo");
MessagePartInfo maybeHeader = (MessagePartInfo)fuffa.getMessagePart(new
QName("tmf854.v1.ws","mtosiHeader"));
maybeHeader.getTypeClass() returns the right class HeaderT, but I cannot
find the HeaderT object inside the header.

What is the rationale in the scheme? how are the Message and SOAPMessage
classes organized and how the info is structired inside these classes?
How can I add and new Headers or change existing headers?



-- 
View this message in context: http://www.nabble.com/org.apache.cxf.binding.soap.SOAPMessage-information-organization-tp14398903p14398903.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: org.apache.cxf.binding.soap.SOAPMessage information organization

Posted by Davide Gesino <wi...@libero.it>.
Thanx a lot dan nd sorry for the silly question, but debugging I was driven
astray and I thought it was far more difficult than it was.

Davide


dkulp wrote:
> 
> 
> Davide,
> 
> It sounds like you missed the msg.getContent(...) call.
> 
> The content is different than the properties.   The properties are 
> generally metainformation that is used to pass things along while 
> processing the message.   The content is really the content that is 
> being manipulated.
> 
> In your case, you probably want to do:
> 
> List lst = msg.getContent(List.class);
> to return the list of objects.   The MessagePartInfo object that you DID 
> find is useful here as it has a getIndex() call on it to tell you where 
> in the above list the object corresponding to that call should be found.
> 
> Dan
> 
> 
> On Tuesday 18 December 2007, Davide Gesino wrote:
>> I have some problems with the logical organizations of data in the
>> SOAPMessage class.
>>
>> I am trying to manage Message informations in the header: at this
>> point I have problems figuring out how the header infos are organized
>> in this class.
>>
>> Considering a message such as:
>>
>> # BEFORE SENDING
>> in the PRE_PROTOCOL phase debugging I have found the infos with this
>> (maybe unorthodox) code:
>> ArrayList  obj = (ArrayList)message.get("client.holders");
>> Holder<HeaderT> holder = (Holder<HeaderT>)obj.get(0);
>> HeaderT represents my header bean.
>>
>> # AFTER RECEIVING
>> I can't understand how the info is organized.
>> in the POST_RECEIVE phase i do not get anything with the
>> message.get("client.holders") method.
>>
>> using:
>> MessageInfo fuffa =
>> (MessageInfo)message.get("org.apache.cxf.service.model.MessageInfo");
>> MessagePartInfo maybeHeader =
>> (MessagePartInfo)fuffa.getMessagePart(new
>> QName("tmf854.v1.ws","mtosiHeader"));
>> maybeHeader.getTypeClass() returns the right class HeaderT, but I
>> cannot find the HeaderT object inside the header.
>>
>> What is the rationale in the scheme? how are the Message and
>> SOAPMessage classes organized and how the info is structired inside
>> these classes? How can I add and new Headers or change existing
>> headers?
> 
> 
> 
> -- 
> J. Daniel Kulp
> Principal Engineer, IONA
> dkulp@apache.org
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: http://www.nabble.com/org.apache.cxf.binding.soap.SOAPMessage-information-organization-tp14398903p14413072.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: org.apache.cxf.binding.soap.SOAPMessage information organization

Posted by Daniel Kulp <dk...@apache.org>.
Davide,

It sounds like you missed the msg.getContent(...) call.

The content is different than the properties.   The properties are 
generally metainformation that is used to pass things along while 
processing the message.   The content is really the content that is 
being manipulated.

In your case, you probably want to do:

List lst = msg.getContent(List.class);
to return the list of objects.   The MessagePartInfo object that you DID 
find is useful here as it has a getIndex() call on it to tell you where 
in the above list the object corresponding to that call should be found.

Dan


On Tuesday 18 December 2007, Davide Gesino wrote:
> I have some problems with the logical organizations of data in the
> SOAPMessage class.
>
> I am trying to manage Message informations in the header: at this
> point I have problems figuring out how the header infos are organized
> in this class.
>
> Considering a message such as:
>
> # BEFORE SENDING
> in the PRE_PROTOCOL phase debugging I have found the infos with this
> (maybe unorthodox) code:
> ArrayList  obj = (ArrayList)message.get("client.holders");
> Holder<HeaderT> holder = (Holder<HeaderT>)obj.get(0);
> HeaderT represents my header bean.
>
> # AFTER RECEIVING
> I can't understand how the info is organized.
> in the POST_RECEIVE phase i do not get anything with the
> message.get("client.holders") method.
>
> using:
> MessageInfo fuffa =
> (MessageInfo)message.get("org.apache.cxf.service.model.MessageInfo");
> MessagePartInfo maybeHeader =
> (MessagePartInfo)fuffa.getMessagePart(new
> QName("tmf854.v1.ws","mtosiHeader"));
> maybeHeader.getTypeClass() returns the right class HeaderT, but I
> cannot find the HeaderT object inside the header.
>
> What is the rationale in the scheme? how are the Message and
> SOAPMessage classes organized and how the info is structired inside
> these classes? How can I add and new Headers or change existing
> headers?



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog