hi all,
The changes include:
Adding following methods to the following classes.
The following let the handler writer access the Header Block and traverse
through it to get the relavent info.
- SoapDeSerializer, IHandlerSoapDeSerializer : let the handler writer get
the HeaderBlock by providing the local name and namespace uri
- SoapHeader : let the handler writer get the HeaderBlock by providing the
local name and namespace uri
- IHeaderBlock:
BasicNode* getFirstChild()=0;
BasicNode* getLastChild() =0;
BasicNode* getChild(int iChildPosition) =0;
- HeaderBlock :
BasicNode* getFirstChild(),
BasicNode* getLastChild(),
BasicNode* getChild(int iChildPosition) // get the child by giving
the positon
getNoOfChildren() // get the no of available children
- BasicNode :
//The following let the handler writer traverse throuhg the children
int getNoOfChildren();
BasicNode* getFirstChild();
BasicNode* getLastChild();
BasicNode* getChild(int iChildPosition);
- ComplexElement:
int getNoOfChildren();
BasicNode* getChild(int iChildPosition);
BasicNode* getLastChild();
BasicNode* getFirstChild();
NODE_TYPE getNodeType();
- CharacterElement:
const AxisChar* getValue();
Also some of the following methods are to be used for various other
activities such as when creating header blocks by handlers and client apps.
- IHeaderBlock:
BasicNode* createChild(NODE_TYPE eNODE_TYPE, AxisChar
*pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri, AxisChar* pachValue);
BasicNode* createImmediateChild(NODE_TYPE eNODE_TYPE, AxisChar
*pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri, AxisChar* pachValue);
Attribute* createStdAttribute(HEADER_BLOCK_STD_ATTR_TYPE
eStdAttrType, SOAP_VERSION eSOAP_VERSION);
Attribute* createAttribute(const AxisChar* localname, const
AxisChar* prefix, const AxisChar* uri, const AxisChar* value);
Attribute* createAttribute(const AxisChar *localname, const
AxisChar *prefix, const AxisChar *value);
A eg code sample from a client who will add a soap header to the soap
reqest is as following.
.....
//-----------Adding SOAP Header-----------
IHeaderBlock* pIHeaderBlock =
m_pCall->createHeaderBlock("reservation", "m",
"http://travelcompany.example.org/reservation");
pIHeaderBlock->createStdAttribute(ROLE_NEXT, SOAP_VER_1_2);
pIHeaderBlock->createStdAttribute(MUST_UNDERSTAND_TRUE, SOAP_VER_1_2);
BasicNode* pBasicNode =
pIHeaderBlock->createImmediateChild(ELEMENT_NODE, "reference", "m", "", "");
BasicNode* pBasicNode2 =
pIHeaderBlock->createChild(CHARACTER_NODE, "", "", "",
"uuid:093a2da1-q345-739r-ba5d-pqff98fe8j7d");
pBasicNode->addChild(pBasicNode2);
BasicNode* pBasicNode3 =
pIHeaderBlock->createImmediateChild(ELEMENT_NODE, "dateAndTime", "m", "", "");
BasicNode* pBasicNode4 =
pIHeaderBlock->createChild(CHARACTER_NODE, "", "", "",
"2001-11-29T13:20:00.000-05:00");
pBasicNode3->addChild(pBasicNode4);
//-----------End of Adding SOAP Header-----------
.....
A eg code sample from a handler written to process a header is as following.
IHeaderBlock* pIHeaderBlock=
pIHandlerSoapDeSerializer->GetHeaderBlock("reservation",
"http://travelcompany.example.org/reservation");
if (pIHeaderBlock != NULL) {
BasicNode* pBasicNode= pIHeaderBlock->getFirstChild();
BasicNode* pBasicNode2= pBasicNode->getFirstChild();
const AxisChar* pachHeaderValue;
const AxisChar* pachHeaderValue2;
if((pBasicNode2->getNodeType()) == CHARACTER_NODE) {
pachHeaderValue= pBasicNode2->getValue();
}
BasicNode* pBasicNode3= pIHeaderBlock->getLastChild();
BasicNode* pBasicNode4 =pBasicNode3->getFirstChild();
if((pBasicNode4->getNodeType()) == CHARACTER_NODE) {
pachHeaderValue2= pBasicNode4->getValue();
}
.....
}
If you need any further clarification please come back.
rgds,
roshan
At 02:15 PM 2/24/2004 +0600, you wrote:
>hi Jean,
>
> >I think you are talking about processing messages "à la" JAX-RPC message
> handler ?
>This is baiscaly to support hanlder writers, to support processing soap
>headers.
>
> >I yes when the client side messaging handling is planned ?
>The client side handlers are also to be supported in the near future.
>
>rgds,
>roshan
>
>
>At 01:41 PM 2/23/2004 +0000, you wrote:
>>Hi Roshan,
>>
>>I think you are talking about processing messages "à la" JAX-RPC message
>>handler ?
>>
>>I yes when the client side messaging handling is planned ?
>>
>>After a quick look on the code it seem to be only for the server side by
>>now (server.wsdd).
>>
>>For the API looking at JAX-RPC seem to be a good starting point...
>>
>>Regards,
>>
>>Jean-Yves
>>
>>
>> >hi all,
>> >
>> >I have been working on improving the handler writing api,
>> since >currently it doesn't have much support on handler writing.
>> >I would like to get your comments if any in this regard.
>> >
>> >rgds,
>> >roshan
>
>
>
|