Return-Path: Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 78876 invoked by uid 500); 2 Jul 2003 05:09:31 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 78864 invoked by uid 500); 2 Jul 2003 05:09:31 -0000 Delivered-To: apmail-xml-axis-cvs@apache.org Date: 2 Jul 2003 05:09:29 -0000 Message-ID: <20030702050929.95651.qmail@icarus.apache.org> From: damitha@apache.org To: xml-axis-cvs@apache.org Subject: cvs commit: xml-axis/c/src/wsdd WSDDHandler.cpp WSDDHandler.h WSDDDocument.cpp X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N damitha 2003/07/01 22:09:29 Modified: c/src/wsdd WSDDHandler.cpp WSDDHandler.h WSDDDocument.cpp Log: in WSDDDocument.cpp added DEBUG1("After tempHandler->SetOption"); in WSDDHandler.h and WSDDHandler.cpp changed map m_Option; to map* m_Option; and other changes accordingly Revision Changes Path 1.2 +8 -6 xml-axis/c/src/wsdd/WSDDHandler.cpp Index: WSDDHandler.cpp =================================================================== RCS file: /home/cvs/xml-axis/c/src/wsdd/WSDDHandler.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- WSDDHandler.cpp 25 Jun 2003 05:55:48 -0000 1.1 +++ WSDDHandler.cpp 2 Jul 2003 05:09:29 -0000 1.2 @@ -73,12 +73,12 @@ WSDDHandler::WSDDHandler() { - + m_Option = new map; } WSDDHandler::~WSDDHandler() { - + delete(m_Option); } void WSDDHandler::SetLibName(string& sLibName) @@ -94,14 +94,16 @@ string WSDDHandler::GetOption(string sArg) { - return m_Option[sArg]; + return (*m_Option)[sArg]; } void WSDDHandler::SetOption(string sOption, string sValue) { - //m_Option[m_sOption.c_str]=m_Value; - m_Option[sOption] = sValue; + (*m_Option)[sOption] = sValue; } - +map* WSDDHandler::GetOptionList() +{ + return m_Option; +} 1.2 +2 -1 xml-axis/c/src/wsdd/WSDDHandler.h Index: WSDDHandler.h =================================================================== RCS file: /home/cvs/xml-axis/c/src/wsdd/WSDDHandler.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- WSDDHandler.h 25 Jun 2003 05:55:48 -0000 1.1 +++ WSDDHandler.h 2 Jul 2003 05:09:29 -0000 1.2 @@ -89,11 +89,12 @@ virtual ~WSDDHandler(); string GetOption(string sArg); void SetOption(string sOption, string Value); + virtual map* GetOptionList(); protected: string m_sName; string m_sLibName; - map m_Option; + map* m_Option; }; typedef list WSDDHandlerList; 1.3 +80 -49 xml-axis/c/src/wsdd/WSDDDocument.cpp Index: WSDDDocument.cpp =================================================================== RCS file: /home/cvs/xml-axis/c/src/wsdd/WSDDDocument.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- WSDDDocument.cpp 30 Jun 2003 14:07:25 -0000 1.2 +++ WSDDDocument.cpp 2 Jul 2003 05:09:29 -0000 1.3 @@ -64,6 +64,7 @@ #include "WSDDDocument.h" #include #include +#include "../common/Debug.h" #define toString(X) XMLString::transcode(X) #define toXMLCh(X) XMLString::transcode(X) @@ -82,7 +83,11 @@ tempTr = new WSDDTransport(); protocol = APTOTHER; ch = NULL; - xch = NULL; + //xch = NULL; + xchName = NULL; + xchValue = NULL; + xchType = NULL; + svsch = NULL; } WSDDDocument::~WSDDDocument() @@ -92,7 +97,8 @@ int WSDDDocument::GetDeployment(string& sWSDD, WSDDDeployment * dep) { - if (SUCCESS != ParseDocument(sWSDD)) return FAIL; + if (SUCCESS != ParseDocument(sWSDD)) return FAIL; + dep->SetGlobalRequestFlowHandlers(globReqFlowHanList); dep->SetGlobalResponseFlowHandlers(globResFlowHanList); dep->SetServices(svsMap); @@ -103,12 +109,14 @@ int WSDDDocument::ParseDocument(string& sWSDD) { - try + try { SAX2XMLReader * parser = XMLReaderFactory::createXMLReader(); parser->setContentHandler(this); - parser->setErrorHandler(this); - parser->parse(sWSDD.c_str()); + parser->setErrorHandler(this); + DEBUG1("BEFORE parser->parse(sWSDD.c_str());"); + parser->parse(sWSDD.c_str()); + } catch (...) { @@ -118,11 +126,12 @@ } -void WSDDDocument::startElement(const XMLCh *const uri, - const XMLCh *const localname, - const XMLCh *const qname, +void WSDDDocument::startElement(const XMLCh *const uri, + const XMLCh *const localname, + const XMLCh *const qname, const Attributes &attrs) { + ch = XMLString::transcode(localname); xchName = toXMLCh("name"); xchValue = toXMLCh("value"); @@ -134,15 +143,18 @@ case WSDD_UNKNOWN: if(strcmp(ch, "globalConfiguration")==0) - { + { + lev0=WSDD_GLOBCONF; } if(strcmp(ch, "service")==0) - { + { + lev0=WSDD_SERVICE; } if(strcmp(ch, "transport")==0) - { + { + lev0=WSDD_TRANSPORT; } if(lev0==WSDD_UNKNOWN) @@ -152,83 +164,97 @@ break; } - + switch(lev0) - { + { + case WSDD_GLOBCONF: - //cout<<"we are in glob conf"<requestflow"<requestflow"<SetLibName(sLibName); globReqFlowHanList->push_back(tempHandler); tempHandler = NULL; - } + } + break; case WSDD_RESFLOW: if(strcmp(ch, "handler")==0) { tempHandler = new WSDDHandler(); - string sLibName = toString(attrs.getValue(xch)); + string sLibName = toString(attrs.getValue(xchType)); tempHandler->SetLibName(sLibName); globResFlowHanList->push_back(tempHandler); tempHandler = NULL; - } + } break; } - REL(&xch); + + //REL(&xch); break; - case WSDD_SERVICE: + case WSDD_SERVICE: if(strcmp(ch, "service")==0) { + tempService = new WSDDService(); string sSrvName = toString(attrs.getValue(xchName)); tempService->SetServiceName(sSrvName); (*svsMap)[toString(attrs.getValue(xchName))]=tempService; cout<SetLibName(sLibName); //cout<SetAllowedMethod(sY); y=strtok(NULL," "); - } + } } REL(&x); delete y; - + x=NULL; y=NULL; } @@ -274,6 +300,9 @@ { tempHandler->SetOption(toString(attrs.getValue(xchName)), toString(attrs.getValue(xchValue))); + + DEBUG1("After tempHandler->SetOption"); + } break; } @@ -287,7 +316,7 @@ string sLibName = toString(attrs.getValue(xchType)); tempHandler->SetLibName(sLibName); tempHandlerList->push_back(tempHandler); - //tempHandler = NULL; + //tempHandler = NULL; } switch(lev2) { @@ -302,7 +331,7 @@ break; } - break; + break; case WSDD_TRANSPORT: if(strcmp(ch, "transport")==0) @@ -356,7 +385,7 @@ tempHandlerList->push_back(tempHandler); tempHandler = NULL; } - break; + break; } @@ -368,15 +397,16 @@ REL(&xchType); REL(&svsch); -} +} -void WSDDDocument::endElement (const XMLCh *const uri, - const XMLCh *const localname, +void WSDDDocument::endElement (const XMLCh *const uri, + const XMLCh *const localname, const XMLCh *const qname) { ch = XMLString::transcode(localname); switch (lev0) - { + { + case WSDD_GLOBCONF: if(strcmp(ch, "globalConfiguration")==0) { @@ -398,7 +428,7 @@ } break; } - + break; case WSDD_RESFLOW: if(strcmp(ch, "responseFlow")==0) @@ -423,7 +453,7 @@ { lev0=WSDD_UNKNOWN; } - break; + break; case WSDD_SERVICE: if(strcmp(ch, "service")==0) @@ -462,7 +492,7 @@ lev2=WSDD_UNKNOWN; tempHandler = NULL; } - + break; } break; @@ -489,12 +519,12 @@ lev2=WSDD_UNKNOWN; tempHandler = NULL; } - + break; } break; } - break; + break; case WSDD_TRANSPORT: if(strcmp(ch, "transport")==0) @@ -515,22 +545,23 @@ break; case WSDD_RESFLOW: - + if(strcmp(ch, "responseFlow")==0) { tempTr->SetResponseFlowHandlers(protocol, tempHandlerList); tempHandlerList = NULL; lev1=WSDD_UNKNOWN; } - + break; } break; } REL(&ch); + } -void WSDDDocument::characters (const XMLCh *const chars, +void WSDDDocument::characters (const XMLCh *const chars, const unsigned int length) { //cout<<"==="<