Error registering REST service in ColdFusion 10 - web-services

I'm having a problem registering a REST web service in the ColdFusion Administrator. I'm using ColdFusion 10 on a Windows server, and the error I get after trying to register a REST web service is:
Error registering REST service. Please ensure that you have entered a proper mapping and path.
Application CA could not be initialized.
Reason: class "com.sun.xml.bind.Util"'s signer information does not match signer information of other classes in the same package
class "com.sun.xml.bind.Util"'s signer information does not match signer information of other classes in the same package
I've tried registering a service on both a remote CF instance as well as my local instance. Locally I've tried just a real basic service - basically one CFC in an application all by itself, but still get the error. I am putting in both the Root path and the Service Mapping, as I do not have an Application.cfc in the application.
Any ideas?

This problem was caused by some custom JARs I was referencing in the ColdFusion Class Path in the Java and JVM settings in the CF Admin utility. I removed the references to the JARs and restarted the CF instance. Then I was able to successfully add the REST WS. I then re-added the JARs in the class path and restarted the instance. The proper solution is probably to recompile those JARs with the same certificate, but if you don't have access to the source code, this may be the only workaround.

Related

web service can be browse from remote iis but not on internet

There is a web service that currently is published and can be browsed on internet.
I have copied the service folder located in wwwroot and I paste it in the same location changing the name.
Both were hosted on the Default site.
From IIS Manager I have converted the copied folder as application, if a browse it locally, works, if a browse it remotely within the same domain, works
service works
But if I try doing it from internet can not be access and I receive the message
service doesnt work
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
I've checked the Virtual Path and I have created another application pool, but it have not worked yet.
if somebody could suggest me something. Thanks
Regards.
J Fuentes.

Azure App Service "Server Error in '/' Application"

I have a business website that has been running perfectly well on IIS using .NET 4.5, but in Azure it fails.
Now before I lead you too far down this rabbit hole, I can make the IIS fault in the same way as the Azure fault detailed below by NOT converting the website to Application. However, for the life of me I cannot find the equivalent option in Azure; how to convert to Application or equivalent?
I have uploaded to Azure using the Azure App Service Migration Assistant. The only alert was:
"IIS7+ Schema Compliance: One or more elements and/or attributes are being used which are not defined in Azure App Service IIS schema. Consider using XDT transforms."
This links to https://learn.microsoft.com/en-nz/azure/app-service/web-sites-configure which indicates various Azure Application Settings, which I have played with to no avail.
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Source File: D:\home\site\wwwroot\peterfinch\service.desktop\web.config Line: 143
Can anyone please provide any guidance as to what I am missing? many thanks for your time, Peter Finch
so the answer was setting virtual applications and directories for each website, and this now just worked. App Service, Application Settings, at the end of the list, Virtual applictions and directories.
This was the part that was missing, how to 'convert to application'
So resolved it myself, thanks for looking and I hope this helps someone else in the future.
/ site\wwwroot   Application x
/mysitename site\wwwroot\mysitename   Application
/mysitename/Console site\wwwroot\mysitename\Console\   Application x
/mysitename/Service.App site\wwwroot\mysitename\Service.App\  Application x
/mysitename/Service.Desktop site\wwwroot\mysitename\Service.Desktop Application x

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.

WSO2 API Key Manager

I am configuring our API Manager, but running into troubles authenticating via OAuth, seems to be an issue with the API Key Manager. I haven't dug into it yet, but does this come with the API Manager (as I have assumed) or is this a separate installation?
I had the same issue when using the wso2 api manager on a Amazon hosted machine, turn out that Thrift was not working correctly because some problem with multicasting and broadcasting.
What I did to get it working was to switch from ThriftClient to WSClient. If you have a huge amount of requests coming in then Thrift is the recommended solution from wso2 but in any "normal" case you will not have any differences between thrift and WS.
Here is how you switch:
Shut down the API Manager
Open up <api manager install dir>\repository\conf\api-manager.xml
Find ThriftClient
Change this to
<KeyValidatorClientType>WSClient</KeyValidatorClientType>
Start the API Manager
You may get some Warnings while starting up but, try it before you jump to the conclusion that it doesn't work.
Hope it helps!
you can use APIM manager product in a distributed setup as keymanger,gateway,store,publisher..but all functionality come in a single distribution.. ..
Go through the documentation for further guides
I was facing the same issue. Everything started when I created my own jks in order to use SSL without a self-signed certificate. I successfully created the jks and changed it in the carbon file. When I started the server, everything seemed ok; but when I used SOAPUI to test an API call, I got this (in the logs of the api manager):
APIAuthenticationHandler API authentication failure due to Unclassified Authentication Failure
I started digging what was the problem by enabling Debug level in the log4j.properties file, and then tried again a tested with SOAPUI and I got:
APISecurityException: Could not connect to <my api ip address> on port 10397
Then, I read the comment of OneMuppet and I checked that file and I found that the Thrift config has a host option, so I uncommented it:
<KeyValidatorClientType>ThriftClient</KeyValidatorClientType>
<ThriftClientPort>10397</ThriftClientPort>
<ThriftClientConnectionTimeOut>10000</ThriftClientConnectionTimeOut>
<ThriftServerPort>10397</ThriftServerPort>
This Line --> <ThriftServerHost>localhost</ThriftServerHost>
<EnableThriftServer>true</EnableThriftServer>
Save, restarted the server and everything start working correctly.
I got the same below issue after my installation, when i try to invoke the api service it is throwing below error:
900900 Unclassified Authentication Failure Error while accessing backend services for API key validation
After some random checks i have seen the axis2.xml file in /repository/conf/axis2 there it is refering a differnt ip's instead. I change these ip's to my local ip and restarted. The issue is resolved now.
I was facing the same issue. when I was trying to setup API Manager as an API Gateway in a different machine as per the steps given here,
https://docs.wso2.com/display/AM250/Publish+through+Multiple+API+Gateways
Once the setup is done and when I am trying to use this gateway URL, I was getting the below response,
{"fault":{"code":900900,"message":"Unclassified Authentication Failure","description":"Error while accessing backend services for API key validation"}}
After changing the KeyValidatorClientType value to WSClient from ThriftClient on the <api manager install dir>\repository\conf\api-manager.xml
It started working fine. And I was able to get the expected response.
If you changed the admin password, then you also have to update the repository/conf/api-manager.xml file with the new password. The 2 places I have changed (so far) are:
<AuthManager>
and
<APIKeyManager>
but there are other admin usernames in that file. No doubt, I'll get to them....

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/