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

Data Structure

New Here ,
Jan 24, 2008 Jan 24, 2008

Copy link to clipboard

Copied

I need to creat a data structure to pass into a wsdl function. Three of the 5 fields needs to be set to null, Can some one please help. This is what I have so far. The problem is I tried to set it to "", but when I do that the running it cfmx will give me an error of "String index out of range: 0 ". if I set the variables to " "(With a space in between) the function works, but does not recognize it as a null value on it's end

<CFSET Profile = structNew()>
<CFSET Profile.Userid = "Username" />
<CFSET Profile.Password = "Password" />
<CFSET Profile.BatchID = " " />
<CFSET Profile.SessionID = " " />
<CFSET Profile.ErrorCode = " " />
TOPICS
Advanced techniques

Views

438

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
Guest
Jan 24, 2008 Jan 24, 2008

Copy link to clipboard

Copied

do you have any control over the WSDL method itself? if so, that'd be a better place to look at converting an empty string to a NULL value on the insert (assuming it's doing a SQL insert).

or maybe something like this:
http://www.petefreitag.com/item/524.cfm ?

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 ,
Jan 25, 2008 Jan 25, 2008

Copy link to clipboard

Copied

Hey CJ,

Thanks for the reply. I'm at a stand still at the moment. I'm still learning WSDL while doing this project. I'm not doing any database query or store at this point. I don't have control over the wsdl method. It's from a thrid party vendor. Here's the WSDL link not sure if you can see anything I could possible leave out. I've googled for how to set a variable to null and it looks like you can not do it in coldfusion MX. Is that true?

Here's the wsdl link http://voyager3.expedata.net/ExpeData_DAWS/DAWS.asmx?WSDL

Jimmy

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
Guest
Jan 25, 2008 Jan 25, 2008

Copy link to clipboard

Copied

the link to pete freitag's site in my previous post suggests some workarounds for setting/sending NULL values.

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 ,
Jan 25, 2008 Jan 25, 2008

Copy link to clipboard

Copied

Yeah I did look at the example and tried to do something similar, but it did not work. I also tried to do it where I created my datastructure from a sql query of null values. Seems to working fine, but when tryingto connect to the api from the wsdl it fails. I think there's is no way around this problem as the connect portion is rejecting.

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
Guest
Jan 25, 2008 Jan 25, 2008

Copy link to clipboard

Copied

if you did your query in CF, it will convert the null values to empty strings.

pete's blog entry explains how to preserve the null. if pete's entry didn't do it, google for ColdFusion null. there has to be some way to javacast() the null to a true null.

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 ,
Jan 25, 2008 Jan 25, 2008

Copy link to clipboard

Copied

LATEST
Will Do. I've been googling for it the past few days and came up short. I've posted this on a few forums and hopefully someone know how.

Jimmy

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