Web Service LOCATION configuration

50 views
Skip to first unread message

Rodrigo Werneck

unread,
Jan 16, 2019, 7:10:09 PM1/16/19
to IRIS, Caché, Ensemble
How one can have the LOCATION parameter of web service server classes (%SOAP.WebService) defined somewhere outside the class code so as not to have problems when deploying changes come from development/test systems where the LOCATION is typically different than the prod´?

pavlov...@alanov.ru

unread,
Jan 17, 2019, 9:55:44 PM1/17/19
to IRIS, Caché, Ensemble
You can Set ..Location property in %OnNew() method. 

четверг, 17 января 2019 г., 7:10:09 UTC+7 пользователь Rodrigo Werneck написал:

Raw Conscience

unread,
Jan 18, 2019, 4:15:01 AM1/18/19
to intersystems...@googlegroups.com
It only works for clients, doesn't It? Or It does not work in the case of WSDL response, am I wrong? I,ve been recently inspecting the method which generates It, in %XML.Implementation class and It only looks to the class parameter LOCATION. Also it seems that no object is instatiated for WSDL request If any in the case of server classes when responding to real requests. Wrong again?

--
--
IRIS, Caché, Ensemble
---
You received this message because you are subscribed to the Google Groups "IRIS, Caché, Ensemble" group.
To unsubscribe from this group and stop receiving emails from it, send an email to intersystems-publi...@googlegroups.com.
To post to this group, send email to intersystems...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

pavlov...@alanov.ru

unread,
Jan 18, 2019, 10:13:05 PM1/18/19
to IRIS, Caché, Ensemble
Oh, I've misread you question.

Afaik, to get a WSDL by ?WSDL=1 URL from Caché web-service you already need to know the URL of service. Basically, a client needs to know there the service is to ask for it's WSDL, if you don't supply it some other way.
Then a client can send a web-service request to any URL, it does not matter what location is in in WSDL xml.

The service itself only works (natively) on /csp/csp-applicaton-name/classname.csl URL. To change it's "location", I mean, the URL on which the web-service is accessible, you need to setup rewrite or proxy rules in your production web-server which should be nginx or apache or some other external application.

But - you can change the parameter value on compile time by writing in class, if you want to.

Parameter LOCATION;

ClassMethod Location() As %Status [ CodeMode = generator ]
{
Set o=##class(%Dictionary.ParameterDefinition).%OpenId(%class_"||LOCATION")
Set o.Default="test"
Quit o.%Save()
}

пятница, 18 января 2019 г., 16:15:01 UTC+7 пользователь Rodrigo Werneck написал:
It only works for clients, doesn't It? Or It does not work in the case of WSDL response, am I wrong? I,ve been recently inspecting the method which generates It, in %XML.Implementation class and It only looks to the class parameter LOCATION. Also it seems that no object is instatiated for WSDL request If any in the case of server classes when responding to real requests. Wrong again?

Em sex, 18 de jan de 2019 00:55, <pavlov...@alanov.ru escreveu:
You can Set ..Location property in %OnNew() method. 

четверг, 17 января 2019 г., 7:10:09 UTC+7 пользователь Rodrigo Werneck написал:
How one can have the LOCATION parameter of web service server classes (%SOAP.WebService) defined somewhere outside the class code so as not to have problems when deploying changes come from development/test systems where the LOCATION is typically different than the prod´?

--
--
IRIS, Caché, Ensemble
---
You received this message because you are subscribed to the Google Groups "IRIS, Caché, Ensemble" group.
To unsubscribe from this group and stop receiving emails from it, send an email to intersystems-public-cache+unsub...@googlegroups.com.

Rodrigo Werneck

unread,
Jan 24, 2019, 7:55:38 AM1/24/19
to IRIS, Caché, Ensemble
The case is that some clients (like PHP SoapClient on WSDL mode) do read the WSDL and parse it, including the Location information and use it dynamically at every operation/method invocation and that the accessible/external address is diferent than the default automatically formed by Caché and, finally, that it is different on each system (test, QA, live).
So it´s highly desirable that the LOCATION were kept in configuration files (or tables), separated from the class code itself.
But how?

Rodrigo Werneck

unread,
Jan 24, 2019, 8:10:06 AM1/24/19
to IRIS, Caché, Ensemble
Oops, I just now tested and understood your suggestion.
It solves the problem.

Thank you
Reply all
Reply to author
Forward
0 new messages