Axis: passing arrays as parameters to webservices
Hi,
I'm using axis to setup a webservice.
In my client application, I need to pass an array of bytes to the webservice.
How would I set this up when creating my call?
Here is how I setup my calls:
call.removeAllParameters();
call.setOperationName("methodName");
call.addParameter("paramName1", XMLType.XSD_?, ParameterMode.IN);
call.setReturnType( XMLType.XSD_BOOLEAN );
Boolean ret = (Boolean) call.invoke(new Object[]{ bytes });
where 'bytes' is the array of bytes.
The question marks are where I don't know what to do.
Can anyone help me?
Try XMLType.SOAP_ARRAY (there is an example at this URL: http://www.bii.a-star.edu.sg/infoscience/seg/fileTransfer.asp)
Similar Messages
-
Passing array of parameters to constructor
I'm writing a script which facilitates interaction between javascript and an already existing flash library. One of the things I need to do is create an instance of class x, where class x can be one of a large number of classes. The constructors for these classes each take different numbers of parameters. I want to pass the parameters in from Javascript as an array, and I was hoping that there would be a way to pass the array contents into the constructor as parameters. I tried using apply, but it's not available on constructors.
The only other option I know of is to write a large case statement full of constructors, and for each parameter pass an integer indexed array element. Is there any other way?Your going to have to unpack your array no matter what, so no.
You can make your class factory with your huge case, or, if you have the source for your lib you could modify the constructor, but its the same amount of work:
Was:
public function MyClass(s:String, n:Number, d:Date){...}
To:
public function MyClass(s:*, n:Number=0, d:Date=nul){
<case code here>
If you have a decent platform, or even javascript, you could maybe think about writing a parser that will generate the class factory case based on the constructor signatures. -
Passing arrays as parameters to new pages?
I have probably either misunderstood something Murray said to
me, or
unconsciously extended it, but in developing my php driven
photo album I have
been working on the assumption that I could read a block of
data into an array,
and then pass that array (or a pointer to it?) as a parameter
to a new
invocation of the same page.
However, now that I tried it, it looks as if I can only pass
a single value in
any one parameter. Is this correct, or is there some way of
passing either an
array or a pointer to an array as a parameter?
Clancy"PeteC" <[email protected]> wrote:
>Create your array as a session variable.
Thanks. Yet another complexity to learn! For the moment I'll
put up with
rereading my data file every time I change pages. If (as it
currently appears)
this gives a good enough performance I wo'nt worry until I've
got the program
working. However there are still part of my job where session
variables would be
helpful, so when I've got the main part of my program working
I'll try to get my
head around them.
With best wishes,
Clancy -
Call stored procedure in JDBC passing Array parameters
Hi all,
Im trying to call an Oracle Stored Procedure with JDBC. The problem is
that my parameter is an Array (PL/SQL Type is "Table Of").
How can i call this procedure by passing right Java parameters to
the Callable statement ??
In the Documentation, all samples don't work ! it's possible to
call a procedure that return Array Type but when we need to pass an Array as
a parameter we have a DataType exception.
Any idea ?
thanx in advance
Sam.Hi Sam,
I don't have an answer to your question, just some suggestions as to
where else you may find help.
Do you know about the "Ask Tom" website:
http://asktom.oracle.com
Also, you may find something in the comp.databases.oracle.* newsgroups:
http://groups.google.com
I found this article there -- but it's not exactly what you're looking
for:
http://groups.google.com/groups?q=array+group:comp.databases.oracle.server+author:Thomas+author:Kyte&hl=iw&as_qdr=w&selm=a9sg06027kf%40drn.newsguy.com&rnum=1
Good Luck,
Avi. -
Passing Parameters to Webservice model context--Exception in execution
Hi
I have a problem while passing the values to the webservice model context.I have 9 input fields in my view 5 of them binded to directly to the model context after mapping. 4 input fields i have binded to seperate node of cardinality 1:1.
My structure is like this
Req_Identity_In(model root node)
Req_Ide_SYNC (Input node of model)
Identity( node )
UserAccount(node)
PersonalAddress(node)
PersonName(Node)
|
givenname,middlename,familyname etc (Attributes)
This structure is similar to bapi user create ECC Function module after exposing as a webservice.
I am using the following code for bindings
==================
String givenName = wdContext.currentPersonNamesDataElement().getGivenName();
String middleName = wdContext.currentPersonNamesDataElement().getMiddleName();
String familyName = wdContext.currentPersonNamesDataElement().getFamilyName();
String additionalFamName = wdContext.currentPersonNamesDataElement().getAdditionalFamilyName();
//getting the data from user for personNames
//passing the data
UserAccountCreateModel userAccountCreateModel = new UserAccountCreateModel();
Request_IdentityUserAccountCreateRequestConfirmation_In request_IdentityUserAccountCreateRequestConfirmation_In = new Request_IdentityUserAccountCreateRequestConfirmation_In(userAccountCreateModel);
IdentityUserAccountCreateRequestMessage_Sync identityUserAccountCreateRequest_Sync = new IdentityUserAccountCreateRequestMessage_Sync(userAccountCreateModel);
request_IdentityUserAccountCreateRequestConfirmation_In.setIdentityUserAccountCreateRequest_Sync(identityUserAccountCreateRequest_Sync);
IdtUsrAcctCrteReq_SyncIdt identity = new IdtUsrAcctCrteReq_SyncIdt(userAccountCreateModel);
identityUserAccountCreateRequest_Sync.setIdentity(identity);
IdtUsrAcctCrteReq_SyncUsrAcct userAccount = new IdtUsrAcctCrteReq_SyncUsrAcct(userAccountCreateModel);
identity.setUserAccount(userAccount);
IdtUsrAcctCrteReq_SyncDfltSettings defaultSettings = new IdtUsrAcctCrteReq_SyncDfltSettings(userAccountCreateModel);
userAccount.setDefaultSettings(defaultSettings);
java.util.List<NOSC_PersonalAddress> personalAddress = new ArrayList<NOSC_PersonalAddress>();
userAccount.setPersonalAddress(personalAddress);
NOSC_PersonName personName = new NOSC_PersonName(userAccountCreateModel);
//kalyan
//create the personalAddress model
NOSC_PersonalAddress personalAddrModel = new NOSC_PersonalAddress(userAccountCreateModel);
//create a element for PersonalAddress Node and node element.
IPersonalAddressNode paNodeRef = wdContext.nodePersonalAddress();
IPersonalAddressElement paNodeEle = wdContext.createPersonalAddressElement(personalAddrModel);
//creating an element in Personname subnode and pass the data
IPersonNameNode personNameNodeRef = paNodeRef.nodePersonName();
IPersonNameElement personNameEle = personNameNodeRef.createPersonNameElement(personName);
personNameEle.setGivenName(givenName);
personNameEle.setMiddleName(middleName);
personNameEle.setMiddleName(familyName);
personNameEle.setAdditionalFamilyName(additionalFamName);
//personNameNodeRef.addElement(personNameEle);
//add the PA element to the PA node
paNodeRef.addElement(paNodeEle);
//add to the list
personalAddrModel.setPersonName(personName);
personalAddress.add(0, personalAddrModel);
//kalyan
NOSC_BasicBusinessDocumentMessageHeader messageHeader = new NOSC_BasicBusinessDocumentMessageHeader(userAccountCreateModel);
identityUserAccountCreateRequest_Sync.setMessageHeader(messageHeader);
Response_IdentityUserAccountCreateRequestConfirmation_In response = new Response_IdentityUserAccountCreateRequestConfirmation_In(userAccountCreateModel);
request_IdentityUserAccountCreateRequestConfirmation_In.setResponse(response);
IdentityUserAccountCreateConfirmationMessage_Sync identityUserAccountCreateConfirmation_Sync = new IdentityUserAccountCreateConfirmationMessage_Sync(userAccountCreateModel);
response.setIdentityUserAccountCreateConfirmation_Sync(identityUserAccountCreateConfirmation_Sync);
NOSC_Log log = new NOSC_Log(userAccountCreateModel);
identityUserAccountCreateConfirmation_Sync.setLog(log);
java.util.List<NOSC_LogItem> item = new ArrayList<NOSC_LogItem>();
log.setItem(item);
wdContext.nodeRequest_IdentityUserAccountCreateRequestConfirmation_In().bind(request_IdentityUserAccountCreateRequestConfirmation_In);
//passing the data
wdThis.wdGetUserCreateCompController().executeIdentityUserAccountCreateRequestConfirmation_In();
//success
//wdComponentAPI.getMessageManager().reportSuccess("The user created successfully");
================================================
After executing i am getting the error like this
Exception on execution of web service with WSDL URL 'http://<host>:<port>/sap/bc/srt/wsdl/bndg_DDB660678B8DB6F1934200142220669B/wsdl11/allinone/ws_policy/document?sap-client=XXX&sap-user=XXXXX&sap-password=XXXX' with operation 'IdentityUserAccountCreateRequestConfirmation_In' in interface 'IdentityUserAccountCreateRequestConfirmation_In'
Is there any wrong in the code while passing the values to the model.
What are the possible causes for this exception.
Regards
KalyanI am no more working on this.
-
How can i pass array as argument in magento api method calling using sudzc API in iphone Native APP
0down votefavorite
I am implementing magento standard api method in native iphone app. I use webservice generated by sudzc. To call method I use:
[service call:self action:@selector(callHandler:) sessionId:@" " resourcePath:@" " args:@""];
When I used methods e.g. cart.info or product.info in which I have to pass one parameter; it gives valid response. But when I used method e.g. cart_product.add in which I have to pass an argument as value of array it gives error
SQLSTATE[42000]: Syntax error or access violation:
1064 You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
I have tested in SOAP UI also. There also it gives me same error. But same method works in PHP file. Even I tried by creating same soap request which I created using JavaScript but still it doesn't work.
Can anyone help me to pass array as a parameter using sudzc api to call magento web services?There is an error in your SQL.
-
Array of Parameters in OWB mapping
How do i pass an array of parameters to an OWB mapping.
Try this and similarly you can get all operator.
OMBRETRIEVE MAPPING 'MAP_NAME' GET TABLE OPERATORS
OMBRETRIEVE MAPPING 'MAP_NAME' GET VIEW OPERATORS
OMBRETRIEVE MAPPING 'MAP_NAME' GET TRANSFORMATION OPERATORS
OMBRETRIEVE MAPPING 'MAP_NAME' GET TABLE_FUNCTION OPERATORS
Cheers
Nawneet
Edited by: Nawneet_Aswal on Aug 30, 2010 8:43 AM -
hi,
is it possible to pass an array into a resultset? if yes please indicate how.
thank you all in advanceHi,
Sorry for the confusion, here's what I'm trying to accomplish.
I'm trying to create a report in Crystal Report and use Java as data source. My Java application needs to generate some value and pass them to the report as parameters. After some research I've found that I can use a Java Bean class as data source for Crystal Report that returns a ResultSet. Therefore I'm trying to pass some values in my Java app into the Bean class as array and convert them to a ResultSet for Crystal Report.
If you know of a different way please let me know, otherwise, this is what I meant by passing array into resultset.
thanks for your reply, -
Pass array to oracle stored procedure
I have such a problem: I have to pass array to stored procedure, so I declare type:
create type tNumberArray as table of number
and create procedure:
create or replace procedure proc_1 (in_param in tNumberArray) as
.... BODY OF PROCEDURE ...
when I call this procedure from C# like this:
int []pParam = new int[3] {1,2,3};
OracleCommand cmd = new OracleCommand("proc_1", dbConn);
cmd.CommandType = CommandType.StoredProcedure;
OracleParameter param14 = new OracleParameter("param", OracleDbType.Decimal);
param14.Value = pParam;
param14.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
param14.Size = 3;
param14.Direction = ParameterDirection.Input;
cmd.Parameters.Add(param14);
cmd.ExecuteNonQuery();
an error occures. It say that there invalid number or type of parameters.
But when I declare both type and procedure in a package everything goes fine.
What is the matter? Did anybody have the same problem?Not I got next problem:
when I cannot pass parameter to stored procedure and get array fro it. In other words returning array from procedure and passing some input parameters to it does not word!
Does anybody know why it happens? -
Passing array to call library function running on VxWorks (cRIO)
Hello,
I am using a cRIO 9012 running VxWorks.
I have a Call library function VI in my application and I want to pass arrays of doubles to this function.
The problem is that I can not access the values in the array.
Here is the source code of my function:
#include "D:\\Programme\\National Instruments\\LabVIEW 8.5\\cintools\\extcode.h"
double avg_num(double *in1, double *out1)
double ret;
ret = in1[0] + out1[0];
return ret;
The value of in1[0] and out1[0] is always.
When passing no arrays but single values, all is fine. But since my application is more complex than this example, I need to pass arrays.
The block diagram and parameter specification is as shown in the attached screenshots.
I am compiling the source code with the Gcc 6.3 which is available here:
http://zone.ni.com/devzone/cda/tut/p/id/5694
What am I doing wrong?
Or is passing arrays not supported on cRIO?
Maybe the makefile needs to be modified?
Thank you.
Best regards,
Christian
Attachments:
vi.JPG 88 KB
parameter.JPG 41 KBI guess I have solved the problem.
The key was to set the parameter "Minimum size" for all function parameters to <None>.
Having this, I can read the passed arrays. I do not know why this works but at the moment, it is ok for me.
Thank you all. -
Passing table from ABAP to webservice using SOAP
Hello:
I am trying to pass table data from ABAP code to a webservice using SOAP. I have seen many examples of passing single value parameters such as:
DATA: osoap TYPE REF TO CSoapDocument.
GET REFERENCE OF p_refno INTO dref.
CALL METHOD osoap->add_parameter
EXPORTING
direction = CSoapConstants=>ic_param_in
name = 'ws_ref_no'
value = dref.
CALL METHOD osoap->set_tag_name_format
EXPORTING format = CSoapConstants=>ic_tagfmt_default.
However I cannot find any code examples of passing table data to a webservice. Can anyone provide a sample or documentation for how to pass table data to a webservice?
Thanks,
CraigHi Craig
i just posted this on SAPfans for you too!
if you are not using PI, then follow this....
http://help.sap.com/erp2005_ehp_04/helpdata/EN/bb/ddb33d2ae46b3be10000000a114084/frameset.htm
http://help.sap.com/erp2005_ehp_04/helpdata/EN/9b/dad1ae3908ee44a5caf57e10918be9/frameset.htm
this is converting XSD to ABAP....
http://help.sap.com/erp2005_ehp_04/helpdata/EN/de/705c3c3806af06e10000000a11402f/frameset.htm
i have only used PI to do this via ABAP Proxies.... -
Passing arrays with Test Stand to DIO 96
Does anyone know the easiest way of sending data arrays from Test Stand to a DIO 96 using a LabView dll? I have a Test Stand sequence where I will need to set bits and read bits from a DIO 96 and am going to make a LabView dll. I guess I will need to pass either arrays to and from each port or numeric data to and from each port to a dll and also figure out how the status of the bits in the DIO 96 will be remembered.
What is the best strategy for dealing with Test Stand and a DIO 96?
Has anyone any ideas or example code?Hi Steve,
either approach is perfectly valid, and as you say, the activeX approach does remove some of the flexability of where you get the data from, however, what you've really described is two separate things, rather than two separate styles of approach.
ActiveX or direct passing are simply the means of getting data from and to your TestStand data space.
Step types are a convenient way of wrapping up particular layouts and functionalilty into a very easily re-usable TestStand development item. You would still need some sort of code module to put with a step type, so you're not necessarily limiting your developed code to the Teststand environment.
Making links through ActiveX allows you to make a solid definition on configuration type items, and allow for edit substeps. For example, the NumericLimitTest step type has step.limits.high and step.limits.low. Rather than pass those to the edit substep as a dll call (which is perfectly valid), passing the sequence context (which also allows you to run the termination monitor etc) allows for the fixed references to the fixed data layout of the step. Self containment like this works when the data sources are fixed as you get with a step type to use the edit substep, or the pre/post substeps.
Working on a dll call allows more re-use because then you concentrate on the data, rather than where it's come from, however, for large amounts of different sources, the dll prototype can become very complex and difficult to document. You end up having to pass lots of parameters and some of them you might not use.
The question you're ultimately trying to answer is "what does it do to my architecture?"
The holy grail of TestStand architectures is any step type can be used in any sequence in any sequence file with any process model under any operator interface. Now this isn't always practical, but the closer you get to it, the more flexibility your system as a whole contains, and the easier it becomes to add in or change the layout / functionality of the system
With this comes code re-use, but the extra development time it takes to make good re-usable maintainable code isn't re-couped until the 4th or 5th re-use.
If you want in this case your passing of the array to occur from many different places in your sequences, and you're building up lots of sequences to use them, then making a step type, and passing through the most convenient method you decide upon will make the implementation of the sequences easier to do.
If you only need it in a couple of ways, then you can do without the step type, and if it's not many different data sources, then pass by parameter to the dll through the function prototype directly, and use a regular DLL adapter to acheive it.
Mostly my 2-cents worth.
Thanks
Sacha Emery
National Instruments
// it takes almost no time to rate an answer -
Hi,
I am facing issues like Type Mismatch while passing Array of interfaces from .NET to VBA and vice versa using VSTO technology.
My requirement is that ComInterfaceType needs to be InterfaceIsIDispatch.
My Interface definition is somewhat like this
[ComVisible(true)]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
[Guid("AAF48FBC-52B6-4179-A8D2-944D7FBF264E")]
public interface IInterface1
[DispId(0)]
IInterface2[] GetObj();
[DispId(1)]
void SetObj(ref IInterface2[] obj);
[ComVisible(true)]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
[Guid("CDC06E1D-FE8C-477E-97F1-604B73EF868F")]
public interface IInterface2
IF i am passing array of above interface (created in C#.Net) to VBA using GetObj API,i am getting type mismatch error in VBA while assigning the value to variable in VBA.Even assigning to variant type variable gives TypeMismatch.
Also while passing Array of interfaces from VBA using SetObj API,excel crashes and sometimes it says method doesn't exists.
Kindly provide some assistance regarding the same.
ThanksHi,
I am facing issues like Type Mismatch while passing Array of interfaces from .NET to VBA and vice versa using VSTO technology.
My requirement is that ComInterfaceType needs to be InterfaceIsIDispatch.
My Interface definition is somewhat like this
[ComVisible(true)]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
[Guid("AAF48FBC-52B6-4179-A8D2-944D7FBF264E")]
public interface IInterface1
[DispId(0)]
IInterface2[] GetObj();
[DispId(1)]
void SetObj(ref IInterface2[] obj);
[ComVisible(true)]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
[Guid("CDC06E1D-FE8C-477E-97F1-604B73EF868F")]
public interface IInterface2
IF i am passing array of above interface (created in C#.Net) to VBA using GetObj API,i am getting type mismatch error in VBA while assigning the value to variable in VBA.Even assigning to variant type variable gives TypeMismatch.
Also while passing Array of interfaces from VBA using SetObj API,excel crashes and sometimes it says method doesn't exists.
Kindly provide some assistance regarding the same.
Thanks -
To pass the page parameters to a form in portal
Hi,
I am trying to develope a simple page using portal which contains
1. Simple parameter form.
2. Form that accepts the data from the simple parameter form.
I want to pass 2 page parameters to this form(no.2)
Is it possible to pass the page parameters to a form in portal?You can see a simple example of setting parameters here:
http://www.patrickhaston.co.uk/Portal/parameters.html
And to use them in a form:
http://www.patrickhaston.co.uk/Portal/webplsqlapp1.html
Hope this helps.
Patrick -
How to pass the report parameters through java not by using URL
Hello...
I have an oracle App. Server 10g with report service
I can the report using the URL :
http://host:Port/rwservlet/report=....
and passing the report parameters ...
But is there any way to call the report by pdf format and passing the parameters from java without using the url ???thank you shahcsanjay for your reply
but I think that web.showDocument can not be used by ordinary java web application ..
I think it can be used only with with "oracle forms" Am I right ?
If no can you please tell me where can I find a useful document about how to use web.showDocument ...
thanks again
Saleem
Maybe you are looking for
-
JFormattedTextField case in the case of e-mail adress
Hi, How do I formate JFormattedTextField for e-mail adress as input? I know that in version 5.0, there was something called EmailFormatter, but now it's gone...Please help, I am tired of serching for a solution...
-
I've shut down my computer numerous times hoping the problem will cease to exist but to no avail. If I attempt to click anything the color ball starts spinning and doesn't stop.
-
How can I get an Excel file into my iPad 2?? Thanks!
-
Applications Folder is Not in Dock
Hi, I have a 10.6.8 Mac and my 'Applications' folder is not in the dock anymore. I see it on the 'Sidebar', yet am unable to drag it to the dock. Any help? Thanks.
-
IOS 5.1 on iphone 4s excel and rtf preview gone
Updated to ios 5.1 on my iphone 4s and now it is not possible to preview xls or rtf documents. My work auto-generates my schedule in these formats nightly and since the 5.1 update I can not open them. I updated my phone OTA, I have since reset it res