cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Appbroker GetResolvedRequestVariables API API

Hello 

We tried to use GetResolvedRequestVariables API, but it seems it is throwing out an error message, any thoughts what might be causing it? 

thanks 

SL

(1) Solution

These are SOAP APIs that only return XML.  You won't be able to get a JSON response from these.  If you need a JSON response, you would need to write your own web service that calls this SOAP API and then converts the XML to a JSON response.  If you are calling this from PowerShell, it's actually pretty easy to call this SOAP endpoint and then convert the XML response to JSON.  There are numerous examples on the internet showing how to convert XML to JSON in PowerShell.

Anything expressed here is my own view and not necessarily that of my employer, Flexera. If my reply answers a question you have raised, please click "ACCEPT AS SOLUTION".

View solution in original post

(8) Replies
CharlesW
By Level 12 Flexeran
Level 12 Flexeran

I can't say as I've ever seen an exception when invoking this API.  Does this happen for all request ID's? You will likely see an exception written out to website.log when the error occurs. Can you please let me know what that exception is? Also, can you invoke the GetResolvedRequestVariables API by going directly to the integraion.asmx page, by hitting the following URL in a browser on the App Broker server: http://localhost/esd/ws/integration.asmx?

Thanks for your reply, yes, invoke the GetResolvedRequestVariables API by going directly to the integraion.asmx page, hitting the url working perfectly, but postman does not work. I went to the  website.log, and here is the error i am getting 

 

Unhandled Exception https://*/esd/ws/integration.asmx/GetResolvedRequestVariables Only Web services with a [ScriptService] attribute on the class definition can be called from script. at System.Web.Script.Services.WebServiceData..ctor(Type type, Boolean pageMethods)
at System.Web.Script.Services.WebServiceData.GetWebServiceData(HttpContext context, String virtualPath, Boolean failIfNoData, Boolean pageMethods, Boolean inlineScript)
at System.Web.Script.Services.RestHandler.CreateHandler(HttpContext context)
at System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)
at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

 

I assume the asterisk in your error message was just you replacing the server name for confidentiality reasons?  I just tried this against my test server with no issue.  In my case, I used Postman to issue a GET request to https://servername/esd/ws/integration.asmx/GetResolvedRequestVariables?requestID=3022 with NTLM authentication.  This gave me an HTTP 200 OK response and the expected XML response body.

Anything expressed here is my own view and not necessarily that of my employer, Flexera. If my reply answers a question you have raised, please click "ACCEPT AS SOLUTION".

Unhandled Exception https://*/esd/esd/ws/integration.asmx/GetResolvedRequestVariables?requestID=44 The file '/esd/esd/ws/integration.asmx' does not exist. at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath)
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate)
at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath)
at System.Web.UI.WebServiceParser.GetCompiledType(String inputFile, HttpContext context)
at System.Web.Services.Protocols.WebServiceHandlerFactory.GetCompiledType(String url, HttpContext context)
at System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath)
at System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)

With this error, there are too many "/esd" in your URL, i.e. /esd/esd/ws/integration.asmx

That isn't the case with the other error you posted, so we'll have to look into that a bit more.

Anything expressed here is my own view and not necessarily that of my employer, Flexera. If my reply answers a question you have raised, please click "ACCEPT AS SOLUTION".

Thanks, I tried with request make sure no duplicate esd, and this time the same error show up, any other log files may have more details? 

thanks, 

Feng

 

Unhandled Exception https://*/esd/ws/integration.asmx/GetResolvedRequestVariables?requestID=44 Only Web services with a [ScriptService] attribute on the class definition can be called from script. at System.Web.Script.Services.WebServiceData..ctor(Type type, Boolean pageMethods)
at System.Web.Script.Services.WebServiceData.GetWebServiceData(HttpContext context, String virtualPath, Boolean failIfNoData, Boolean pageMethods, Boolean inlineScript)
at System.Web.Script.Services.RestHandler.CreateHandler(HttpContext context)
at System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)
at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

 

Thanks everyone's help with this, the reason why is we are getting xml as a return, but we actually need json, so we have json in the header, that's causing the issue. We are just wondering 

what is the exact syntax if we need to make a request to have a return as json? as right now we are only getting xml from this request
 

These are SOAP APIs that only return XML.  You won't be able to get a JSON response from these.  If you need a JSON response, you would need to write your own web service that calls this SOAP API and then converts the XML to a JSON response.  If you are calling this from PowerShell, it's actually pretty easy to call this SOAP endpoint and then convert the XML response to JSON.  There are numerous examples on the internet showing how to convert XML to JSON in PowerShell.

Anything expressed here is my own view and not necessarily that of my employer, Flexera. If my reply answers a question you have raised, please click "ACCEPT AS SOLUTION".