Hi,
I am working with webservices for the first time, and my knowledge is very rudimentary.
Scenario:
I need to implement NT Authentication on my intranet app. My CF6.1 server can’t process the cfntauthenticate tag.
I also have a CF9 9,0,1,274733 server that I can use to process a webservice to provide authentication.
So, working locally at present on CF9…
My NTLoginService.cfc looks like :
<cfcomponent displayname="NT Login Service" hint="Provides NT Domain Authentication" output="false">
<cffunction
access="remote"
name="loginUserNT"
output="no"
returntype="struct"
displayname="Authenticates A User Against A Windows Domain"
hint="Authenticates a user against a Microsoft Windows Domain" >
<cfargument name="NTusername" type="string" required="yes" displayname="username">
<cfargument name="NTpassword" type="string" required="yes" displayname="password">
<cfargument name="NTdomain" type="string" required="yes" displayname="domain">
<cfntauthenticate username="#Arguments.NTusername#"
password="#arguments.NTpassword#"
domain="#arguments.NTdomain#"
result="authUser"
listgroups="false"
throwonerror="false">
<cfreturn authUser>
</cffunction>
</cfcomponent>
I hope to return the result of the cfntauthenticate call.
I can browse the cfc via URL http://localhost/login/NTLoginService.cfc and see the methods\parameters okay.
But if I browse to http://localhost/login/NTLoginService.cfc?wsdl
I receive the error:
AXIS error
Sorry, something seems to have gone wrong... here are the details:
Fault - Error attempting to create Java skeleton for CFC web service.; nested exception is:
coldfusion.xml.rpc.CFCInvocationException: [java.lang.NullPointerException : null]
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode:
faultString: Error attempting to create Java skeleton for CFC web service.; nested exception is:
coldfusion.xml.rpc.CFCInvocationException: [java.lang.NullPointerException : null]
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:WSHBILL032
If I try to invoke the webservice with :
<cfinvoke
webservice="http://localhost/login/NTLoginService.cfc?wsdl"
method="loginUserNT"
returnvariable="authentication"
refreshWSDL="yes">
<cfinvokeargument name="NTusername" value="#form.username#"/>
<cfinvokeargument name="NTpassword" value="#form.password#"/>
<cfinvokeargument name="NTdomain" value="#form.domain#"/>
</cfinvoke>
I receive the error:
Unable to read WSDL from URL: http://localhost/login/NTLoginService.cfc?wsdl. |
|
Error: 500 Internal Server Error. | |
http://localhost/login/ is a IIS virtual directory that points to c:\websites\login\
I have restarted the local CF server multiple times.
I wouldn’t be surprised if I have missed something simple.
Would any one have any ideas on what to do next? Googling hasn’t been very informative.
Thanks for any assistance.
--
You received this message because you are subscribed to the Google Groups "cfaussie" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cfaussie+u...@googlegroups.com.
To post to this group, send email to cfau...@googlegroups.com.
Visit this group at http://groups.google.com/group/cfaussie.
For more options, visit https://groups.google.com/d/optout.
You may want to look at the coldfusion-out.log (in \coldfusion9\runtime\logs or jrun4\logs) to see if there’s any more detail in there about the problem.
/charlie
--
Hi
@Charlie,
From coldfusion-out.log:
07/10 14:15:29 Information [jrpp-0] - Starting Web service request.
07/10 14:15:29 Information [jrpp-0] - Creating Web service proxy {url='http://localhost/login/NTLoginService.cfc?wsdl'}
07/10 14:15:31 Error [jrpp-0] - coldfusion.jsp.CompilationFailedException: Errors reported by Java compiler: Found 5 semantic errors compiling ""C:/ColdFusion9/stubs/WS854518475/login/NTLoginServiceLocator.java"": 10. public class NTLoginServiceLocator extends org.apache.axis.client.Service implements login.NTLoginService { ^------------------------------------------------------------------------------------------^ *** Semantic Error: The checked exception ""RemoteException"" is not assignable to any exception in the throws clause of the accessible method ""javax.xml.rpc.Call createCall() throws javax.xml.rpc.ServiceException;"" declared in type ""javax.xml.rpc.Service"". 10. public class NTLoginServiceLocator extends org.apache.axis.client.Service implements login.NTLoginService { ^------------------------------------------------------------------------------------------^ *** Semantic Error: The method ""org.apache.axis.client.Call createCall() throws java.rmi.RemoteException;"" with protected ac... The specific sequence of files included or processed is: C:\websites\login\login_act.cfm, line: 17
Which refers to:
<cfif isdefined("form.btnLogin")>
User Submitted Username <cfoutput>#form.username#, password #form.password#</cfoutput>
returnvariable="authUser"
refreshWSDL="yes">
<cfinvokeargument name="NTusername" value="#form.username#"/>
<cfinvokeargument name="NTpassword" value="#form.password#"/>
<cfinvokeargument name="NTdomainz" value="#form.domain#"/>
</cfinvoke>
Where line 17 is <cfinvokeargument name="NTdomainz" value="#form.domain#"/>
Please note that I changed the name of the 3rd param to NTdomainz since I first posted, as I was thinking that NTDomain may have been a reserved word.
@Andrew
Enable Robust Exception Information is selected in CF Admin, and within IE Show friendly HTTP error messages is unticked. ( I assume this is what you are referring too).
Thanks,
Hi,
Sorry, yes this option is already selected.
The server is running on 32-bit.
Hi,
After deleting the stubs in C:\ColdFusion9\stubs\WS854518475\login
I was able to get the wsdl to generate ( see below )
The CFinvoke statement returns an error however:
<cfinvoke
webservice="http://localhost/login/NTLoginService.cfc?wsdl"
method="loginUserNT"
returnvariable="authUser"
refreshWSDL="yes">
<cfinvokeargument name="NTusername" value="test"/>
<cfinvokeargument name="NTpassword" value="testpassword"/>
<cfinvokeargument name="NTdomainz" value="testdomain"/>
</cfinvoke>
coldfusion.jsp.CompilationFailedException: Errors reported by Java compiler: Found 5 semantic errors compiling "C:/ColdFusion9/stubs/WS854518475/login/NTLoginServiceLocator.java": 10. public class NTLoginServiceLocator extends org.apache.axis.client.Service implements login.NTLoginService { ^------------------------------------------------------------------------------------------^ *** Semantic Error: The checked exception "RemoteException" is not assignable to any exception in the throws clause of the accessible method "javax.xml.rpc.Call createCall() throws javax.xml.rpc.ServiceException;" declared in type "javax.xml.rpc.Service". 10. public class NTLoginServiceLocator extends org.apache.axis.client.Service implements login.NTLoginService { ^------------------------------------------------------------------------------------------^ *** Semantic Error: The method "org.apache.axis.client.Call createCall() throws java.rmi.RemoteException;" with protected access cannot replace the accessible method "javax.xml.rpc.Call createCall() th....
WSDL:
<?xml version="1.0" encoding="UTF-8"?>
<!--WSDL created by ColdFusion version 9,0,1,274733-->
<wsdl:types><schema targetNamespace="http://xml.apache.org/xml-soap" xmlns="http://www.w3.org/2001/XMLSchema"><import namespace="http://rpc.xml.coldfusion"/><import namespace="http://login"/><import namespace="http://schemas.xmlsoap.org/soap/encoding/"/><complexType name="mapItem"><sequence><element name="key" type="xsd:anyType" nillable="true"/><element name="value" type="xsd:anyType" nillable="true"/></sequence></complexType><complexType name="Map"><sequence><element name="item" type="apachesoap:mapItem" minOccurs="0" maxOccurs="unbounded"/></sequence></complexType></schema><schema targetNamespace="http://rpc.xml.coldfusion" xmlns="http://www.w3.org/2001/XMLSchema"><import namespace="http://xml.apache.org/xml-soap"/><import namespace="http://login"/><import namespace="http://schemas.xmlsoap.org/soap/encoding/"/><complexType name="CFCInvocationException"><sequence/></complexType><complexType name="QueryBean"><sequence><element name="columnList" type="impl:ArrayOf_xsd_string" nillable="true"/><element name="data" type="impl:ArrayOfArrayOf_xsd_anyType" nillable="true"/></sequence></complexType></schema><schema targetNamespace="http://login" xmlns="http://www.w3.org/2001/XMLSchema"><import namespace="http://xml.apache.org/xml-soap"/><import namespace="http://rpc.xml.coldfusion"/><import namespace="http://schemas.xmlsoap.org/soap/encoding/"/><complexType name="ArrayOf_xsd_string"><complexContent><restriction base="soapenc:Array"><attribute wsdl:arrayType="xsd:string[]" ref="soapenc:arrayType"/></restriction></complexContent></complexType><complexType name="ArrayOfArrayOf_xsd_anyType"><complexContent><restriction base="soapenc:Array"><attribute wsdl:arrayType="xsd:anyType[][]" ref="soapenc:arrayType"/></restriction></complexContent></complexType></schema></wsdl:types><wsdl:message name="loginUserNTRequest"><wsdl:part name="NTusername" type="xsd:string"/><wsdl:part name="NTpassword" type="xsd:string"/><wsdl:part name="NTdomainz" type="xsd:string"/></wsdl:message><wsdl:message name="CFCInvocationException"><wsdl:part name="fault" type="tns1:CFCInvocationException"/></wsdl:message><wsdl:message name="loginUserNTResponse"><wsdl:part name="loginUserNTReturn" type="apachesoap:Map"/></wsdl:message><wsdl:portType name="NTLoginService"><wsdl:operation name="loginUserNT" parameterOrder="NTusername NTpassword NTdomainz"><wsdl:input name="loginUserNTRequest" message="impl:loginUserNTRequest"/><wsdl:output name="loginUserNTResponse" message="impl:loginUserNTResponse"/><wsdl:fault name="CFCInvocationException" message="impl:CFCInvocationException"/></wsdl:operation></wsdl:portType><wsdl:binding name="NTLoginService.cfcSoapBinding" type="impl:NTLoginService"><wsdlsoap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/><wsdl:operation name="loginUserNT"><wsdlsoap:operation soapAction=""/><wsdl:input name="loginUserNTRequest"><wsdlsoap:body namespace="http://login" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></wsdl:input><wsdl:output name="loginUserNTResponse"><wsdlsoap:body namespace="http://login" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></wsdl:output><wsdl:fault name="CFCInvocationException"><wsdlsoap:fault namespace="http://login" name="CFCInvocationException" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></wsdl:fault></wsdl:operation></wsdl:binding><wsdl:service name="NT Login Service"><wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">Provides NT Domain Authentication </wsdl:documentation><wsdl:port name="NTLoginService.cfc" binding="impl:NTLoginService.cfcSoapBinding"><wsdlsoap:address location="http://localhost/login/NTLoginService.cfc"/></wsdl:port></wsdl:service></wsdl:definitions>
From: cfau...@googlegroups.com [mailto:cfau...@googlegroups.com] On Behalf Of Andrew Scott
Sent: Thursday, 10 July 2014 2:57 PM
To: cfau...@googlegroups.com
Subject: Re: [cfaussie] Unable to read WSDL from URL
--
Hi,
Your suggestion works, passing it in via URL.
If I use my domain credentials it returns:
usernamesuccess
I guess it might have something to do with the cffunction returning a struct ( the cfauthenticate result ). I may have to simplify that.
Do coldfusion RESTful webservices work in CF 9? ( and can be used from CF6 ? )
This example mentions support for it was added in cf10.
http://www.adobe.com/devnet/coldfusion/articles/restful-web-services.html
Thanks very much for your assistance Andrew.
PS: I am still stuck on CF6.1 since the server it is on still runs Windows Server 2000 which was about the last version of windows my Crystal reports .asp SDK runs on. Which is a different issue all together.
From: cfau...@googlegroups.com [mailto:cfau...@googlegroups.com] On Behalf Of Andrew Scott
Sent: Thursday, 10 July 2014 3:15 PM
To: cfau...@googlegroups.com
Subject: Re: [cfaussie] Unable to read WSDL from URL
What happens if you try to invoke the CFC via the URL and not as a webservice?
--
HI,
<cfscript>
test = createObject("webservice","http://localhost/login/NTLoginService").loginUserNT(NTusername='username', NTpassword='pwd', NTdomainz='domain');
</cfscript>
Returns
Unable to read WSDL from URL: http://localhost/login/NTLoginService.
<cfscript>
test = createObject("webservice","http://localhost/login/NTLoginService?wsdl").loginUserNT(NTusername='username', NTpassword='pwd', NTdomainz='domain');
</cfscript>
Returns:
Unable to read WSDL from URL: http://localhost/login/NTLoginService?wsdl. |
|
Error: 404 Not Found. | |
When I try without the parameters being within text quotes, I get a different error again.
So I would say no, at this point in time.
CreateObject(type, urltowsdl[, portname, wsdl2JavaArgs])
--
That sounds like the good call, Dmitry.
Scott, you had opened saying that you were using a virtual directory in IIS. Can you change it to not be one and see if it helps? (Even though the bug report he refers to is for CF10, I would not be surprised if the problem went back to your CF 6.1.)
Also, Scott, your last message showing use of createobject indicated that you had gotten a 404 on the wsdl URL. The problem was that you left off the .cfc in the URL. So:
test = createObject("webservice","http://localhost/login/NTLoginService?wsdl").loginUserNT(NTusername='username', NTpassword='pwd', NTdomainz='domain');
should have been instead:
test = createObject("webservice","http://localhost/login/NTLoginService.cfc?wsdl").loginUserNT(NTusername='username', NTpassword='pwd', NTdomainz='domain');
(When you’re calling a component, you don’t put the .cfc, so it’s easy to get tripped up on that.)
Finally, while you can chain methods on the createobject, note that you don’t need to do that. And there can be advantages to NOT doing it, especially if you would need to call more than one method. You may already know that. Just wanted to point it out in case you go with that alternative approach. So you could do it this way, for instance:
ntlogin= createObject("webservice","http://localhost/login/NTLoginService.cfc?wsdl").loginUserNT(NTusername='username', NTpassword='pwd', NTdomainz='domain');
test = ntlogin.loginUserNT(NTusername='username', NTpassword='pwd', NTdomainz='domain');
test2 = ntlogin.callsomeothermethod;
Hope that helps.
/charlie
From: cfau...@googlegroups.com [mailto:cfau...@googlegroups.com] On Behalf Of Dmitry Yakhnov
Sent: Thursday, July 10, 2014 4:26 AM
To: cfau...@googlegroups.com
Subject: Re: [cfaussie] Unable to read WSDL from URL
Hi Scott,
This seems to be a well known bug:
https://bugbase.adobe.com/index.cfm?event=bug&id=3531653
https://forums.adobe.com/message/5207697
Cheers,
Dmitry,
On 10/07/2014 10:37 AM, Scott Thornton wrote:
Hi,
I am working with webservices for the first time, and my knowledge is very rudimentary.
Scenario:
<sjip>
HI All,
I removed the use of the virtual directory and my example now works. The reported bug using CFC’s and virtual directory exists as far back as version 9 (which I am working on locally, not tested cfinvoke on cf6.1 as yet).
I had seen the bug report prior to Dmitry posting, but wasn’t sure if it was an avenue I had to explore.
Thank you very much for all replies!
--