cancel
Showing results for 
Search instead for 
Did you mean: 

Call a MII transaction in Flex by using webservice call

Former Member
0 Kudos

Hi folks,

I'm just trying to call a MII transaction that delivers a XML document in Flex via Actionscript. But how has the call to look like? It requires 3 input parameters (LoginName, LoginPassword and InputParams). But the called transaction has no input parameters and I don't find a way to set the parameters. Does anybody know that?

I already tried to embed it in the mxml-file, I tried to import the ws but nothing works. My calling statement looks like this:

griddata.xacute("Username","Password","");

But I always get the error message in the just-in-time-debugger "Id 1067: Implizite Umwandlung eines Werts des Typs String in einen nicht verwandten Typ generated.webservices:InputParams. .." - "implicit compilation of a value of the type string into a non-related type...."

Thanks,

Anika

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

In general, do not use web services to call MII transactions. It works much easier/better to use "RESTful" style services by invoking the "Runner" servlet. You can parse the resulting XML quite easily in Flex and databind it to almost any type of UI component.

Former Member
0 Kudos

Hi Rick,

thanks for your reply.

If I use the HTTPService, how has the url for the MII-transaction to look like? I have one input parameter (Vorgabe) and an XML output parameter. How do I call the transaction the right way? I tried it like this:

<mx:HTTPService useProxy="false" id="callTransaction" method="POST" showBusyCursor="true" url="http://server/XMII/Runner?Transaction=AD_Sandbox/FLEXtest/create" result="callTransactionResult(event)" fault="callTransactionFault(event)" >

<mx:request xmlns="">

<Vorgabe>Test</Vorgabe>

<XacuteLoginName>Username</XacuteLoginName>

<XacuteLoginPassword>Password</XacuteLoginPassword>

</mx:request>

</mx:HTTPService>

But that delivers only "[object Object]" when I try to put it into a textbox for checking the result.

According to the webservice issue:

I tried the webservice call from another client via VPN and I always got the same error like via the client in our network here: "SOAP Response cannot be decoded. Raw response: " - but, if I logged in to MII seperately and started a session by doing this, it worked and I got the right response. But if I logged off again, the error reoccured. Is it possible, that the webservice call did not create a correct MII session? I tried it this way:

<mx:WebService id="MyWebServiceCall" wsdl="http://server/XMII/WSDLGen/AD_Sandbox/FLEXtest/create" useProxy="false">

<mx:operation name="Xacute" resultFormat="xml" result="getXacute_result(event);" fault="getXacute_fault(event);">

<mx:request>

<parameters>

<XacuteRequest>

<LoginName>Username</LoginName>

<LoginPassword>Password</LoginPassword>

<InputParams>

<Vorgabe>test</Vorgabe>

</InputParams>

</XacuteRequest>

</parameters>

</mx:request>

</mx:operation>

</mx:WebService>

Former Member
0 Kudos

In the HTTPService, add the parameter format="e4x" or "format="xml", and it should work fine.

I prefer to use e4x format, then create an XMLListCollection that I can databind to, as in:

<mx:XMLListCollection id="data" source="{callTransaction.lastResult.Rowset.Row}"/>

Former Member
0 Kudos

see last post

Edited by: Anika Delzeit on Jul 13, 2009 1:17 PM

Former Member
0 Kudos

Hi Rick,

I just forgot to define <OutputParameter>resultXML</OutputParameter> for the output (I always received, that the transaction was executed successfully, but not my expected XML result). Now it works fine! Thanks!

Former Member
0 Kudos

Hi Rick,

although I'm able to fetch my data now (with Flex 3), I just want to ask you if you know, why the webservice call did not work? As I already explained, it worked from outside when a MII session was open and did not work when the session was closed. And it did not work from the inside of our network. But I asked someone else this question before and he executed my example on his system (with Flex 2.0.1) and it worked fine. So is it possible, that the Webservice call could'nt establish a working MII connection so that the error occured? Although it might work now with HTTPService calls, I would like to have it running also with webservice because it is an offered functionality and in some case we might to have to do it with webservice. So do you have any idea what the problem might be? Would be great.

Thanks

Anika

Edited by: Anika Delzeit on Jul 14, 2009 11:07 AM

Former Member
0 Kudos

Perhaps a "cross-domain.xml" file is needed (you can Google this) with the Web Service call. I'm not sure what specifically changed between Flex 2.0.1 and Flex 3.0.X. The other possibility is Flash Player 9 versus Flash Player 10.

Former Member
0 Kudos

Met the same problem, but resolved. Following is the solution.


    param = new Dictionary();
    var LoginName:String = 'LoginName';
    var LoginPassword:String = 'LoginPassword';
    param[LoginName] = 'username';
    param[LoginPassword] = 'password';
    queryCurrentTag.loadWSDL("http://localhost/data/TrnCarData.WSDL");
    queryCurrentTag.Xacute(param);

The WSDL should be copy to the folder which Flex can access, because the WSDL which generated by xMII also need user authentication.