Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

how to request service with complexType

Avatar

Level 1

I implement service with Flex like:

<mx:WebService

wsdl="http://idme.identita.com:8080/andromeda/service/ws?wsdl" id="testService" showBusyCursor="true

"

useProxy="

false">

<mx:operation name="process" result="resultHanlder(event);">

<mx:request>

<TokenDisplayAuthenticationRequest>

<otp> {otp.text}

</otp>

<serialNumber> {serial.text}

</serialNumber>

</TokenDisplayAuthenticationRequest>

</mx:request>

</mx:operation>

</mx:WebService>

Our web service only one operation "process", but there are a lot of request & response. But it did not work, can some help me to check what problem in this code?

Thanks,

Java code with CXF like:

private static final QName SERVICE_NAME = new QName("http://www.identita.com/andromeda/services", "AndromedaService");
private static final String WEB_URL="http://idme.identita.com:8080/andromeda/service/ws?wsdl" ;

AndromedaService ss = new AndromedaService(wsdlURL, SERVICE_NAME);

Andromeda port = ss.getAndromedaPort();

TokenDisplayAuthenticationRequest authenticationRequest = new TokenDisplayAuthenticationRequest();

authenticationRequest.setSerialNumber(serial);
  authenticationRequest.setOtp(otp);
   TokenDisplayAuthenticationResponse _process__return = (TokenDisplayAuthenticationResponse)port.process(authenticationRequest);

10 Replies

Avatar

Level 3

What is the problem with your WS, does the call raise an error? Or your

result comes empty?

Avatar

Level 1

Very thank you for your reply, I just using Flex web service, and also not familiar with service, please take look at for me?

The fault message like:

[FaultEvent fault=[RPC Fault faultString="Required parameter 'androRequest' not found in input arguments." faultCode="EncodingError" faultDetail="null"] messageId=null type="fault" bubbles=false cancelable=true eventPhase=2]

Web service URL:

http://idme.identita.com:8080/andromeda/service/ws?wsdl

Full Flex client code:

<mx:Application

xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"

>

<mx:Script>

<![CDATA[

import

mx.rpc.events.FaultEvent;

import

mx.rpc.events.ResultEvent;

import

mx.controls.Alert;

private function resultHanlder(e:ResultEvent):void

{

Alert.show(

'resultHanlder'

);

msg.text=e.result.toString();

}

private function falutHanlder(e:FaultEvent):void

{

//Alert.show('falutHanlder');

//msg.text=e.message.toString();

msg.text=

""

+ e;

}

]]>

</mx:Script>

<mx:WebService wsdl="http://idme.identita.com:8080/andromeda/service/ws?wsdl" id="testService

"

fault="falutHanlder(event)" showBusyCursor="

true" useProxy="false">

<mx:operation name="process" result="resultHanlder(event);">

<mx:request>

<TokenDisplayAuthenticationRequest>

<otp> {otp.text}

</otp>

<serialNumber> {serial.text}

</serialNumber>

</TokenDisplayAuthenticationRequest>

</mx:request>

</mx:operation>

</mx:WebService>

<mx:TextArea id="msg" height="400" width="500"/>

<mx:TextInput id="otp"/>

<mx:TextInput id="serial"/>

<mx:Button label="sendMsg" click="testService.process.send();"/>

</mx:Application>

Avatar

Level 3

The error states that you're not properly sending the parameters in your request; I cannot communicate with the remote server due to the security sandbox but I tried using the import web service and this is the code that I used to call to that service.

<ws:AndromedaService id="myService">
          <ws:process_request_var>
               <ws:Process_request>
                    <ws:andromedaRequest>
                         <ws:TokenDisplayAuthenticationRequest>
                              <ws:otp>{otp}</ws:otp>
                              <ws:serialNumber>{serial}</ws:serialNumber>
                         </ws:TokenDisplayAuthenticationRequest>
                    </ws:andromedaRequest>
               </ws:Process_request>
          </ws:process_request_var>
     </ws:AndromedaService>

Hope this helps.

Avatar

Level 1

Hi Machael, thank you for your help. code still some error:

[FaultEvent fault=[RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032"]. URL: http://idme.identita.com:8080/andromeda/service/ws"] messageId=null type="fault" bubbles=true cancelable=true eventPhase=2]

Implement like:

<ws:AndromedaService

id="myService" fault="falutHanlder(event)">

     <ws:process_request_var>

          <ws:Process_request>    

               <ws:andromedaRequest>

                    <ws:TokenDisplayAuthenticationRequest>

                         <ws:otp>{otp}</ws:otp>

                         <ws:serialNumber>{serial}</ws:serialNumber>

                    </ws:TokenDisplayAuthenticationRequest>

          </ws:andromedaRequest>

      </ws:Process_request>

   </ws:process_request_var>

</ws:AndromedaService>

<mx:TextArea id="msg" height="400" width="500" text="{myService.process_lastResult}" />

<mx:TextInput id="otp"/>

<mx:TextInput id="serial"/>

<mx:Button label="sendMsg" click="myService.process_send();"/>

Avatar

Level 3

Try debuggin' the ws using IE, flash player 10, and the SDK 3.2 there was a

limitation regading reading soap faults, but using the last combination you

could read more about your error, accoding to Adobe.

Avatar

Level 1

Hi Michael,

Here is SOAP request  I capture:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
  <andromedaRequest xmlns="
http://www.identita.com/andromeda/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="IdentityDisplayAuthenticationRequest" versionMinor="0" versionMajor="0" id="req_id">
   <identity>sramadan</identity>
   <otp>123456</otp>
  </andromedaRequest>
</soap:Body>
</soap:Envelope>

How to modify my request using Flex service?

Thanks,

Quinten

<mx:WebService wsdl="http://idme.identita.com:8080/andromeda/service/ws?wsdl" id="testService" fault="falutHanlder(event)" showBusyCursor="true" useProxy="false">
     <mx:operation name="process" result="resultHanlder(event);">
     <mx:request>
          <TokenDisplayAuthenticationRequest>
               <otp> {otp.text} </otp>
               <serialNumber> {serial.text} </serialNumber>
          </TokenDisplayAuthenticationRequest>
     </mx:request>
     </mx:operation>
</mx:WebService>

Avatar

Former Community Member

HI,

How to get the ws request in debug mode. I want to see the same complete request xml.

Pls help on this.

Avatar

Former Community Member

Hi

You can enable debug level logging on the Proxy service via the logging config. http://help.adobe.com/en_US/LiveCycleDataServicesES/3.1/Developing/WSc3ff6d0ea77859461172e0811f00f70...

The relevant category is Service.HTTP

Regards,

Ashish Vashisht

Avatar

Former Community Member

Hi Ashish,

I need to see the web service - request xml from flex side, before going to server. I have enabled debug mode and almost checked the avail properties of the webservice instance, but not able to see the request xml.

Any idea ?

Avatar

Former Community Member

Hi

One option is, you can temporarily switch to a non-RTMP channel and use Charles or another proxy to have a look at the AMF request.

Regards,

Ashish Vashisht