Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

Re: Send data complext to Net Webservice

$
0
0

Thanks BKBK.

 

 

I already tried a lot of different ways to send the object/parameters and I can't do it.

 

If I send the agente struct empty, it the webservice detects the array.

 

    <cfset param= structnew() >   

    <cfset param.emissionRequest = {}>

    <cfset param.emissionRequest.codSuc = "30">

    <cfset param.emissionRequest.producto = "200">

    <cfset param.emissionRequest.poliza = {}>

    <cfset param.emissionRequest.poliza.codTipoPoliza = "2">

    <cfset param.emissionRequest.poliza.ramoComercial = "5">   

    <cfset param.emissionRequest.agente = {}>

 

 

struct
EMISSIONREQUEST
struct
AGENTE
struct [empty]
CODSUC30
POLIZA
struct
CODTIPOPOLIZA2
RAMOCOMERCIAL5
PRODUCTO200

{"Exception":"Index was out of range. Must be non-negative and less than the size of the collection.Parameter name index","StackTrace":" at System.ThrowHelper.ThrowArgumentOutOfRangeExceptionExceptionArgument argument ExceptionResource resource at System.ThrowHelper.ThrowArgumentOutOfRangeException at System.Collections.Generic.List1.get_ItemInt32 index at System.Linq.Enumerable.ElementAtTSourceIEnumerable1 source Int32 index at GMXIntegrationService.EmissionService.createPolicyEmission emissionRequest in CUsersgmx.DocumentsVisual Studio 2008ProjectsGMXIntegrationServiceTestGMXIntegrationServiceEmissionSer vice.csline 30"}

 


but if I send values in the Agente struct display the next error

 

    <cfset param= structnew() >   

    <cfset param.emissionRequest = {}>

    <cfset param.emissionRequest.codSuc = "30">

    <cfset param.emissionRequest.producto = "200">

    <cfset param.emissionRequest.poliza = {}>

    <cfset param.emissionRequest.poliza.codTipoPoliza = "2">

    <cfset param.emissionRequest.poliza.ramoComercial = "5">   

    <cfset param.emissionRequest.agente = {}>   

    <cfset param.emissionRequest.agente.ramoTecnico = "10">

    <cfset param.emissionRequest.agente.codTipoAgente = "15">

 

 

struct
EMISSIONREQUEST
struct
AGENTE
struct
CODTIPOAGENTE15
RAMOTECNICO10
CODSUC30
POLIZA
struct
CODTIPOPOLIZA2
RAMOCOMERCIAL5
PRODUCTO200

{"Exception":"Object reference not set to an instance of an object.","StackTrace":" at GMXIntegrationService.EmissionService.createPolicyEmission emissionRequest in CUsersgmx.DocumentsVisual Studio 2008ProjectsGMXIntegrationServiceTestGMXIntegrationServiceEmissionSer vice.csline 30"}

 

 

I don't know how can I resolve this problem. I can't believe that the CF can do send complext data to Net webservice (restfull).


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>