Bob320 Posted September 1, 2016 Share Posted September 1, 2016 I thought I'd spend some time tidying up my PHP implementation of Invoke() as I was using little in the way of error checking and was pretty much dumping the response back to the calling functions. It works, but it's not as I'd like. So I started adding in some error checking on the responses and found that I'm at a loss as to what Invoke() is actually returning. My initial understanding was that by submitting the headers and xml parameters I'd be getting back json as requested in the header. 'Accept' => 'Application/json', But it looks like this isn't necessarily the case. If an error is returned then the response looks like xml. So then I thought I'd best check the response header for the type returned and use that to determine what I got back. So I didn't try parsing xml as json. Seemed straight forward, but then I ran into apps/com.hornbill.servicemanager/Requests::smGetRequests() and apps/com.hornbill.core::getCoWorkersList() and that plan went out of the window. It seems these return xml with json embedded in it as params. So the data returned, even though I ask for json, could be json, could be xml or could be xml with json in. That doesn't seem too smart. Is this really how it works or am I doing something wrong? Link to comment Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now