Skip to content

Commit

Permalink
Adding options to handle optional fields
Browse files Browse the repository at this point in the history
  • Loading branch information
kenrowland committed Jun 20, 2023
1 parent 8b8a996 commit 3e04a9a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions esp/bindings/http/platform/httpbinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1844,7 +1844,8 @@ int EspHttpBinding::onGetVersion(IEspContext &context, CHttpRequest* request, CH
}

void getServiceSchema(const char *serviceQName, const char *methodQName, double version, const char *nstr,
const StringBuffer &xmlFilename, Owned<IProperties> &params, EsdlXslTypeId EsdlXslType, StringBuffer &schema)
const StringBuffer &xmlFilename, Owned<IProperties> &params, EsdlXslTypeId EsdlXslType,
IProperties *opts, StringBuffer &schema)
{
Owned<IEsdlDefinition> esdlDef;
Owned<IEsdlDefinitionHelper> defHelper;
Expand All @@ -1856,13 +1857,13 @@ void getServiceSchema(const char *serviceQName, const char *methodQName, double
xmlFilePath.append("esdl_files").append(PATHSEPSTR).append(xmlFilename.str());
esdlDef->addDefinitionsFromFile(xmlFilePath.c_str());
unsigned optFlags{DEPFLAG_COLLAPSE|DEPFLAG_ARRAYOF};
Owned<IEsdlDefObjectIterator> structs = esdlDef->getDependencies(serviceQName, methodQName, ";", version, nullptr, optFlags );
Owned<IEsdlDefObjectIterator> structs = esdlDef->getDependencies(serviceQName, methodQName, ";", version, opts, optFlags );

StringBuffer xlstFile(getCFD());
xlstFile.append("xslt").append(PATHSEPSTR).append("esp_service_xml2xsd.xslt");

defHelper->loadTransform(xlstFile, params, EsdlXslType);
defHelper->toWSDL(*structs, schema, EsdlXslType, version, nullptr, nstr, optFlags);
defHelper->toWSDL(*structs, schema, EsdlXslType, version, opts, nstr, optFlags);
}


Expand Down Expand Up @@ -1913,7 +1914,7 @@ int EspHttpBinding::getServiceWsdlOrXsd(IEspContext &context, CHttpRequest* requ

StringBuffer schema;
getServiceSchema(serviceQName.str(), methodQName.str(), version, nstr.str(), xmlFilename,
params, isWsdl ? EsdlXslToWsdl : EsdlXslToXsd, schema);
params, isWsdl ? EsdlXslToWsdl : EsdlXslToXsd, context.queryRequestParameters(), schema);

response->setContent(schema.length(), schema.str());
response->setContentType(HTTP_TYPE_APPLICATION_XML_UTF8);
Expand Down

0 comments on commit 3e04a9a

Please sign in to comment.