Highlighted

Webservice newbie question

New Here ,
Nov 23, 2015

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... ''

The error occurred in D:/Inetpub/wwwroot/cf-bin/Jay/jwshello.cfm: line 5

3 : webservice = "#wsURL#"

4 : method = "helloWorld"

5 : returnVariable = "result">

6 : <cfoutput> <H1> #result# </H1></cfoutput>

7 :

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

TOPICS
Advanced techniques

Views

1.2K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Webservice newbie question

New Here ,
Nov 23, 2015

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... ''

The error occurred in D:/Inetpub/wwwroot/cf-bin/Jay/jwshello.cfm: line 5

3 : webservice = "#wsURL#"

4 : method = "helloWorld"

5 : returnVariable = "result">

6 : <cfoutput> <H1> #result# </H1></cfoutput>

7 :

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

TOPICS
Advanced techniques

Views

1.2K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Nov 23, 2015 0
BKBK LATEST
Adobe Community Professional ,
Nov 25, 2015

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 25, 2015 0