wsdlpull  1.23
WsdlDebug.cpp
Go to the documentation of this file.
1 /*
2  * wsdlpull - A C++ parser for Wsdl (Web services description language)
3  * Copyright (C) 2005-2007 Vivek Krishna
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the Free
17  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  *
19  *
20  */
21 
22 #include "wsdlparser/WsdlParser.h"
23 
24 #ifdef LOGGING
25 
26 using namespace std;
27 
28 namespace WsdlPull {
29 // just print all the stuff,for debugging
30 void WsdlParser::print(std::ostream & out)
31 {
32  Binding *bn = bindings_.front();
33  int i = 0, soapBindingId, inId, outId, faultId;
34  int numOps = bn->numOps();
35 
36  /*
37  Print all the operations and messages and then the types of
38  the Schema Parser
39  */
40  for (i = 0; i < getNumSchemas(); i++)
41  schemaParser_[i]->print(out);
42  i = 0;
43  while (i < numOps)
44  {
45  const int *bindings = 0;
46  int n = 0;
47  n = bn->getOpBinding(i, bindings);
48  soapBindingId = bindings[0];
49  n = bn->getInputBinding(i, bindings);
50  inId = bindings[0];
51  n = bn->getOutputBinding(i, bindings);
52  outId = bindings[0];
53  n = bn->getFaultBinding(i, bindings);
54  faultId = bindings[0];
55  const Operation *op = bn->getOperation(i);
56  out << op->getName() << endl;
57  const Message *inMessage = op->getMessage(Input);
58  const Message *outMessage = op->getMessage(Output);
59  int nParams = 0, j = 0;
60  int typeId = 0,schemaId;
61  const XSDType *pType = 0;
62  nParams = inMessage->getNumParts();
63  for (j = 0; j < nParams; j++)
64  {
65  if (inMessage->getPartRefType(j) == Part::Elem)
66  {
67 
68  typeId = inMessage->getPartType(j);
69  pType = schemaParser_[schemaId]->getType(typeId);
70 
71  if (!pType->isSimple())
72  {
73  ComplexType * cType = (ComplexType *) pType;
74 
78 
79  for (ci=cit_b;ci!=cit_e;ci++){
80  if(ci->second==ContentModel::Particle){
81  out<<ci->first.e->getName()<< ":" <<
82  ci->first.e->getType();
83  }
84  }
85 
86  }
87  }
88 
89  else
90  out << inMessage->getPartName(j) << ":" << inMessage->
91  getPartType(j) << XmlUtils::dbsp;
92  }
93  out << endl;
94  nParams = outMessage->getNumParts();
95  for (j = 0; j < nParams; j++)
96  {
97  if (outMessage->getPartRefType(j) == Part::Elem)
98  {
99 
100  const Element * e =outMessage->getPartElement(j);
101  out << e->getName() << ":" << e->getType() << XmlUtils::dbsp;
102  }
103 
104  else
105  out << outMessage->getPartName(j) << ":" << outMessage->
106  getPartType(j) << XmlUtils::dbsp;
107  }
108  out << XmlUtils::blk;
109  i++;
110  }
111 }
112 }
113 #endif
WsdlParser.h
WsdlPull
Definition: Binding.h:27
Schema::ContentModel::ContentsIterator
std::list< ContentHolder >::iterator ContentsIterator
Definition: ContentModel.h:55
WsdlPull::Output
@ Output
Definition: Operation.h:45
Schema::ComplexType::getContents
ContentModel * getContents() const
Definition: ComplexType.h:155
Schema::XSDType
Definition: XSDType.h:38
Schema::Element::getName
std::string getName() const
Definition: Element.h:125
Schema::ComplexType
Definition: ComplexType.h:35
XmlUtils::blk
std::ostream & blk(std::ostream &str)
Definition: XmlUtils.cpp:97
XmlUtils::dbsp
std::ostream & dbsp(std::ostream &str)
Definition: XmlUtils.cpp:90
WsdlPull::Input
@ Input
Definition: Operation.h:44
Schema::ContentModel::begin
ContentsIterator begin()
Definition: ContentModel.h:91
Schema::Element::getType
int getType() const
Definition: Element.h:147
Schema::Element
Definition: Element.h:31
Schema::ContentModel::end
ContentsIterator end()
Definition: ContentModel.h:98
Schema::XSDType::isSimple
virtual bool isSimple() const =0