From: NK4 on
Hi,
I'm trying to invoke a webservice as follows:

<cfinvoke webservice="BWf" method="postExternalEvent"
returnvariable="retValue">
<cfinvokeargument name="authentication" omit="yes" />
<cfinvokeargument name="eventName" value="NKSTUDENT_TRANSFER" />
<cfinvokeargument name="ProductType" value="Web Services Example" />
<cfinvokeargument name="externalSource" value="Acme University" />
<cfinvokeargument name="externalID" omit="yes" />
<cfinvokeargument name="externalDate" omit="yes" />
<cfinvokeargument name="workflowName" value="Student Review (CF Post Event
Demo)" />
<cfinvokeargument name="parameter" value=[b]parmArr[/b] />
</cfinvoke>
Here is the name-value array definition: (Ofcourse the definition is before
invoking the webservice itself)

<cfset parmArr = ArrayNew(1)>
<cfset parmArr[1] = StructNew()>
<cfset parmArr[1].name="name">
<cfset parmArr[1].stringValue="Nayyar Khan">
<cfset parmArr[2] = StructNew()>
<cfset parmArr[2].name="credits">
<cfset parmArr[2].numericValue="36">
<cfset parmArr[3] = StructNew()>
<cfset parmArr[3].name="matriculated">
<cfset parmArr[3].booleanValue="true">
<cfset parmArr[4] = StructNew()>
<cfset parmArr[4].name="date_of_birth">
<cfset parmArr[4].dateValue="23-Dec-2000">
<cfset parmArr[5] = StructNew()>
<cfset parmArr[5].name="transfer_from">
<cfset parmArr[5].stringValue="OU">

However, not quite sure how an array of name-value pairs be sent, especially
when the XML format expected is as follows:

<xsd:complexType name="PostExternalEventRequest">
<xsd:sequence>
<xsd:element name="authentication"
type="messages:Authentication"/>
<xsd:element name="eventName" type="xsd:string"/>
<xsd:element name="productTypeName" type="xsd:string"/>
<xsd:element name="externalSource" type="xsd:string"/>
<xsd:element name="externalID" type="xsd:string"/>
<xsd:element name="externalDate" type="xsd:dateTime"/>
<xsd:element name="workflowName" type="xsd:string" minOccurs="0"/>
<xsd:element name="parameter"
type="messages:[b]NameParameterValuePair[/b]" minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>

[b] <xsd:complexType name="NameParameterValuePair">[/b]
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:choice minOccurs="0" maxOccurs="1">
<xsd:element name="stringValue" type="xsd:string"/>
<xsd:element name="booleanValue" type="xsd:boolean"/>
<xsd:element name="dateValue" type="xsd:dateTime"/>
<xsd:element name="numericValue"
type="messages:NumericValue"/>
</xsd:choice>
</xsd:sequence>
</xsd:complexType>

Any Help is really appreciated.
regards,
NK


 | 
Pages: 1
Prev: Complex Component
Next: cfgrid cfgridupdate