Copy link to clipboard
Copied
I am setting up a web service on my Coldfusion 10 server.
I created this CFC...
<cfcomponent>
<cffunction name="helloWorld" returnType="string" access="remote">
<cfreturn "Hello World!">
</cffunction>
</cfcomponent>
I try to call it like this...
<cfset wsURL = "http://txedtylvms031/cf-bin/Components/hello.cfc?wsdl">
<cfinvoke
webservice = "#wsURL#"
method = "helloWorld"
returnVariable = "result">
<cfoutput> <H1> #result# </H1></cfoutput>
I get this error
Cannot perform web service invocation helloWorld. | |||||
The fault returned when invoking the web service operation is: org.apache.axis2.AxisFault: javax.xml.stream.XMLStreamException: DOCTYPE is not allowed at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430) at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:124) at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:68) at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:354) at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421) at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229) at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165) at cfbin.components.CfBinComponentsHelloCfcStub.helloWorld(CfBinComponentsHelloCfcStub.java:189) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce... ''
|
I am new to webservices in CF and not sure how to resolve.
I have done some searching but nothing has helped me understand my issue here.
Any thoughts would be appreciated
Copy link to clipboard
Copied
Your code seems to be alright. Your error message suggests a bug. Two thngs I can think of are:
1) You should update Coldfusion. You can do this via the Administrator;
2) You could experiment by explicitly specifying Axis 2. That is, use <cfset wsURL = "http://txedtylvms031/cf-bin/Components/hello.cfc?wsdl2">
If all else fails, report a bug.