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?
Similar Messages
-
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? -
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 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 Webservicer using Visuval composure Ce 7.1 server
Hi ,
We are created in ABAP , they r exposed in WSDL , if i have to call That web services using visuval composure please ASAP can u send , how to call WSDL In CE 7.1 Serve
Thnks & Regards,
SureshHi
you can try this links:
http://help.sap.com/saphelp_nwce10/helpdata/en/9f/9985f72084483cb316a3c2322fb090/content.htm
(here look for the therm Creating Web Service Physical Destinations that points to :
http://help.sap.com/saphelp_nwce10/helpdata/en/45/635dd614d73bdbe10000000a1553f7/content.htm
best regards,
v s
Edited by: v s on Dec 4, 2008 12:22 PM -
How to call webservices using soap in xi
Hello
I am tring to work on webserivces,bascially i am not having any knowledge on webservices,i have seen the documentation & i know how to configure soap adapter & how to define webservice in integration directory.can any one please help me out how to work with webservices & good documentation on webservices & soap.
Thanks
RajeshHi Rajesh,
Use server(tomcat server) or plain html coding for defining webservices....
check sample webservice coding
Purchase Order Web Application
dispDate(0)
Purchase Order Input Parameters:
Document Type:
Standard PO
Vendor Number:
Purchase Order Date:
Purchasing Material:
Delivery Date:
Quantity:
NetPrice:
Unit of Measurement:
PCs
PriceUnit:
Results:
/code
And gothrough the following weblogs which will be useful...
/people/siva.maranani/blog/2005/03/01/testing-xi-exposed-web-services
/people/thomas.jung3/blog/2005/06/05/web-services-the-case-of-the-missing-soap-action-header
/people/siva.maranani/blog/2005/09/03/invoke-webservices-using-sapxi
Hope u get some idea...
Regards,
Sridhar
Message was edited by: sridhar reddy kondam -
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"/> -
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. -
Hello,
i am trying to call webservice.i tryed following code for calling webservices via actionscript.it is givind the response.but it is not giving correct response.
is this correct way to call webservice?is there other way to call webservice?can anybody tell me,how to call webservice?
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”vertical” width=”420″ height=”380″ xmlns:net=”flash.net.*”>
<mx:Script><![CDATA[
import mx.rpc.soap.LoadEvent;
import mx.rpc.AbstractOperation;
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.soap.Operation;
import mx.rpc.soap.WebService;
private var serviceURL:String = "http://localhost:7080/icon-ws/services";
private var wsdlURL:String = "http://localhost:7080/icon-ws/bulkUpload.wsdl";
private function callWS():void {
var service:WebService = new WebService(serviceURL, serviceURL);
service.wsdl = wsdlURL;
service.loadWSDL();
var oper:Operation = service.getOperation("BulkUpload") as Operation;
oper.addEventListener("result", resultHandler);
oper.addEventListener("fault", faultHandler);
oper.send();
public function resultHandler(event:ResultEvent):void {
Alert.show("Result returned"+ event.result.toString());
public function faultHandler(event:FaultEvent):void {
Alert.show("fault: "+ event.toString());
]]></mx:Script>
<mx:Button id=”selectBut” label=”CALL webservice” click=”callWS()”/>
</mx:Application>sorry for my english. I expect you understand me...
I do that extended sp
Code Block
use atdb_main_test
Declare @Object as Int;
Declare @ResponseText as Varchar(8000);
DECLARE @login VARCHAR(50);
DECLARE @user_passwd VARCHAR(50)
Exec master..sp_OACreate 'MSXML2.XMLHTTP', @Object OUT;
Exec master..sp_OAMethod @Object, 'open', NULL, 'get', 'http://172.xx.xx.xx:wwww/account.asmx?op=CreateEquipementMacAddress', 'false'
EXEC master..sp_OASetProperty @Object, 'user_login', @login
EXEC master..sp_OASetProperty @Object, 'user_passwd', @user_passwd
EXEC master..sp_OASetProperty @Object, 'p_nb_poste', 1
EXEC master..sp_OASetProperty @Object, 'p_id_site', 91400
EXEC master..sp_OASetProperty @Object, 'p_id_type_poste', 83
EXEC master..sp_OASetProperty @Object, 'p_adresse_mac', null
EXEC master..sp_OASetProperty @Object, 'p_num_serie', null
EXEC master..sp_OASetProperty @Object, 'login', null
EXEC master..sp_OASetProperty @Object, 'passwd', null
EXEC master..sp_OASetProperty @Object, 'default_gateway', null
EXEC master..sp_OASetProperty @Object, 'ip', null
EXEC master..sp_OASetProperty @Object, 'bCreateIPPhone', 'false'
EXEC master..sp_OASetProperty @Object, 'vlanId', 0
Exec master..sp_OAMethod @Object, 'send'
Exec master..sp_OAMethod @Object, 'responseText', @ResponseText OUTPUT
Select @ResponseText as ResponseText
Exec master..sp_OADestroy @Object
I use a SQL server 2000 and don't do anything else.
But it doesn't work
I don't know what to do ...
the message is (1 row affected) but no tupple is written in my db...
can you help me please ? -
How to call webservices in visuval composure CE 7.1 server
Hi ,
How to call webservices in visuval composure CE 7.1 server (WSDL) , please send step by step process
Thanks & Regards,
SureshI have exactly the same problem.
Here is what I found out:
In the browser based VC you have to use the Destination Template Managemet from NWA. The destinations are found during design time and can be called during runtime.
The NWDS version seems to work differently. You cannot see the destinations you created in NWA. Instead there is a preferences setting (Destination configuration). Here you can define the destination using WSDLs.
This works during design time.
But during runtime the call throws an error like 'Destination not found'. To me, it seems like a bug.
Does anybody have an idea how to solve this?
Thanks,
Michael -
How to call serlvet using ftp protocal
Hai,
How to call servlet using ftp protocal . if any one having please send that program . because generic servlet will receive any protocal request .The basics are to have your Server listen to port 21.
You would then have to parse the request information to determine what is being asked for and generate an appropriate response. -
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 -
Related documents or links on how to call webservices from WDJ
Hi all
i need documents & links on how to call webservices from Webdynpro for Java.
if anybody send the documents on sample scenarios on the same then it is the great help to me...
Thanks
SunilHi Sunil,
May these links help you.
http://help.sap.com/saphelp_nw04/helpdata/en/f7/f289c67c759a41b570890c62a03519/frameset.htm
http://help.sap.com/saphelp_nwce10/helpdata/en/64/0e0ffd314e44a593ec8b885a753d30/frameset.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/d2/0357425e060d53e10000000a155106/frameset.htm
and the below thread to call weservices in java.
Re: How to call a web service from Java
Regards,
Supraja -
How to call webservices in as3 (flash) and get its response
Hello
I need to know how to call webservices in flash cs5 as3 and how to track its response. any example ?
Thanks
Avneethttp://www.thetechlabs.com/tech-tutorials/xml/creating-a-as3-web-service-package-base-serv ice-class-and-simple-twitter-api/
-
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
Maybe you are looking for
-
Hi all, This is the error msg i'm getting when trying to activate the extract structure for FI-SL. Did anybody come across it? And how to unhide the HSL,ASL etc fields .. four of my fields got locked and i have no clue what made it hide. these were t
-
How to place tif file through a script in an indesign document?
how to place tif file through a script in an indesign document?
-
Iphoto (version 9.5.1) crashes when I try to export photos.
Process: iPhoto [902] Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto Identifier: com.apple.iPhoto Version: 9.5.1 (902.17) Build Info: iPhotoProject-902017000000000~3 App Item ID: 408981381 App External I
-
We are using adobe production premium cs6, this being used on Mac pro, lion os 10.7.4 with matrox mx02 max card. We facing a Video flicker issue on clips captured using VTR or clips taken as data to adobe premiere? Please advise how we can overcome t
-
Mic troubles - Toshiba Portege M600
Hi My inbuilt mic was working all these but stopped working suddenly. - Freshly installed the new realtek audio drivers from Toshiba website. No luck. I cannot use googletalk, skype, MSN chat for my conferences. The mic is not detected when I try t