Array of (structure) as a parameter in CORBA and JAVA
Hii
i have created a structure in the (interface )IDL file in CORBA program,
then I used an array of this structure.
I used the data type in the server application, i decalared a variable of the same type of the structure and i send it to the client as a single variable, it was working with out problems.
the problem is :
i wanted to send an array of this object (structure) to the client but i couldn't i tried many ways but i couldn't,
I wrote the program (both server and client) in Java, but since i am not java profissional I think there is a certain way to send this array as a parameter from the server to the client or the opposit.
so , Can you please help me
In your idl file you need to define a sequence of your structure
typedef sequence<strucrure name> stucts;
this is mapped to an aarray of your struct in java
Similar Messages
-
How to pass a structure/array of structure as input parameter in a webservice
Hi Team,
I am trying to create a webservice in powerbuilder .net( pb 12.5.1) . As this webservice will be used by external world to access some of data on basis of some input paarameter.
So can i use array of structure as input parameter to a webservice ? If no, then how can i pass a result set ( mora then 1 row with more than one column)
as an argument to the webservice.
Regards
SubratI am assuming this is the same for .Net but in Classic you can create NVO's with Instance Variables and then reference them in the NVO that will be used as the parameter for the Public WebService.
WS NVO's:
Children
String Child[]
Customer
String FirstName
String LastName
String DOB
Children Children
Public Interface uses Customer
Calling Code Example:
integer rc, liNdx
string lsReturn
SoapConnection lSoapConnect
proxy_testing px_Testing
lSoapConnect = CREATE SoapConnection
if IsValid(lSoapConnect) then
TRY
rc = lSoapConnect.CreateInstance(px_Testing, 'proxy_testing')
CHOOSE CASE rc
CASE 100
lsReturn = "Invalid proxy name"
CASE 101
lsReturn = "Failed to create proxy"
CASE 0
Proxy_Customer lNewCustomer
lNewCustomer = CREATE Proxy_Customer
lNewCustomer.FirstName = 'Chris'
lNewCustomer.LastName = 'Craft'
lNewCustomer.DOB = 'Getting Older'
Proxy_Children lChildren
lChildren = CREATE Proxy_Children
lChildren.Child[1] = 'Madeline'
lChildren.Child[2] = 'Hayden'
lNewCustomer.Children = lChildren
lsReturn = px_Testing.NewCustomer(lNewCustomer)
CASE ELSE
lsReturn = "Unknown error (" + String(rc) + ")"
END CHOOSE
if rc <> 0 then MessageBox("Invocation Error", lsReturn, Exclamation!)
CATCH (RuntimeError rte)
rc = -1
MessageBox("Runtime Error", rte.text, Exclamation!)
END TRY
end if
Chris Craft -
Is there a way to pass an array or structure for example as parameters, in addition to a query, or multiple queries to the Report Builder in CF8? I believe this was recommended by users to be in CF8.
BrianO,
Although it's been a while, I thought I'd provide the code to do this for you. It works for me in CF8, and probably will in CF7.
Here I create a structure called My, and provide that one parameter to my CFReportParam tag.
<CFSet My = {
Client = "Client Name",
ReportDateFrom = DateFormat(ThisStartDate, DateMask),
ReportDateTo = DateFormat(ThisEndDate, DateMask),
PageHeaderImage = ImagePath & "\Logos\Page_Header.png",
WatermarkImage = ImagePath & "\Logos\Watermark.png",
GetBarSummary = GetBarSummary,
GetPieSummary = GetPieSummary
}>
<CFReport Template="#ReportPath#\SpendSummary.cfr" Format="PDF" Query="GetSummary">
<CFReportParam Name="My" Value="#My#">
</CFReport>
Inside the report itself, reference the given parameter as Param.My.PageHeaderImage for example. It can be referenced that way from any expression inside the report builder. You can even use the queries as the data source for charts (using the Data From a Query -> Query Builder -> Advanced) by entering "Param.My.GetPieSummary" where it says "Variable containing query object".
HTH
Swift -
The suitable LabVIEW data type correspinding to the array of structure in Visual Basic ActiveX DLL
Hi!
I need to call a VB ActiveX DLL from LabVIEW. When I run my LabVIEW code, I always meet an error as:
Error 1 occurred at Incorrect Function in T06.vi
Possible reasons:
LabVIEW: An input parameter is invalid.
I have read the VB DLL code that defines the data type. It fills data to a structure, then puts this structure to the array, and sends the array of structures to the method.
VB Code:
For I = 1 To 31
Set MyInputData(I) = New EM_nkd_DataPoint
Next I
With MyInputData(1)
.Amplitude = 8.44
.DataPointType = R_HW
.DataSource = MEASURED
.Wav
elength = 409.56
End With
With MyInputData(2)
.Amplitude = 91.60113
.DataPointType = T_SUB
.DataSource = MEASURED
.Wavelength = 409.56
End With
~~~
With MyInputData(31)
.Amplitude = 91.96825
.DataPointType = T_SUB
.DataSource = MEASURED
.Wavelength = 657.43
End With
My problem is that I can’t find a suitable kind of data type in LabVIEW which is corresponding to this case
Attached my LabVIEW code for reference.
Many thsnks.
TX
Attachments:
T07.vi 166 KBHi,
if you have a complete source code including EM_nkd_DataPoint class module, take a look inside in order to see data types for Amplitude, DataPointType, DataSource and Wavelength (probably for Amplitude and Wavelength is SINGLE). If this code is not available, maybe the author mentioned a type for T_SUB and MEASURED even if they are constants. -
Loops in arrays or structures
I was given a project on html reports and
They have advised me to use Loops in arrays or structures
At this point I am a novice at this html reporting system. I
would like to know how I can use loops in arrays or structures.
How is it beneficial are
1. Structures
2. Arrays
3. loops in for both
for my reports.
Countless thanks in advanceStructures are great if you understand them, they are
basically just arrays organized by keywords rather than index
numbers.
Arrays are very nice, as you can just run through loops to
access each element, as they are all indexed by numbers 0-x.
loops are great to navigate through both. All you have to do
is set an loop to run through x amount of iterations of the array
or structure (where x is the length of the array, or number of
elements in the structure). Loops are great due to the small amount
of code they require. -
How to create an array of structure which the structure contain an array(s)
im very new to java, and new here
i searched many websites, but i cant find it
it looks like this,
there is 10 employees, each of them has 0-5 children,
what i want is,
peter alan joseph
|?????????????????|???????|??????????????
| |????????| |??????| | |?????| |
| | andrew | | alvin | | | john | | ...........................
| |________| |______| | |_____| |
| |
what i know is,
import java.util.*;
class main{
public static void main(String[] args){
employee d[] = new employee[10];
d[0]= new employee();
d[0].child = "alvin";
System.out.println(d[0].child);
class employee{
String child;
}but only work for 1 child.. =(
i need an array of structure which the structure itself cantains an array(s)
please help, newbie heresen,
my lecture[r] said no statement in classEither you misundetstood your lecturer [probable]; or your lecturer is full of shit [possible].
is "String[] children = new String[5]" a statement ?Yes, it is.
she said we can only declare like "String[] children;" in classEither you misundetstood your lecturer ...
There's nothing actually wrong withclass Employee{
String[] children = new String[5];
}But it has the inherent limitation that you can't put the fathers name on the 6'th child's birth certificate... because the dumb computer won't let you... Hence it is poor practice.
A better implementation would be:class Employee{
private List<String> children = new ArrayList<String>();
}because it doesn't impose an artificial limit on the number of kids a bloke can have.
keith. -
Accessing Array of Structures from Coldfusion
I am having a problem accessing an array of structures from
Coldfusion within my flex application. Here is how I make my Array:
(GetRegions is a type Query and Type is a string variable)
<cfset ReturnArray = ArrayNew(1)>
<cfset ReturnArray[1] = StructNew()>
<cfset ReturnArray[1].Query = GetRegions>
<cfset ReturnArray[2] = Type>
Within flex I am trying to access the results in the
following way:
private function dataHandler(event:ResultEvent):void{
Query_Filter = new ArrayCollection(event.result[0].QUERY as
Array);
myString = event.result[1] as String;
Can anybody help me with this. I want a way to return a query
and a string back from coldfusion.
Thanks for the help,
JeffSo now I changed my code to the following in CF:
<cfset Type = "MyString">
<cfset ReturnArray = ArrayNew(1)>
<cfset ReturnArray[1] = StructNew()>
<!--- set up query GetRegions --->
<cfset ReturnArray[1] = GetRegions>
<cfset ReturnArray[2] = Type>
<!--- Return Array --->
<cfreturn ReturnArray>
Now in flex I have the following dataHandler Function:
Alert.show("hello: "+ObjectUtil.toString(event.result[0]));
Query_Filter = new ArrayCollection(event.result as Array);
Now I set up a List box with Query_Filter as the dataprovider
but the results aren't showing correctly. The first item in the
list box is displayed as [object, Object], [object, Object] and the
second item is my String.
Does anybody know how to break up the query to a variable and
the string to its own variable in the dataHandler function.
Thanks for any and all help -
Passing an array of structures to an Oracle stored procedure (CFMX)
I'm looking to write a Oracle stored procedure where I would pass in an array of structures and loop over each iteration to insert the bits and pieces within the structures to the DB.,
I haven't written this type of procedure / package before. I am planning to do an sp / package similar to what is sketched out in the second reply to this thread: http://forums.oracle.com/forums/thread.jspa?threadID=1078772
Assuming I do, how can I call the procedure from ColdFusion (I'm using MX) and pass in my array? As far as I can see, none of the CF_SQL_Types make sense.Let me know if you make any progress. I'm fighting the same battle. What I've done so far is to convert my array of struct into a delimited CLOB that looks like this:
prop1;prop2;prop3|prop1;prop2;prop3|prop1;prop2;prop3|prop1;prop2;prop3|
Then I wrote a stored proc to suck it up using a pipelined function. It's not to bad but parsing the CLOB on the ORACLE side is somewhat time consuming.
I've also converted the array to XML and used dbms_xmlstore to convert but, on large arrays, it is very slow and the CLOB gets huge fast.
I was hoping to use the cf_sql_refcursor but I can't figure out how.
Warren -
Hello All,
I defined a view in my application. This view comprises of a structure
containing an integer and char[].
I my application, I created an array of this structure and populated it.
I return the pointer to the array of the structure in the tpreturn call.
on the client side, I can see that only the first element of the array
is retrievable. The rest is junk data.
Why did the other elements did not come?
when populating the data in the array I do a userlog in the loop and I
can see that each element of the array was populated.
Why am I not able to send the entire array to the client side?
thanks for your help.
regards,
Abhishek.Abhishek,
Make sure that you are using the exact C structure that was produced by the View
compiler from your View description.
Can you post your .v file, and the .h it generated?
If you need to transmit an array of the entire structure, you can use embedded
FML32 to pack many View structures into an FML32 buffer.
If you are always sending between the same machine types and data representations,
and you don't need Routing, then you can stuff your C structure into a CARRAY
and send it that way. On the other side, you'll have to copy it out into a
properly aligned structure.
Scott Orshan
Abhishek Srivastava wrote:
Hello All,
I defined a view in my application. This view comprises of a structure
containing an integer and char[].
I my application, I created an array of this structure and populated it.
I return the pointer to the array of the structure in the tpreturn call.
on the client side, I can see that only the first element of the array
is retrievable. The rest is junk data.
Why did the other elements did not come?
when populating the data in the array I do a userlog in the loop and I
can see that each element of the array was populated.
Why am I not able to send the entire array to the client side?
thanks for your help.
regards,
Abhishek. -
Array of structures - two ways to approach - which is better?
Folks - I've been trying to create an array of structures,
but I bumped into problem that lead me to an example that is
completely different. I'm trying to figure out which is valid. In
general, it comes down to this:
(1) myStructure
.firstName
vs
(2) myStructure.firstName
The problem with the first is that I can't find a way to
discover the size of the array, which leads me to suspect this is
not a valid method. The problem with the second is that you must
redefine the structure for EACH array element, which seems like it
would add a lot of overhead.
Any advice? Sample code attached.
Thanks!
************* Sample (1) **************
<CFSET sCust=StructNew()>
<CFSET vCustCount = #rsMailAuth.recordcount#>
<CFSET i = 0>
<CFOUTPUT QUERY="rsMailAuth">
<CFSET i = i+1>
<CFSET sCust.userId
= #rsMailAuth.userId#>
<CFSET sCust.validEmailSource =
#rsMailAuth.validTcEmails#>
<CFSET sCust.authKeyword
= #rsMailAuth.tcEmailKeyword#>
<CFSET sCust.authKeywordLoc =
#rsMailAuth.tcEmailKeywordLoc#>
</CFOUTPUT>
************* Sample (2) **************
<cfset strTest = arrayNew(1) >
<cfset strTest[1] = structNew() >
<CFLOOP INDEX = "i" FROM="1" TO="5" >
<cfset strTest
= structNew() >
<cfset strTest.id = i>
<cfset strTest
.name = "[email protected]">
</CFLOOP>
<cfoutput>#arrayLen(strTest)#</cfoutput>Sorry - simple english...
I am collecting a series of emails from a pop email server.
As I parse these into the individual parts (subject, body, from,
etc) I want to stuff them into a structure. each email would be a
new index. so, the 2nd email 'from' info would go into
myStructure.from[2] or myStructure[2].from.
I know there are lots of ways around this, I just have a
natural predisposition to use structures when possible as it makes
it easier for me to keep track of things and makes it easier to
follow the code.
I can make either of these work, I'm just not sure if they
are valid in the world of coldfusion8. -
Passing array of structures back to java from c
I have a DLL in C that I'm calling from a Java servlet. The C DLL creates a bunch of arrays of structures that I would like to be able to bring back to the Java servlet and process further. How difficult is this and does anyone have anywhere to point me that shows how it can be done?
1. In general, java knows nothing about structures. So you have to define eqquivalent java classes, and write code to move the data from C structs into the classes.
2. JNI supports definition of arrays of objects, which can be passed back from the dll.
You may find some code generators that will help you with the
CStruct->JavaObject definition. This may be a blind alley, but check out JACE. -
Parameter JCO.Request and JCO.Response where null
Hi ;
I try to execute RFCtoRFC scenario. I have done all settings including receiver,sender agreement too.
But when i call rfc , i get following error
parameter JCO.Request and JCO.Response where <null>
My code that the calls a remote function is like;
CALL FUNCTION 'ZBAPI_EH_GET_DATA_GEN'
DESTINATION 'OLT200'
What would be the reason ?
ThanksHi,
in your RFC call, specify the data which is sent as RFC req msg from R/3 system in EXPORTING parameter if your RFC call is asycnh or both EXPORTING and RFC response msg structure in IMPORTING if your RFC call is synch.........in your report, use pretty printer and specify your RFC in CALL FUNCTION and then you will see the default calling procedure of your RFC.......then create a structue for your RFC req msg structure and response msg struc and fill it with data and then execute your RFC by using this CALL FUNCTION method.........
Regards,
Rajeev Gupta -
How to pass Cascading Parameter in SSRS using Java
How to pass Cascading Parameter in SSRS using Java---
We are having a problem with dependent parameters.There are three drop down--
1.first dropdown is of Country.When we select a country--Accordingly next dropdown(State)will populate
2.Second dropdown is of State. When we select a state--Accordingly next dropdown(City)will populate.
I have three data sources are
CountryList-
SELECT CountryRegionCode, Name
FROM Person.CountryRegion
ORDER BY Name
StateList
SELECT StateProvinceID, StateProvinceCode, CountryRegionCode
FROM Person.StateProvince
WHERE CountryRegionCode = @CountryRegionCode
ORDER BY StateProvinceCode
CityList
SELECT StateProvinceID, City
FROM Person.Address
GROUP BY StateProvinceID, City
HAVING (StateProvinceID = @StateProvinceID)
ORDER BY City
Ihave to show report that has been deployed on server on the besis of these parameters
I am using ReportViewer in JSP Page through url--
http://192.168.90.149/ReportServer/Pages/ReportViewer.aspx?%2fReport+Project1%2fCascading_Parameters&rs:Command=Render&rs:parameter=true&Country="+Country+"&State="+State;
But it is not accepting parameter if they are cascaded.It is working fine if Both parameters are independent.
Edited by: kaushlee on May 11, 2010 9:22 PMTake a look at set_custom_property:
public static final ID SETTEXT = ID.registerProperty("SETTEXT");
public boolean setProperty(ID pid, Object value)
if (pid == SETTEXT)
String text = value.toString();
and in forms
set_custom_property('beans.bean_item', 1, 'SETTEXT', 'some text');
cheers -
Returning an array type from a local method in Web Dynpro Java application
Hi,
In my project, we have a requirement to display 18 rolling months along with the year, starting from current month.
How I am going to approach is that I will get the system date and get the current month and send the month and year value to a local method which will return 18 rolling months along with the year.
But, when I tried to create a new method there is no option to return an array type. It was greyed out.
So, we can not return an array type from a method from Web Dynpro for Java application?
If so, what is the alternative and how am I going to achieve it?
I will appreciate your help!
Regards
RamHI
You can create new methods in
//@@begin others
private ArrayList MyMethod(){
// ** Put your code here
return new ArrayList();
//@@end
Other option are create a context node with cardinality 0...n with one or more attributes, and in your method create the needed registers into this node. To read this values, you only need to read your context node.
Best regards
Edited by: Xavier Aranda on Dec 2, 2010 9:41 AM -
Hi ,
earlier we are moving a page ,document from one site to another sub site with in the Site Collection.
Now,we are getting a un-readable format error.
After selecting the destination we are getting the error.
and the file can't move.
What might me be the error.
Expecting answers related to my question.
1.As we can do using Internet Explorer,
2. Using Send To also we can move.
Using this Site Content and structure we can maintain Versoining also.
If any one face the same issue then we can easily find out the solution.
Regards ,
Prathap
SP Developer
Specify the destination to move the items you selected.Hi,
Using Site Content and Structure unable to move documents,pages and getting weird error message
We are getting Below error:
When Moving Document items from one site to another site in the same site collection using Site content and structure(But it's working in same site,we can move documents from one library to another library)
1576|/wEWwwECuLLErw0Cy+nFYwK84baBAgK6zNqsAgLs0Le0BQK1s8uaCAL5qrm3CAKk7K6pDwKo9a0GArm+xr4NApKe9KUKAoajpK4CAqqU/2sChJXBtAIC052rYQKS+LTPAgLe+7uQAwLO0re/BwLgoaw2AojAlIMOApSO4JoNAuvW7MoKAojz2P4OAuOMt9EGAv/ns1wC64qI7gEC0LymmAcCro3lnQkCj7viwAsC8Met9QEC3a/DHALg4ZO6AQKAn8ebCALvr72DAwKm/NGmAgKN4aayCQLmmczsCgL+46qSAQKH7paCDgLouOHjDwKGuNCBCQKwuob2CQKP78n3BwLQ7vSYCALxlcvIBALRuajXAwK6/vr4AwKx8YasCQLti5igAQKay7JZAta625IFAuTy6rUKAvnC7eQKApvB3ugPAoTBua8BAoyajvgMAsGdloEJAvH+2KECAua7k9AGAv3Lzd8HAtPD3ocOAuX7hM4GAqO1g9sIAtn65sgFAuDkr9QEAt7I1KkMAryhltsIAtizx/kBAvzS7IcBAr+YhK4PAsO3rtADAvea+sADAsvc4IgKAp/1vIoMApelp3ICl+PqiwwC/KX1gwUC3fv58gIC7ZG/pwIC4cnupQgCq7mdlgYCjciR+AwC8/ue4gkC4YWJywUCs+rviAECpuyJigECkfr5rgkC08rHoQ0C+erayQUCjMqStQkCpIuKtwEC+dG5ngICoZ3/og0CspXoxwwC+pzgmwwCkoD5mAYCn/qH2AcC/N/pvAcCv5OtwAICuZquqgcC0/OFnwkC2/2wzQMCrJrO9woC69G52ggC64nunggCtLOIsQEC9LyC7gUC0ry/zgIC1ZDvgQ0C98OfMgL4kaj3CQKXhebCCwKi3bjPBQKYuojTCAKc4+fxCAKyjLfoBALVxO8SAsXSyuQLAqyvkNIPApDV5PgDAtufwJwEAu2BsoYLAs3Oqd8PAo6i+YMDAsy706oCAsLjx7kLApu3+9gKAuLnvMoIAtWywo8OAv6MjvIHAtSDhJwNArXRmL0LAraZvUcC5cGygQoCz5HN7A0C+YzY9AMCmtWQ6AUC/oHF8w4CxeTgmg8CgszujQECss22vgYCp6HBuggCkfm+FAKngqb5BgKkuIzAAQKPspKCCQLu+eDvCwKf5YrEBQKl0M3ACgKm85DvDALCu/nfCwLbwO38DgLoz5eyDQLfr9XLCwL20/eUDgL7hpr3DAKh1tfbCgL48OuNBwK4tuKaCALpgbn5CgLC4dKvBgKKlu76CwKfhKLJAQLurPTIAwLG0o+hAgKI5Y6dDALq+OOlCQKxjuuICAK8yrLHBwLcrOSSAwLoiJfQCwKKyvrtBALXkbCBCgKt4bG9BQLr6qnxCwLC2pz2DQKQ7OuZBALt7t+DDAKR47b8CAKi6pPGCQKLl4r3CQK5yfj+AwLgzYvjDwKUjerODQK7mOPTCQL9qP3qBgKYiOL9AgLA8pSaBwKay8fBDQLqw93DCgKkjpf/CwLsyquQCwKtpbGsDALMtKmxBwKPpvCmBOAFHtmBuG3iNmIT9fQ8Z1TWMpjZ122|cccccccccnncnnnnn|
Maybe you are looking for
-
Can i access my old macbook pro's 'Time machine' saved on time capsule with a new laptop
How can i access my old macbook pro's 'Time machine' saved on time capsule with a new laptop. Also why can i only EITHER have the capsule attched to the internet OR have it as my backup external hard drive?? Things are not running smoothly can someon
-
How to do Scheduling Crystal Reports?
Hi All, I request any one of you, to let me know how to schedule Crystal Reports. I am unable to find any option in Crystal Report Designer. Please list if any step by step procedure on scheduling crystal reports(lets say hourly, or weekly an
-
LAYOUT option in classical report
HI all, Is it possible to provide SORT options, LAYOUT options (CHANGE layout, SAVE layout) in classical report as similar to those options in ALV? If so, how to display those icons at the top of the report as similar to ALV? Regards, Shanthi
-
TS3297 How do I regain my security password questions. Thank you.
I am unable to answer security questions. I am being informed I have to do this as it is the first time I have used this computer for itunes, but I have used it for quite some time. I do not even recognize the questions. Than You.
-
Error with device performance report
Hi all I had propblem with Device performance report of LMS 4.0. You could see picture below about the problem. How do resolve it ? Thanks