diff --git a/esp/bindings/http/platform/httpbinding.cpp b/esp/bindings/http/platform/httpbinding.cpp index 7c37c2e6515..bb79835fa1a 100644 --- a/esp/bindings/http/platform/httpbinding.cpp +++ b/esp/bindings/http/platform/httpbinding.cpp @@ -1429,7 +1429,7 @@ void EspHttpBinding::getSoapMessage(StringBuffer& soapmsg, IEspContext& ctx, CHt StringBuffer req, tag, schema, filtered; msg->marshall(req, NULL); - getServiceSchema(ctx, request, serviceQName, methodQName, SCHEMA_SOAP, getVersion(ctx), schema); + getServiceSchema(ctx, request, serviceQName, methodQName, getVersion(ctx), false, false, schema); getXMLMessageTag(ctx, true, methodQName, tag); filterXmlBySchema(req,schema,tag.str(),filtered); @@ -1729,7 +1729,7 @@ bool EspHttpBinding::getSchema(StringBuffer& schema, IEspContext &ctx, CHttpRequ } void EspHttpBinding::getServiceSchema(IEspContext& context, CHttpRequest* request, const char *serviceQName, const char *methodQName, - SchemaType schemaType, double version, StringBuffer &schema) + double version, bool isWsdl, bool addAnnotations, StringBuffer &schema) { IProperties *opts = context.queryRequestParameters(); EsdlXslTypeId esdlXslType = EsdlXslToXsd; @@ -1752,7 +1752,7 @@ void EspHttpBinding::getServiceSchema(IEspContext& context, CHttpRequest* reque // // Selectively add parameters based on the type of schema requested - if (schemaType == SCHEMA_WSDL) + if (isWsdl) { params->setProp( "create_wsdl", "true()" ); StringBuffer location(m_wsdlAddress.str()); @@ -1763,7 +1763,8 @@ void EspHttpBinding::getServiceSchema(IEspContext& context, CHttpRequest* reque params->setProp("location", StringBuffer("'").append(location).append("'").str()); esdlXslType = EsdlXslToWsdl; } - else if (schemaType == SCHEMA_XFORM) + + if (addAnnotations) { params->setProp( "all_annot_Param", "true()" ); } @@ -1817,7 +1818,7 @@ int EspHttpBinding::getServiceWsdlOrXsd(IEspContext &context, CHttpRequest* requ StringBuffer schema; getServiceSchema(context, request, serviceQName, methodQName, - isWsdl ? SCHEMA_WSDL : SCHEMA_XSD, version, schema); + version, isWsdl, false, schema); response->setContent(schema.length(), schema.str()); response->setContentType(HTTP_TYPE_APPLICATION_XML_UTF8); @@ -1913,7 +1914,7 @@ void EspHttpBinding::generateSampleXml(bool isRequest, IEspContext &context, CHt return; } - getServiceSchema(context, request, serviceQName, methodQName, SCHEMA_XML, getVersion(context), schemaXml); + getServiceSchema(context, request, serviceQName, methodQName, getVersion(context), false, false, schemaXml); Owned schema; IXmlType* type = nullptr; @@ -1989,7 +1990,7 @@ void EspHttpBinding::generateSampleJson(bool isRequest, IEspContext &context, CH return; } - getServiceSchema(context, request, serviceQName, methodQName, SCHEMA_JSON, getVersion(context), schemaXml); + getServiceSchema(context, request, serviceQName, methodQName, getVersion(context), false, false, schemaXml); Owned schema; IXmlType* type = nullptr; @@ -2464,7 +2465,7 @@ int EspHttpBinding::onGetXForm(IEspContext &context, CHttpRequest* request, CHtt double ver = getVersion(context); StringBuffer schema; - getServiceSchema(context, request, serviceQName, methodQName, SCHEMA_XFORM, ver, schema); + getServiceSchema(context, request, serviceQName, methodQName, ver, false, true, schema); StringBuffer page; IXslProcessor* xslp = getXmlLibXslProcessor(); @@ -2768,7 +2769,7 @@ void EspHttpBinding::validateResponse(IEspContext& context, CHttpRequest* reques } // schema - getServiceSchema(context, request, serviceQName, methodQName, SCHEMA_VALIDATION, getVersion(context), xsd); + getServiceSchema(context, request, serviceQName, methodQName, getVersion(context), false, false, xsd); // validation if (getEspLogLevel()>LogMax) diff --git a/esp/bindings/http/platform/httpbinding.hpp b/esp/bindings/http/platform/httpbinding.hpp index de0a4307d40..08824771570 100644 --- a/esp/bindings/http/platform/httpbinding.hpp +++ b/esp/bindings/http/platform/httpbinding.hpp @@ -462,17 +462,8 @@ class esp_http_decl EspHttpBinding : void sortResponse(IEspContext& context, CHttpRequest* request,MemoryBuffer& contentconst, const char *serviceName, const char* methodName); - enum SchemaType { - SCHEMA_WSDL, - SCHEMA_XSD, - SCHEMA_JSON, - SCHEMA_XML, - SCHEMA_SOAP, - SCHEMA_XFORM, - SCHEMA_VALIDATION - }; void getServiceSchema(IEspContext& context, CHttpRequest* request, const char *serviceQName, const char *methodQName, - SchemaType schemaType, double version, StringBuffer &schema); + double version, bool isWsdl, bool addAnnotations, StringBuffer &schema); }; inline bool isEclIdeRequest(CHttpRequest *request)