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

CFC Webservice returnType="struct"

New Here ,
Oct 02, 2008 Oct 02, 2008

Copy link to clipboard

Copied

Hi All,

I have a problem that is slowly killing me.

I have a simple webservice with all functions set to remote. 3 functions, each returning a different data type and I am consuming this in other languages.

Function 1 : Returns Array
Function 2 : Resturns Query
Function 3 : Returns Struct

Using C#, I am able to consume the webservice and return the data from Function 1 (Array) and Function 2 (Query) but not Function 3.

Looking at the SOAP, a Map and MapItem complex data type is used but in C#, the Map.item is null. In ColdFusion (Consuming using CFInvoke) the data is returned no problemo.

Anybody got any ideas? BTW, I tried this in CF8 and Railo3 with the same results. Null for any returnType of Struct using C#.

Dan.


TOPICS
Advanced techniques

Views

584

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 02, 2008 Oct 02, 2008

Copy link to clipboard

Copied

try returntype = any

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
New Here ,
Oct 02, 2008 Oct 02, 2008

Copy link to clipboard

Copied

LATEST
Hi Dan,

Thanks for coming back with a suggestion.

Unfortunately, it results in the same thing.

Quick Example:

From CFC:
<cffunction name="StructTest" access="remote" returntype="any">
<cfargument name="argString" required="Yes" type="string">

<cfset var result = structNew()>

<cfset structInsert(result,"Dan","Daniel Mackey")>
<cfset structInsert(result,"Sam","Sam Kidd")>
<cfset structInsert(result,"Peter","Peter Coppinger")>

<cfreturn result>
</cffunction>


From C#
LPS.WebServiceTest lps = new LPS.WebServiceTest();
LPS.Map map;
map = (LPS.Map)lps.StructTest("Dan");
MessageBox.Show(map.item.ToString());

The same thing occurs.

map.item is null

If I invoke this from ColdFusion, the correct data is returned :-(

The exact C# message is :
"Object reference not set to an instance of an object." and if I test map.item it is in fact Null.

Arrays, Strings, Queries are all working fine.

This is driving me nuts out of principle in that it should be fine.
Map contains item which is an array of mapItems, each with a Key/Value pair.

I could work around it by using an Array of Arrays SOAP type (Convert the struct to an array which each element being a 2 element array for the key/values) but out of principle its eating away at my will to live like a SOAP/C# brain cancer ;-)

Dan.

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