Hello Everyone.

I'm running into an issue preventing a .NET Console application from calling
a simple proof-of-concept ColdFusion web service. Here is the ColdFusion web
service component (ReturnShape.cfc):

<cfcomponent displayname="ReturnShape" output="false" namespace="
> http://tempuri.org/";>
>
>     <cffunction name="returnShape" returntype="Shape" access="remote"
> output="false">
>         <cfargument required="true" type="Shape" name="s">
>         <cfscript>
>             s.length = s.length *2;
>             s.width = s.width * 2;
>         </cfscript>
>         <cfreturn s>
>     </cffunction>
>
> </cfcomponent>
>

Here is the code for the "Shape" object (Shape.cfc):

<cfcomponent displayname="Shape" output="false">
>
>     <cfproperty name="length" type="numeric" />
>     <cfproperty name="width" type="numeric" />
> </cfcomponent>


Here are the steps to reproduce the .NET Error (Visual Studio 2005)

   1. Create the Shape.cfc and ReturnShape.cfc components in a coldfusion
   instance.
   2. Create new Windows Console Application (C# Example below)
   3. Right click ConsoleApplication1, click "Add Web Reference"
   4. in the URL Field, give it the URL to ReturnShape.cfc?wsdl
   5. In my example, the Web reference name is "ksykora.clay" - yours
   will be different... Click "Add Reference"
   6. In the Main function in Program.cs, I use the code:

   clay.ksykora.Shape s = new clay.ksykora.Shape();
               s.length = 1;
               s.width = 2;

               clay.ksykora.ReturnShape service = new
   clay.ksykora.ReturnShape ();
               s = service.returnShape(s);

               Console.WriteLine(s.length + "-" + s.width);
               Console.ReadLine();

When I run the .NET Program, I get an exception on the invocation line [s =
service.returnShape(s);]:

"org.xml.sax.SAXException: Deserializing parameter 's':  could not find
> deserializer for type { http://tempuri.org/}Shape";
>
> "   at 
> System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
> message, WebResponse response, Stream responseStream, Boolean asyncCall)
>
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
> methodName, Object[] parameters)\r\n
>
at ConsoleApplication1.clay.ksykora.ReturnShape.returnShape(Shape s) in
> C:\\workspace\\ConsoleApplication1\\ConsoleApplication1\\Web
> References\\clay.ksykora\\Reference.cs:line 29\r\n
>
at ConsoleApplication1.Program.Main(String[] args) in
> C:\\workspace\\ConsoleApplication1\\ConsoleApplication1\\Program.cs:line
> 13\r\n
>
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)\r\n
> at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
> assemblySecurity, String[] args)\r\n
>
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n
>
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n
>
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
> ContextCallback callback, Object state)\r\n   at
> System.Threading.ThreadHelper.ThreadStart ()"
>

Could anybody with experience calling CFComponents with complex
arguments/return types from a .NET Environment please point me in the right
direction? Thanks in Advance!

-- 
Ken Sykora


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 & 
Flex 2
Free Trial 
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:279533
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to