Highlighted

Error when consuming a web service in CF 11

New Here ,
Apr 20, 2015

Copy link to clipboard

Copied

I am consuming a web service in ColdFusion what was written in .NET.  Some methods of the web service work fine, but some we get the below error.  We have identified the issue is the name of one of the properties in the web service appears to be the issue.  The property name is ID.  This is a very common property name so I would think someone has run across this before.  It appears that maybe ID is a default property for Axis?  I can dump the method that works and I see there is a getID() method with a return type of org.apache.axis.types.Id.

If we change the name of the property to something other than ID it works, but this will cause us to refactor a lot of code.

Here is the error I get when I try to call GetRoles method, which contains an ID property:

Cannot perform web service invocation GetRoles. The fault returned when invoking the web service operation is:

AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXException: For input string: "i1"
java.lang.NumberFormatException: For input string: "i1"
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: For input string: "i1"
java.lang.NumberFormatException: For input string: "i1"
at org.apache.axis.encoding.ser.BeanDeserializer.onStartElement(BeanDeserializer.java:462)
at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:393)
at org.apache.axis.encoding.ser.BeanDeserializer.startElement(BeanDeserializer.java:154)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message... ''

I am running CF 11 Update 4.

Views

727

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

Error when consuming a web service in CF 11

New Here ,
Apr 20, 2015

Copy link to clipboard

Copied

I am consuming a web service in ColdFusion what was written in .NET.  Some methods of the web service work fine, but some we get the below error.  We have identified the issue is the name of one of the properties in the web service appears to be the issue.  The property name is ID.  This is a very common property name so I would think someone has run across this before.  It appears that maybe ID is a default property for Axis?  I can dump the method that works and I see there is a getID() method with a return type of org.apache.axis.types.Id.

If we change the name of the property to something other than ID it works, but this will cause us to refactor a lot of code.

Here is the error I get when I try to call GetRoles method, which contains an ID property:

Cannot perform web service invocation GetRoles. The fault returned when invoking the web service operation is:

AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXException: For input string: "i1"
java.lang.NumberFormatException: For input string: "i1"
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: For input string: "i1"
java.lang.NumberFormatException: For input string: "i1"
at org.apache.axis.encoding.ser.BeanDeserializer.onStartElement(BeanDeserializer.java:462)
at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:393)
at org.apache.axis.encoding.ser.BeanDeserializer.startElement(BeanDeserializer.java:154)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
at org.apache.axis.message... ''

I am running CF 11 Update 4.

Views

728

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
Apr 20, 2015 0
Adobe Community Professional ,
May 02, 2015

Copy link to clipboard

Copied

You may have passed "i1" where the service is expecting a number.

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...
May 02, 2015 0
New Here ,
May 02, 2015

Copy link to clipboard

Copied

‌thanks for the reply.  I will check on the i1 but the service works fine when called from .net.  Also this is not the only one that gives this error.  It looks like it is the ones that returns a field from the database called ID.  If we do not return the ID field with the service to works.  I was thinking ID or rather getID() was a reserved word or something.

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...
May 02, 2015 0
Adobe Community Professional ,
May 02, 2015

Copy link to clipboard

Copied

I see what you mean. Nevertheless, the service is complaining about the string "i1" being passed as a number.

A common mistake is to pass "i1" instead of "valueOfVariable(i1)". In Coldfusion terms, passing "i1" instead of "#i1#".

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...
May 02, 2015 0
New Here ,
May 02, 2015

Copy link to clipboard

Copied

I am not passing any parameters to the method (it has no parameters).  On the ColdFusion side I do not use i1 anywhere.  I will check with the .net developer on Monday to see if he is using it anywhere in his code.  If he is he is using in consistently as the only methods that work from his service are those that do not have an ID property.  All services with an ID property give me the same error message.

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...
May 02, 2015 0
BKBK LATEST
Adobe Community Professional ,
May 02, 2015

Copy link to clipboard

Copied

I used ColdFusion just to illustrate what might be happening. The place to look is the .NET web service. The .NET developer might want to start by ruling this out:

BKBK wrote:

... A common mistake is to pass "i1" instead of "valueOfVariable(i1)"...

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...
May 02, 2015 0