You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by Jean-Yves Baudy <jy...@free.fr> on 2004/02/23 14:41:42 UTC

RE : Improving Hanlder writing api

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

RE : Improving Hanlder writing api

Posted by Roshan Weerasuriya <ro...@opensource.lk>.
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
>
>
>




RE: RE : Improving Hanlder writing api

Posted by Roshan Weerasuriya <ro...@opensource.lk>.
hi,

 >So I suggest making the first set of functions return const pointers.

Made the changes and committed the code.

 >Can we differ Handler writing API for C for some time ?. I mean a handler 
can now be written only in C++.

Yes this need to be done.

rgds,
Roshan


At 11:24 AM 2/27/2004 +0600, you wrote:
>Hi Roshan,
>
>Its a good design. I see that there are basically 2 sets of API functions.
>
>1. To get a header block from deserializer and traverse it for reading
>2. To create and add header blocks to the serializer/deserializer.
>
>So I suggest making the first set of functions return const pointers. Also
>that
>would need to make these functions const. Making them const restricts the
>handler
>writer from deleting the header's nodes.
>Ex:
>           const BasicNode* getFirstChild()const =0;
>           const BasicNode* getLastChild() const =0;
>
>Can we differ Handler writing API for C for some time ?. I mean a handler
>can now
>be written only in C++.
>
>Thanks,
>
>Susantha.
>
> > -----Original Message-----
> > From: Roshan Weerasuriya [mailto:roshan@opensource.lk]
> > Sent: Wednesday, February 25, 2004 9:10 AM
> > To: Apache AXIS C Developers List
> > Subject: RE : Improving Hanlder writing api
> >
> >
> > 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();
> >          }
> >
> >          .....
> > }




RE: RE : Improving Hanlder writing api

Posted by Susantha Kumara <su...@opensource.lk>.
Hi Roshan,

Its a good design. I see that there are basically 2 sets of API functions.

1. To get a header block from deserializer and traverse it for reading
2. To create and add header blocks to the serializer/deserializer.

So I suggest making the first set of functions return const pointers. Also
that
would need to make these functions const. Making them const restricts the
handler
writer from deleting the header's nodes.
Ex:
          const BasicNode* getFirstChild()const =0;
          const BasicNode* getLastChild() const =0;

Can we differ Handler writing API for C for some time ?. I mean a handler
can now
be written only in C++.

Thanks,

Susantha.

> -----Original Message-----
> From: Roshan Weerasuriya [mailto:roshan@opensource.lk]
> Sent: Wednesday, February 25, 2004 9:10 AM
> To: Apache AXIS C Developers List
> Subject: RE : Improving Hanlder writing api
>
>
> 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();
>          }
>
>          .....
> }


RE : Improving Hanlder writing api

Posted by Roshan Weerasuriya <ro...@opensource.lk>.
hi all,

The code is commited to the CVS. (Actualy I am sorry fot the late notice, 
the code was commited on last saturday) You could find these files at,
1. CVSHome/ws-axis/c/include/axis/common
2. CVSHome/ws-axis/c/include/axis/soap
3. CVSHome/ws-axis/c/src/common
4. CVSHome/ws-axis/c/src/soap

rgds,
roshan


At 09:09 AM 2/25/2004 +0600, you wrote:
>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
>>
>
>




RE : Improving Hanlder writing api

Posted by Roshan Weerasuriya <ro...@opensource.lk>.
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
>
>
>




RE : Improving Hanlder writing api

Posted by Roshan Weerasuriya <ro...@opensource.lk>.
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