Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Custom Data Type conversion

former_member583013
Active Contributor
0 Kudos

Hi everyone...My name is Blag...and I got an ActionScript problem -:(

So...I created a WebService based on a Z Function Module...To gather data from table SPFLI.

Inside Flex 3 I used the Wizard to create the WSDL classes. Everything works fine, except for one thing...My FM got two parameters CARRID_LOW and CARRID_HIGH both referencing SPFLI-CARRID which is CHAR 03...So Flex got the brilliant idea of declare those fields as CHAR03.

So when I do...

webService.ZGetSpfli(txtCarridLow.text,txtCarridHigh.text);

I receive an error message telling me that I must use CHAR03 data type...So of course I tried with...

webService.ZGetSpfli(CHAR03(txtCarridLow.text),CHAR03(txtCarridHigh.text));

Which of course doesn't work either because the compiler tells me that the implicit conversion from String to CHAR03 can't be done...

I checked the CHAR03 class...And guess what? Obviously, it's just a String...But I can't pass a String to the operation...

So...What can I do? Please don't tell me to modify the Classes, because I'm using the Wizard for a particular reason...I already did the same example using MXML and ActionScript, but now I want to use all the capabilities provided by the Wizard.

Hope someone can help me -:)

Greetings,

Blag.

1 ACCEPTED SOLUTION

former_member10945
Contributor
0 Kudos

Not sure if we've announced this or not yet, but I've seen some internal demos of a totally new generator system for creating classes from Web Services in Flex Builder. I don't know if anyone is testing them against more complex web services like these but I will check with our SAP liaison team and see if they can get an early build.

I know that you're trying to use the generator to complete a survey of the technologies but in practice as you're finding it does more harm then good.

Incidentally, the internal mechanism actually uses an Apache project if memory serves called, Velocity which is probably the root of the issue. Any-ho, as with all things maybe next version.

-d

5 REPLIES 5

GrahamRobbo
Active Contributor
0 Kudos

Hi Blag,

touches on this problem. Just jump to the end of the thread where I summarise the issue.

You will note that I logged a bug with Adobe. I have heard nothing from them about this and searching on their support site I can't even find my original post.

Cheers

Graham Robbo

former_member10945
Contributor
0 Kudos

Not sure if we've announced this or not yet, but I've seen some internal demos of a totally new generator system for creating classes from Web Services in Flex Builder. I don't know if anyone is testing them against more complex web services like these but I will check with our SAP liaison team and see if they can get an early build.

I know that you're trying to use the generator to complete a survey of the technologies but in practice as you're finding it does more harm then good.

Incidentally, the internal mechanism actually uses an Apache project if memory serves called, Velocity which is probably the root of the issue. Any-ho, as with all things maybe next version.

-d

0 Kudos

I know that you're trying to use the generator to complete a survey of the technologies but in practice as you're finding it does more harm then good.

A survey about technologies? Really...Silly me...I thought I was doing a Flex Crash Course for my company...Wait...That's exactly what I'm doing -:)

Incidentally, the internal mechanism actually uses an Apache project if memory serves called, Velocity which is probably the root of the issue. Any-ho, as with all things maybe next version.

Yeah...I notice that it was using Apache...

So...It seems that the best solution for me would be to fix the FM to use a String instead of SPFLI-CARRID, rebuild the WebService and call the generator again...

Thanks @Graham and @Dan...You guys are always ready to rescue! -:D

Greetings,

Blag.

0 Kudos

Hi, did you get a solution to this issue yet. I also generated web service stub through Flex and it created char3 char1 decimal50 etc classes. They are all string in the class definition. I did something like below to assign the value.

public function char1(content:String):Char1 {

var cont:Char1 = new Char1();

cont.char1=content;

return cont;

}

When I call the service it gives me the below error.

TypeError: Error #1009: Cannot access a property or method of a null object reference.

at org.gsm1900::Char1/toString()[C:\Documents and Settings\...................

I cant change the FM as it as too many such variables and its a complex FM. Any idea how to deal with this?

0 Kudos

Nitin:

Well....I actually changed my FM -:( So didn't look for any other options...maybe the best would be to change the generated AS classes...not aware of any other solutions than plain AS (written by yourself)...

Greetings,

Blag.