54 schemaPath_(schemaPath),
55 soapVersion_(a_soapVersion)
63 if (a_soapVersion ==
SOAP12)
73 delete mySchemaParser;
74 if (mySchemaValidator)
75 delete mySchemaValidator;
87 string path=schemaPath_;
111 string path=schemaPath_;
112 path+=
"soap-encoding.xsd";
149 if (mySchemaParser == 0) {
150 error(
"Could not parse soap extensibility elements");
153 string elemName = xParser->
getName();
159 error(
"Unknown element");
170 error(spe.
description +
"Encountered error while validating {"+sNamespace +
"}:"+elemName);
172 if (elemName ==
"binding")
173 elemId = processBinding(t);
175 else if (elemName ==
"operation")
176 elemId = processOp(parent, t);
178 else if (elemName ==
"body")
179 elemId = processBody(parent, t);
181 else if (elemName ==
"header")
182 elemId = processHeader(parent, t);
184 else if (elemName ==
"fault")
185 elemId = processFault(parent, t);
187 else if (elemName ==
"address")
188 elemId = processAddress(parent, t);
208 string tp = *((
string *) (temp->
getValue()));
224 string style = *((
string *) (temp->
getValue()));
234 Qname binding(
"binding");
236 idi.typeId=(mySchemaParser->
getElement(binding))->getType();
238 idTable.push_back(idi);
240 return startId + idCounter - 1;
248 SoapOperationBinding sopb;
252 string * s = (
string *) (temp->
getValue());
254 sopb.soapAction = *s;
259 string style = *((
string *) (temp->
getValue()));
268 sopb.wsdlOpId = parent;
270 ops_.push_back(sopb);
272 Qname oprn(
"operation");
274 idi.typeId=(mySchemaParser->
getElement(oprn))->getType();
275 idi.index=ops_.size()-1;
276 idTable.push_back(idi);
278 return startId + idCounter - 1;
287 SoapMessageBinding smb;
291 use = *((
string *) (temp->
getValue()));
292 if (use ==
"literal")
302 string * s = (
string *) (temp->
getValue());
312 string * s = (
string *) (temp->
getValue());
313 smb.encodingStyle = *s;
317 smb.encodingStyle=
"";
320 body_.push_back(smb);
324 idi.typeId=(mySchemaParser->
getElement(body))->getType();
325 idi.index=body_.size()-1;
326 idTable.push_back(idi);
328 return startId + idCounter - 1;
336 return startId + idCounter - 1;
348 string * s = (
string *) (temp->
getValue());
350 location_.push_back(*s);
352 Qname address(
"address");
355 idi.typeId=(mySchemaParser->
getElement(address))->getType();
356 idi.index=location_.size()-1;
357 idTable.push_back(idi);
359 return startId + idCounter - 1;
368 std::string ns, part;
369 Qname header(
"header");
371 SoapHeaderBinding shb;
378 ns = *((
string *) (temp->
getValue()));
387 part = *((
string *) (temp->
getValue()));
392 part = *((
string *) (temp->
getValue()));
394 partType = m->getPartType(part);
397 error(
"Unkown part type :"+ part);
399 shb.partId_= m->getPartIndex(part);
402 header_.push_back(shb);
405 idi.typeId=(mySchemaParser->
getElement(header))->getType();
406 idi.index=header_.size()-1;
407 idTable.push_back(idi);
410 return startId + idCounter - 1;
417 if (elemId - startId >= idCounter ||
420 int opId = idTable[elemId - startId].index;
421 action = ops_[opId].soapAction;
422 style = ops_[opId].style;
428 if (elemId - startId >= idCounter ||
431 int bodyId = idTable[elemId - startId].index;
432 ns = body_[bodyId].urn;
433 use = body_[bodyId].use;
434 encodingStyle = body_[bodyId].encodingStyle;
440 if (elemId - startId >= idCounter ||
443 int headerId = idTable[elemId - startId].index;
444 ns = header_[headerId].urn;
445 partId = header_[headerId].partId_;
446 m = header_[headerId].message_;
452 if (elemId - startId >= idCounter ||
455 int locId = idTable[elemId - startId].index;
456 location = location_[locId];
457 if(!location.empty())
467 if (elemId - startId >= idCounter||
472 if (idTable[elemId - startId].typeId ==
473 (mySchemaParser->
getElement(body))->getType())
483 Qname header(
"header");
484 if (elemId - startId >= idCounter||
487 if (idTable[elemId - startId].typeId ==
488 (mySchemaParser->
getElement(header))->getType())
497Soap::error(std::string s)
505 schemaPath_ = schemaPath;
std::string getLocalName(void) const
const Element * getElement(const Qname &element, bool checkImports=true) const
TypeContainer * validate(XmlPullParser *xpp, int typeId, TypeContainer *ipTc=0)
TypeContainer * getAttributeContainer(std::string attName, bool create=false)
bool getServiceLocation(int elemId, std::string &location)
void getSoapOperationInfo(int elemId, std::string &soapAction, Soap::Style &style)
std::string getEncodingUri(void) const
void getSoapBodyInfo(int elemId, std::string &ns, Soap::Encoding &use, std::string &encodingStyle)
void getSoapHeaderInfo(int elemId, std::string &ns, int &partId, const Message *&m)
bool isSoapHeader(int id)
static const std::string soapEncUri12
static const std::string soapBindingUri11
static const std::string soapEncUri11
int handleElement(int parent, XmlPullParser *)
std::string getEnvelopeUri(void) const
std::string getEncodingSchema(void) const
Soap(const std::string &schemaPath="", SoapVersion a_soapVersion=SOAP11)
int handleAttribute(int parent, std::string attName, XmlPullParser *)
void setSchemaPath(const std::string &schemaPath)
static const std::string httpTransport
std::string getExtensibilitySchema(void) const
static const std::string soapBindingUri12
static const std::string httpBinding
SoapVersion getSoapVersion() const
static const std::string soapEnvUri12
static const std::string soapEnvUri11
static bool useLocalSchema_
const Message * getMessage()
std::ostream & dbsp(std::ostream &str)