• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Web Service help

Explorer ,
Oct 11, 2006 Oct 11, 2006

Copy link to clipboard

Copied

We are trying to use a web service to retrieve a recordset from a API on a remote server via COM. I created a CFC on the API server to handle the communication with the COM objects. It has been set up to act as a web service. I then have a script running on our web server that invokes the web service to retrieve the information requested. I am getting the following error and am stuck. I was wondering if anyone had any ideas. Below is the error and and the two code files. Thanks in advance for any help.

Error:

Exceptions

14:22:08.008 - Application Exception - in C:\CFusionMX\wwwroot\test4.cfm : line 15
Could not perform web service invocation "getCustGeneralInfo" because AxisFault
faultCode: { http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXParseException: Next character must be ">" terminating comment .
faultActor:
faultNode:
faultDetail:
{ http://xml.apache.org/axis/}stackTrace: org.xml.sax.SAXParseException: Next character must be ">" terminating comment .
at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3339)
at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3333)
at org.apache.crimson.parser.Parser2.nextChar(Parser2.java:3255)
at org.apache.crimson.parser.Parser2.maybeComment(Parser2.java:1051)
at org.apache.crimson.parser.Parser2.maybeMisc(Parser2.java:1233)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:621)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:333)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
at org.apache.axis.encoding...


Calling file:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Service</title>
</head>

<body>

<cfinvoke webservice=" http://localhost:8500/components/CustInfo.cfc?wsdl"
method="getCustGeneralInfo"
returnVariable="rData">
<cfinvokeargument name="companyID" value="100">
<cfinvokeargument name="accountNumber" value="2839">
<cfinvokeargument name="tankNumber" value="0">
</cfinvoke>


</body>
</html>

CFC:

<cfcomponent>

<cffunction name="getCustGeneralInfo" access="remote" returntype="any" output="false">
<cfargument name="companyID" default="" hint="companyID" required="true" type="numeric">
<cfargument name="accountNumber" default="" hint="Customer account number" required="true" type="numeric">
<cfargument name="tankNumber" default="" hint="Customer tank number" required="true" type="numeric">

<CFOBJECT ACTION="CREATE" NAME="getLogin" CLASS="EnergyAPI.cCustomerInfo">

<cfset iCompanyID = 100>
<cfset lAccountNumber = 2839>
<cfset cSysUser = "WebUser">
<cfset lRetCode = "">

<CFSET resultSet=getLogin.GetGeneralInfo(iCompanyID, lAccountNumber, cSysUser, lRetCode)>

<cfreturn resultSet>
</cffunction>


<cffunction name="getDelivGeneralInfo" access="remote" returntype="any" output="false">
<cfargument name="companyID" default="" hint="companyID" required="true" type="numeric">
<cfargument name="accountNumber" default="" hint="Customer account number" required="true" type="numeric">
<cfargument name="tankNumber" default="" hint="Customer tank number" required="true" type="numeric">

<CFOBJECT ACTION="CREATE" NAME="getLogin" CLASS="EnergyAPI.cDelivery">

<cfset iCompanyID = arguments.comapnyID>
<cfset lAccountNumber = arguments.accountNumber>
<cfset iTankNumber = arguments.tankNumber>
<cfset cSysUser = "WebUser">
<cfset lRetCode = "">

<CFSET resultSet=getLogin.GetGeneralInfo(iCompanyID, lAccountNumber, iTankNumber, cSysUser, lRetCode)>

<cfreturn resultSet>
</cffunction>

<cffunction name="getServiceGeneralInfo" access="remote" returntype="any" output="false">
<cfargument name="companyID" default="" hint="companyID" required="true" type="numeric">
<cfargument name="accountNumber" default="" hint="Customer account number" required="true" type="numeric">
<cfargument name="serviceNumber" default="" hint="Customer tank number" required="true" type="numeric">

<CFOBJECT ACTION="CREATE" NAME="getLogin" CLASS="EnergyAPI.cService">

<cfset iCompanyID = arguments.comapnyID>
<cfset lAccountNumber = arguments.accountNumber>
<cfset iServiceNum = arguments.serviceNumber>
<cfset cSysUser = "WebUser">
<cfset lRetCode = "">

<CFSET resultSet=getLogin.GetGeneralInfo(iCompanyID, lAccountNumber, iServiceNum, cSysUser, lRetCode)>

<cfreturn resultSet>
</cffunction>

</cfcomponent>
TOPICS
Advanced techniques

Views

257

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
community guidelines
LEGEND ,
Oct 11, 2006 Oct 11, 2006

Copy link to clipboard

Copied

Since it sounds like you control both sides of this transaction. The
first good test is to create a testing cfm page on the same server that
calls the webservice cfc directly as a component. Make sure your
functions are working and returning what you expect them to return
locally, then try to access them remotely.

Votes

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
community guidelines
Explorer ,
Oct 11, 2006 Oct 11, 2006

Copy link to clipboard

Copied

LATEST
It works just fine if I call it as a component.

<cfinvoke component="components/CustInfo"
method="getCustGeneralInfo"
returnVariable="rData">
<cfinvokeargument name="companyID" value="100">
<cfinvokeargument name="accountNumber" value="2839">
<cfinvokeargument name="tankNumber" value="0">
</cfinvoke>

I get exactly what I expect. Is it possible that since I am returning a ADO recordset that the XML is having a issue with that?

Votes

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
community guidelines
Resources
Documentation