How to recycle ColdFusion web services after modifying underlying web service signature - web-services

ColdFusion seems to cache its initial request to a web service. When modifying the web service's signature (e.g, adding a parameter to the web service method) it seems that ColdFusion has no idea how to call that web service until the "ColdFusion 2016 Application Server" Windows service is restarted. This complicates development as it affects all ColdFusion websites during that restart period effectively clearing all sessions.
The context of the execution of these web services are through the CreateObject method.
Application.MyWebServiceVariable = CreateObject("webservice", "PATH");
In the past other have mentioned using the refreshwsdl argument, as such.
oWsdlArgs = structNew();
oWsdlArgs.refreshwsdl="yes";
Application.MyWebServiceVariable = CreateObject("webservice", "PATH", oWsdlArgs );
Unfortunately this does not resolve the underlying issue where the actual Windows service must be restarted in order for ColdFusion to refresh its internal cache of that web service method signature.
I can also confirm that simply restarting the ColdFusion application using ApplicationStop() does not work.
Is there a way to recycle this internal cache of the web service signature so that developers don't need to restart the Windows service?
Additional Notes
Apparent in ColdFusion 9 to ColdFusion 2016
Web services are SOAP-based hosted on IIS
Web services' logic are within a DLL

If you are calling these webservices using createObject and/or cfinvoke, then as you have seen, CF caches the definitions. The easiest way I have found to refresh these definitions without a CF service restart is if you have access to the Coldfusion Administrator.
CF Admin -> Data & Services -> Web Services
Under there you should see an entry for each wsdl that CF has cached, with a button to use to force it to update.

Related

ColdFusion CFDump Web service

I'm in the process of migrating our web applications from a Cold Fusion 9 server to a Cold Fusion 2016 server and one of the web service calls that works perfectly in CF9 is now raising the following error in CF2016.
Web service operation InsertBank with parameters
{2,JOHNSON,BRIAN,450,450100530,21/02/2017,C,11212,006,128661543321,A,en}
cannot be found.
I'm calling the method directly through CFScript (I've already defined the web service using createObject(), and assigned it to an application variable for easy use)
result = Application.AdminWS.InsertBank(Trim(Application.ApplicationId),Trim(uname),Trim(Session.Employee.Client.xmlText),Trim(Session.Employee.Certificate.xmlText),Trim(DateFormat(Now(),"dd/mm/yyyy")),"C",Trim(instiNum),Trim(accouNum),Trim(transNum),Trim(varAccStatus),session.language);
I'm aware that Axis2 was introduced in CF10 however in ColdFusion Administrator I set the default as Axis1; I don't believe this is the cause of the issue. I've tried refreshing the WSDL however the only difference between the WSDL files between the two servers are the URLs.
Is there a way to cfdump a web service and view all of it's parameters?

TomEE server is not passing web service request to the webmethod

I am new in the area of SOAP Based web services. I am using TomEE server. The server is a bit customized according to my organization's need.
Few days back, when I was trying to run the web services example from TomEE website, I was able to generate the wsdl and calling the web service by a client.
Now, when I need to use the customized version of TomEE plus (by the organization), I can see that the request does reach to the server and hence there is a log entry also but my #WebMethod is not getting executed.
Does any one has any idea about any configuration which can prevent the request from reaching to the webservice method? Is there any pointer around how can I debug further to reach out to the root cause of this issue?
Without further information about what is customized it's like fishing in the dark.
I would guess that perhaps the global web.xml or the server.xml of tomee server is changed so that some URI context mappings are not forwarded or ignored. But it's only a lucky tip.

Third party web service not accessable from code untill I type the webservice URL on browser on same machine

I am having a strange scenario while working with thirdparty asmx web service.I have develop and WCF service which utilize third party webservice.The WCF service is consume by my ASP.net WebForm application. The asp.net access the WCF service and it works fine and successful perform the job i.e. call the third party asmx web service. But after sometime my WFC service start giving following error on asmx webserivce calls
System.Net.WebException: The operation has timed out
This error keep continues until i access the asmx webservice from browser which shows to me that asmx service is running and accessible. Strangly after this browser call my WCF service keep working normal i.e. do not give timout error and perform the job on subscquent calls as well.
The WCF service is hosted on internet enable windows 2012 HyperV VM from where it access asmx web service.
Please suggest any solution . Thanks in advance
I am able to solve this . For those facing same issue I added the third party webservice IP in dns mapping in host machine entries from where WCF service is calling third party webservice

How do I setup a asmx web service in Azure that accepts a client certificate?

I apologize in advance if the question is ridiculous.
I have an asmx service running in Azure (HTTP - no SSL).
I have a WPF app that loads a X509Certificate2 and adds it to the request by doing the following:
X509Certificate2 cert = new X509Certificate2("...");
webRequest.ClientCertificates.Add(cert);
In the web service I get the certificate by
new X509Certificate2(this.Context.Request.ClientCertificate.Certificate)
And then I load a cert (that I have both uploaded to the Azure control panel and added to my service definition file) by using the following sample:
var store = new X509Store(StoreName.My, StoreLocation.LocalMachine);
store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);
X509Certificate2Collection certs = store.Certificates.Find(X509FindType.FindBySubjectName, certName, true);
And then I validate by doing the following:
clientCert.Thumbprint == certs[0].Thumbprint
Now unfortunately I get an exception (System.Security.Cryptography.CryptographicException: m_safeCertContext is an invalid handle) as soon as I do
Request.ClientCertificate.Certificate
So I have a few questions. How do I avoid the exception. This answer states I need to modify an IIS setting, but how can I do that in Azure?
In any case is this even the proper way to do certificate authentication?
Thanks!
You can use command scripts to modify IIS, in combination with appcmd.exe.
For a quick example (disabling timeout in an application pool), take a look at this sample by Steve Marx.
In this example, you'd call DisableTimeout.cmd as a startup task. For more info on creating startup tasks, you can watch this episode of Cloud Cover Show. There should be a lab on startup tasks in the Platform Training Kit as well.
Just remember that any type of IIS configuration change should be made via an automated task at startup. If you manually change IIS via RDP, those changes won't propagate to all of your instances, and won't remain persistent in the event of hardware failure or OS update.
You can remote into your azure instances to manage IIS. As for a way to do it globally for all instances at once, I'm not sure. That would be an interesting side project though.
http://learn.iis.net/page.aspx/979/managing-iis-on-windows-azure-via-remote-desktop/

change asp.net 2 web service address

I'm developing an application that includs a web service, on development time I run the service locally on my pc, than I publish the service to a remote server,
I wanna know how can I take the web reference that I got and just change the address of the service to the remote server to check that every thing is ok
You can set the service URL usign the Url property:
MyWebService.Service1 service = new MyWebService.Service1();
service.Url = NEWSERVICEURL;
Right click on your Web reference, click properties, and choose Url behavior: Dynamic in properies window. The URL of the Web service will be automatically mapped to a configuration option in the Web.config file that you can change easily, without recompilation: