Calling WebServices using Flex Builder
Hello,
I want to use a WebService in the Flex Builder. I first defined the WebService:
<mx:WebService id="test" wsdl="http://ld9030.wdf.sap.corp:50050/sap/bc/srt/rfc/sap/ZTP_TEST4?wsdl" result="log(event)" showBusyCursor="true">
I have 2 importing parameters in the WebService (IText and IText2).
But in the log-method, I cannot access these parameters:
private function log(event:ResultEvent):void {
var test1 = event.result.IText;
Do you know, how I can access the import parameters?
Please find attached the wsdl definition.
Thanks,
Thomas
<?xml version="1.0" encoding="utf-8" ?>
- <wsdl:definitions targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:sap-com:document:sap:soap:functions:mc-style" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <wsdl:types>
- <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:sap-com:document:sap:soap:functions:mc-style" targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style" elementFormDefault="unqualified" attributeFormDefault="qualified">
- <xsd:element name="TpTest">
- <xsd:complexType>
- <xsd:sequence>
<xsd:element name="IFlag" type="xsd:string" />
<xsd:element name="IFlag2" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
- <xsd:element name="TpTestResponse">
- <xsd:complexType>
- <xsd:sequence>
<xsd:element name="EText" type="xsd:string" />
<xsd:element name="EText2" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
- <wsdl:message name="TpTest">
<wsdl:part name="parameters" element="tns:TpTest" />
</wsdl:message>
- <wsdl:message name="TpTestResponse">
<wsdl:part name="parameters" element="tns:TpTestResponse" />
</wsdl:message>
- <wsdl:portType name="ZTP_TEST4">
- <wsdl:operation name="TpTest">
<wsdl:input message="tns:TpTest" />
<wsdl:output message="tns:TpTestResponse" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="ZTP_TEST4SoapBinding" type="tns:ZTP_TEST4">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="TpTest">
<soap:operation soapAction="" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="ZTP_TEST4Service">
- <wsdl:port name="ZTP_TEST4SoapBinding" binding="tns:ZTP_TEST4SoapBinding">
<soap:address location="http://us4419.wdf.sap.corp:50050/sap/bc/srt/rfc/sap/ZTP_TEST4?sap-client=000" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
You can try putting the URL in a var as the next example:
private var wsdl:String = "http://sapbdo5.bdo-argentina.com:8002/sap/bc/srt/rfc/sap/ZVER_TABLA?wsdl=1.1";
private var wsdl2:String = "http://sapbdo5.bdo-argentina.com:8002/sap/bc/srt/rfc/sap/ZVER_TABLA?sap-client=600&wsdl=1.1";
[Bindable] private var datos:ArrayCollection;
private function retrieve_data():void{
//ws.loadWSDL(wsdl);
ws.loadWSDL(wsdl2);
ws.ZVER_TABLA(txt.text);
private function handleError(ev:Event):void{
Alert.show("Se produjo un error");
private function handleResult(ev:ResultEvent):void{
datos = ev.result.DATA;
]]>
</mx:Script>
<mx:WebService id="ws" showBusyCursor="true" makeObjectsBindable="true">
<mx:operation name="ZVER_TABLA" fault="handleError(event)"
result="handleResult(event)"/>
</mx:WebService>
<mx:TextInput id="txt" enter="retrieve_data()" x="10" y="10"/>
<mx:Button label="Ver datos" click="retrieve_data()" x="178" y="10"/>
<mx:DataGrid id="dtGrid" horizontalScrollPolicy="auto" dataProvider=""
verticalScrollPolicy="auto" right="10" bottom="10" top="40" left="10"
visible="false"/>
Similar Messages
-
How to call webservice using flex?
Hello,
i want to call webservice in flex.i tryied following code.but it is not giving correct response.what is wrong with this code?
can anybody tell me ,how to call webservice in flex?
Code:
<mx:Script>
<![CDATA[
public function button1_clickHandler(event):void
ws.returnRecord(para1,para2);//i am sending two parameter to returnRecord service here
public function remotingCFCHandler(event:ResultEvent):void
trace(event.result);
]]>
</mx:Script>
<mx:WebService
id="ws"
wsdl="http://localhost:8500/flexapp/returnusers.cfc?wsdl">
<mx:operation name="returnRecords" resultFormat="object"
fault="mx.controls.Alert.show(event.fault.faultString)"
result="remotingCFCHandler(event)"/>
<mx:Button label="Go" fontWeight="bold" click="button1_clickHandler(event)"/>Hello sir,
i got following reply:
<returnRecordResponse xmlns="http://xyz" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<returnResult>Error_request</returnResult>
</returnRecordResponse>
but correct response is
<returnRecordResponse xmlns="http://xyz" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<returnResult>Success</returnResult>
</returnRecordResponse>
can you tell me correction in the code which i have put on the forum?or tell me other way to call webservice? -
Problem in calling webservice using https from livecycle designer
I want to call a webservice written in .net(c#) using https from livecycle designer.I can call webservice using http ,but when i try with https it is failing.If there any special configuration have to do in server for this ?I have already put crossdomain in server.
Waiting for your reply
thank'sHow did you call from LC? Please help me out either one is fine to me http or https
Srujan -
Calling webservice from Flex?
Hi,
I get the error when I call webservice from Flex.Can you tell
me why this happen?
Thanks
Mark
[RPC Fault faultString="Security error accessing url"
faultCode="Channel.Security.Error" faultDetail="Destination:
DefaultHTTP"]
at mx.rpc::AbstractInvoker/
http://www.adobe.com/2006/flex/mx/internal::faultHandler()
at mx.rpc::Responder/fault()
at mx.rpc::AsyncRequest/fault()
at DirectHTTPMessageResponder/securityErrorHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/redirectEvent()I think this means that the source of the web service does
not have a crossdomain.xml file on it allowing access from your
site. Try adding one to the root of the server and see if that
fixes the problem.
hth,
matt horn
flex docs -
How to add interface to customlize MXML Component when use Flex Builder 3?
How to add interface to customlize MXML Component when use
Flex Builder 3?David,
I don't believe you can add the interface via the creation
dialog in FlexBuilder 3. You can always manually add the
"implements" property to your MXML Component root tag. Something
like this: <mx:VBox implements="com.mycorp.IMyInterface">
If you want autogeneration of the interface, then create an
ActionScript class with that interface and then copy the generated
functions and setter/getters into the script block of your MXML
component. -
How to show busy cursor when call webservice using as?
I want to call webservice using script,but i don't know how
to show busy cursor.please help meShow busy cursor:
>>>
CursorManager.setBusyCursor();
<<<
and hide it:
>>>
CursorManager.removeBusyCursor();
<<<
Don't forget to catch all events of the web-service to
securely remove the busy cursor. Especially, you might wish to
handle events of the 'results received' and the 'faults appeared'
logical results. -
Difficulties using Flex Builder plugin version
The strangest thing just happened. I want to look into Zend, so after reading a bit on the web I decided to uninstall Flex Builder 3 standalone version and install Eclipse 3.4 and then install the plugin version of Flex Builder 3.
But after I installed when I click on the Run button I get an error message:
'Launching cmd' has encountered a problem.
Variable references non-existant resource :
${workspace_loc:/Misc/src}
I assume this is because users need prior experience with using Eclipse, but I don't understand why the Adobe plugin version of Flex Builder cannot be such that it just works out of the box.
I have to say I am blown away by this and will immediately uninstall the plug-in version and re-install the standalone.
Any hints on what went wrong? I may try this again sometime but I want to get some work done tonight and I don't have time for this. Really amazed.Hi Greg,
I am using the Flex Builder plug-in and I don't remember ever running over this. You said that you have uninstalled Flex Builder before installing Eclipse. I'm not sure ( this is only a guess ) but what if certain setting that you had in Flex Builder remained on your system ( like the path to your workspace that I think got deleted when you uninstalled it ) and when you installed Eclipse, then it was trying to access the information previously stored by Flex Builder.
I'm not sure if that's what the Error says but you might want to check if you workspace still exists and if it does, then does it contain a folder called "Misk/src". I really don't remember running over this error, the Plug-in worked just fine for me.
With best regards,
Barna Biro -
How to call webservice using standalone application
Hi,
Actually i am trying to connect with one free webservice using client. but i am uanble to get the result and it is throwing the Exception.Exception is Execution failed. Exception: java.net.ConnectException: Connection timed out: connection reset
i am using the following code.
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.utils.Options;
import javax.xml.namespace.QName;
import java.io.*;
public class AddFunctionClient {
public static void main(String [] args) {
try {
String endpoint = "http://www.startvbdotnet.com/web/sample2.asmx?wsdl";
System.setProperty("http.proxyHost", proxyHost);
System.setProperty("http.proxyPort", portNumber);
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName(endpoint, "add"));
System.out.println("connected");
System.out.println("value is"+call.invoke(new Object[]{new Integer(10),new Integer(20)}));
} catch (Exception e) {
System.err.println("Execution failed. Exception: " + e);
can any one help on thisHi,
If your JAVA Application is Web based application, you can expose it as Webservice.
JAVA People will pick the data from Dbase using their application and will send the data to XI by using our XI Details like Message Interface and Data type structure and all.
So we can Use SOAP Adapter or HTTP in XI..
If you use HTTP for sending the data to XI means there is no need of Adapter also. why because HTTP sits on ABAP Stack and can directly communicate with the XI Integration Server Directly
If you are dealing with the Webservice and SAP Applications means check this
Walkthrough - SOAP XI RFC/BAPI
REgards
Seshagiri -
How to call webservice using java client
Hi,
I am new to webservice related stuff.Can any body help me.
How can i call the webservice using simple java programing using jdeveloper tool is very useful for me.
Thanks
venujuser10394151 wrote:
Hi,
I am new to webservice related stuff.Can any body help me.
How can i call the webservice using simple java programing using jdeveloper tool is very useful for me.
Thanks
venujTry this simple webservice client.
You will need apache-axis.jar in your classpath. The following client is apache axis based. A similiar client can be built also using the JAX-WS only[without apache-axis.jar].
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;
public class WEBSERVICE_CLIENT{
public static void main(String [] args) {
try {
String endpoint ="<YOUR WS ENDPOINT>";
Service service = new Service();
Call call = (Call) service.createCall();
// YOU CAN SET VARIOUS PROPERTIES IN THE "CALL" OBJECT...LIKE
// USERNAME,PASSWORD,PROPERTIES OF HTTP HEADER. SEE "CALL" OBJECT'S API FOR MORE PROPERTIES.
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("<YOUR WS SERVICE NAMESPACE>", "<WS SERVICE TO BE INVOKED>"));
String msg = (String) call.invoke( new Object[] { "data" } );
System.out.println("RETURNED MESSAGE : "+msg);
} catch (Exception e) {
System.err.println(e.toString());
} -
How to call webservice using jdev9i
Hi gurus and experts,
i need to consume a webservice using oaf. with great effort finally i created stub using axis s/w.
now i dont know how to use the stub in jdev.where to write the code and what to write.iam strucked :-( .
since there were no sample tutorial about how to call webservice from jdev9i, iam struggling to make.iam jus a starter.
and while googling i came to know that stubs can be created using jdev9i .but when i see new-->webservices--web service stub it is greyed out.
i have 2 questions now:
1)if stub created using axis can it be used in jdev9i? if yes ,please tell me how? any tutorial links also helps me.
2)if the stubs should be created only by jdev9i so that webservices can be called using jdev,then please guide me how to make it.
i need some helping hands from u guys.
Thanks a lot
Edited by: 881533 on Oct 25, 2011 2:34 AM
Edited by: 881533 on Oct 25, 2011 2:37 AMHello sir,
i got following reply:
<returnRecordResponse xmlns="http://xyz" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<returnResult>Error_request</returnResult>
</returnRecordResponse>
but correct response is
<returnRecordResponse xmlns="http://xyz" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<returnResult>Success</returnResult>
</returnRecordResponse>
can you tell me correction in the code which i have put on the forum?or tell me other way to call webservice? -
Where do the Datavisualization files go when not using Flex Builder?
My application has charting and I use the sdk and ant
directly, not flex builder. I know where those files are under FB
but where do I place the datavisualization swf, swc and swz files
in the sdk in order to have charting without flex builder?
Thanks!Hey lllaass,
Thanks for your response.
I basically got an email from a friend with a link to google drive, that link took me to drive n then there was a download bottom which popped when I clicked on the files icon, these are 3 audio files which are recorded on a computer n sent to me via drive..
I too think it opened directly from drive.. Let me know though if u do come across some solution.
Thanks -
Call Webservice using REST and not SOAP
Hi, I am looking for an example of calling (invoking) a webservice from the database using PLSQL. The webservice is using REST rather than SOAP and returning XML
I have already got examples of how to call a webservice using SOAP but not for REST
Regards
AshUsing Fiddler while loading your WSDL in a browser, I can see that the WSDL is using HTTP Chunked encoding. You should configure JBoss to return the WSDL without chunked encoding.
-
Calling webservice using Adobe lifecycle designer7.1
Hi,
I am trying to call a webservice which is running on my SAP Netwaeaver using Adobe designer 7.1 , I am not able to create new data connection.
I am able to call this webservice using simple webservice client but not with ALD7.1 that means my service is working fine.
Can any body tell me are there any specific settings are needed for this webservice.
Thanks in adv
SudheerHi Sudheer,
There exists no seperate configurations required.
1. providee URL or filepath.
2. Map th request and response fields.
3. Use the button generated to trigger the same.
Wats the error that you are getting.
You may first try using a simple service with a default login ID and password configured.
Hope this helps,
- anto. -
How to use Flex builder with blazeds and JBoss
Following the instructions it is pretty easy to set up a project to work with the turnkey tomcat. However, I am having problems with JBoss because the app has to be deployed as a .war file. I can create a war file manually and depoly it no problem. How do I get flex builder to deploy to a war file? I want to be able to debug in flex builder and run at the click of a button.
Hi,<br /> I am trying to configure BlazeDS with JBOSS Application Server.<br /> I have downloaded BlazeDS binary version - blazeds_bin_3-0-0-544.zip from Adobe. But in the installation steps, it says that copy blazeds.war, samples.war and console.war into <JBOSS_HOME>/server/default/deploy folder. But in this zip, it contains only blazeds.war file only. I have copied it to <JBOSS_HOME>/server/default/deploy folder.<br /><br />I have restarted JBoss. I didn't get any error. But when i give <br /> http://localhost:8080/blazeds ... i am always getting "Page not found 404" error.<br /><br />Please help me, if you have detailed steps to configure BlazeDS on JBoss.<br /><br />Thanks for your time.
-
Error while calling webservice in flex
Hi,
I have done one sample application like adding the 2 no. But
i dont know how to pass the parameter from webservice to flex. I
have attached my code here. Plz reply.Its showing the error as
Required parameter 'a' not found in input arguments."add this to get your reply from web service.
private function
configureListeners(dispatcher:IEventDispatcher):void {
// Override xml socket event listeners with custom functions
// Reference the XML Socket API for Event descritpions
xml_s.addEventListener(Event.CLOSE, onClose);
xml_s.addEventListener(Event.CONNECT, onConnect);
xml_s.addEventListener(DataEvent.DATA, onData);
xml_s.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
xml_s.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
onSecurityError);
// below is where you will receive your results from the web
service
public function onData(event:DataEvent):void
// do something with data
// i.e. indata.text = event.text;
Maybe you are looking for
-
Couldn't successfully install xcode-4.2.1 on my mac os x 10.7 macbook
My machine is a bit old (mid 2007) but the system was upgraded to mac os x 10.7. Today I tried 3 times of install xcode-4.2.1 from the appstore. All 3 times I got the same problem. The installation processes looked quite ok, but after the "Installati
-
GET_PRINT_DOCUMENT returns empty PDF
I'm attempting to use the GET_PRINT_DOCUMENT API to create a pdf report and store it in a table. However, the api always returns an empty BLOB. The test report for the Report Query, 'testSQL', runs fine. The 'After Submit' process is as follows: DECL
-
ExportAsFDF is not working properly on Acrobat Professional 8
Hi, I am working on Acrobat Professional 8 to export FDF using vb.net. FDF export by manually is working proper but from script its giving me below FDF file: %FDF-1.2 %âãÏÓ 1 0 obj <</FDF<</ID[<D112096744983A4F942778C9714C68BB><18355F3D06AAA94DA58E6A
-
Unable to import volumes in 10.3 webtool
When trying to import volumes in the webtool in 10.3 I receive this error. This worked in 10.2. Error: can't execute command - no drive specified for this session I know from using the command line that you should not have to choose a drive and
-
Hello Experts, Can anyone throw any light how to connect sap xi to a fax machine, like i get a details from the one system and then to xi and then fax the data, any ideas? Is it possible? Regards, Anirban.