How to pass an "object" as a parameter in an web services request?
I am developing a simple web service client and server (using Eclipse for auto code generation). I am able to pass String and Byte array from the client. However, there is a parameter "statusInfo" which is an object of the class "cz.unmz.namespaces.csn369791.SendCertificatesRequestStatusInfo" and I have no idea of how to do so.
Below is an extract of the wsdl file:
<xs:element name="SendCertificatesRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="callerID" type="xs:string"/>
<xs:element name="messageID" type="xs:string" minOccurs="0" maxOc-curs="1"/>
<xs:element ref="certificateSequence" minOccurs="0" maxOccurs="1"/>
<xs:element name="statusInfo">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="new_cert_available_notification"/>
<xs:enumeration value="ok_cert_available"/>
<xs:enumeration value="failure_inner_signature"/>
<xs:enumeration value="failure_outer_signature"/>
<xs:enumeration value="failure_syntax"/>
<xs:enumeration value="failure_request_not_accepted"/>
<xs:enumeration value="failure_internal_error"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>Below is an extract of the auto-gen SendCertificatesRequest.java file:
private java.lang.String callerID;
private java.lang.String messageID;
private byte[][] certificateSequence;
private cz.unmz.namespaces.csn369791.SendCertificatesRequestStatusInfo statusInfo;
public SendCertificatesRequest(
java.lang.String callerID,
java.lang.String messageID,
byte[][] certificateSequence,
cz.unmz.namespaces.csn369791.SendCertificatesRequestStatusInfo) {
this.callerID = callerID;
this.messageID = messageID;
this.certificateSequence = certificateSequence;
this.statusInfo = status = statusInfo;
public void setStatusInfo(cz.unmz.namespaces.csn369791.SendCertificatesRequestStatusInfo) {
this.statusInfo = statusInfo;
Below is the auto-gen SendCertificatesRequest.java file:
* SendCertificatesRequestStatusInfo.java
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
package cz.unmz.namespaces.csn369791;
public class SendCertificatesRequestStatusInfo implements java.io.Serializable {
private java.lang.String _value_;
private static java.util.HashMap _table_ = new java.util.HashMap();
// Constructor
protected SendCertificatesRequestStatusInfo(java.lang.String value) {
_value_ = value;
_table_.put(_value_,this);
public static final java.lang.String _new_cert_available_notification = "new_cert_available_notification";
public static final java.lang.String _ok_cert_available = "ok_cert_available";
public static final java.lang.String _failure_inner_signature = "failure_inner_signature";
public static final java.lang.String _failure_outer_signature = "failure_outer_signature";
public static final java.lang.String _failure_syntax = "failure_syntax";
public static final java.lang.String _failure_request_not_accepted = "failure_request_not_accepted";
public static final java.lang.String _failure_internal_error = "failure_internal_error";
public static final SendCertificatesRequestStatusInfo new_cert_available_notification = new SendCertificatesRequestStatusInfo(_new_cert_available_notification);
public static final SendCertificatesRequestStatusInfo ok_cert_available = new SendCertificatesRequestStatusInfo(_ok_cert_available);
public static final SendCertificatesRequestStatusInfo failure_inner_signature = new SendCertificatesRequestStatusInfo(_failure_inner_signature);
public static final SendCertificatesRequestStatusInfo failure_outer_signature = new SendCertificatesRequestStatusInfo(_failure_outer_signature);
public static final SendCertificatesRequestStatusInfo failure_syntax = new SendCertificatesRequestStatusInfo(_failure_syntax);
public static final SendCertificatesRequestStatusInfo failure_request_not_accepted = new SendCertificatesRequestStatusInfo(_failure_request_not_accepted);
public static final SendCertificatesRequestStatusInfo failure_internal_error = new SendCertificatesRequestStatusInfo(_failure_internal_error);
public java.lang.String getValue() { return _value_;}
public static SendCertificatesRequestStatusInfo fromValue(java.lang.String value)
throws java.lang.IllegalArgumentException {
SendCertificatesRequestStatusInfo enumeration = (SendCertificatesRequestStatusInfo)
_table_.get(value);
if (enumeration==null) throw new java.lang.IllegalArgumentException();
return enumeration;
public static SendCertificatesRequestStatusInfo fromString(java.lang.String value)
throws java.lang.IllegalArgumentException {
return fromValue(value);
public boolean equals(java.lang.Object obj) {return (obj == this);}
public int hashCode() { return toString().hashCode();}
public java.lang.String toString() { return _value_;}
public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);}
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.EnumSerializer(
_javaType, _xmlType);
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.EnumDeserializer(
_javaType, _xmlType);
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(SendCertificatesRequestStatusInfo.class);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("http://namespaces.unmz.cz/csn369791", ">>SendCertificatesRequest>statusInfo"));
* Return type metadata object
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
} In the client (an auto-gen JSP file), Eclipse has generated the following two lines of code:
cz1unmz1namespaces1csn3697911SendCertificatesRequest_4id.setMessageID(messageID_5idTemp);
cz1unmz1namespaces1csn3697911SendCertificatesRequest_4id.setMessageID(callerID_6idTemp); I have also added the following line for the parameter "certificateSequence" (I have already prepared a Bytearray of certificateSequence)
cz1unmz1namespaces1csn3697911SendCertificatesRequest_4id.setCertificateSequence(certificateSequence); Can anyone suggest a way of passing the parameter "statusInfo"? Thanks.
Edited by: stupidtss on Oct 28, 2009 12:32 AM
You want something like this:
DECLARE
lio_success VARCHAR2( 2000 );
li_id NUMBER;
li_dep_id NUMBER;
li_sel_id := NUMBER;
li_date DATE;
lo_date DATE;
lio_return_message xyz_bpe_rec_fn.xyz_bpe_rec_col;
l_ret xyz;
BEGIN
lio_success := 'some value';
li_id := NULL; -- or some number
li_dep_id := NULL; -- or some number
li_sel_id := NULL; -- or some number
li_date DATE := sysdate;
lio_return_message.col1 := somevalue;
lio_return_message.col2 := somevalue;
lio_return_message.coln := somevalue;
l_ret := get_xyz( lio_success
, li_id
, li_dep_id
, li_sel_id
, li_date
, lo_date
, lio_return_message );
END;
/
Similar Messages
-
How to pass an object as a parameter
how do you pass an object as a parameter? (what type should it be ?)
Well you can use a [url http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html]String
Or you can take a [url http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Double.html]Double
And you can pass [url http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Event.html]Events
and get yourself in trouble
and you can use a [url http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Frame.html]Frame
or maybe take a [url http://java.sun.com/j2se/1.4.2/docs/api/java/util/List.html]List
but some will use [url http://java.sun.com/j2se/1.4.2/docs/api/java/util/Collection.html]Collection
depends you your direction
so if you need to know
if you should use a [url http://java.sun.com/j2se/1.4.2/docs/api/java/util/Map.html]Map
then this is what to do
just browse the [url http://java.sun.com/j2se/1.4.2/docs/api/]API -
How to pass class object as in parameter in call to pl/sql procedure ?
hi,
i have to call pl/sql proecedure through java. In pl/sql procedure as "In" parameter i have created "user defined record type" and i am passing class object as "In" parameter in call to pl/sql procedure. but it is giving error.
so, anyone can please tell me how i can pass class object as "In" parameter in call to pl/sql procedure ?
its urgent ...
pls help me...793059 wrote:
I want to pass a cursor to a procedure as IN parameter.You can use the PL/SQL type called sys_refcursor - and open a ref cursor and pass that to the procedure as input parameter.
Note that the SQL projection of the cursor is unknown at compilation time - and thus cannot be checked. As this checking only happens at run-time, you may get errors attempting to fetch columns from the ref cursor that does not exist in its projection.
You also need to ask yourself whether this approach is a logical and robust one - it usually is not. The typical cursor processing template in PL/SQL looks as follows:
begin
open cursorVariable;
loop
fetch cursorVariable bulk collect into bufferVariable limit MAX_ROWS_FETCH;
for i in 1..bufferVariable.Count
loop
MyProcedure( buffer(i) ); --// <-- Pass a row structure to your procedure and not a cursor
end loop;
..etc..
exit when cursorVariable%not_found;
end loop;
close cursorVariable;
end; -
How to pass .txt file as an attachment to the web service (SOAP Attachment)
Hi,
I am creating web service using NetBeans 6.5 IDE and JAX-WS. I create a web application and then create web service using provided interface. I want to add .txt file as an attachment/parameter to the web service operation using "Add operation" interface. Don't want to add as an attachment to the SOAP message by creating it explicitly. IDE generates SOAP request and response automatically when the service is tested using "Test Web service" option. How can I add attcahment when I add operation so that it will appear in the generated SOAP message ?
TIA.Hi AnitaDP,
Attachment doesn't work in web service. You have to pass the content of the text file as a String or as an array of bytes to a method of your web service. From there, you may save the passed data in a file. -
How to pass an object as method parameter
Hi Guys
I was testing a simple program and was trying to pass an object to a method but it didnt seem to work and I couldnt find out WHY.
I am posting the code so please let me know who can i make my method ADD_EMPLOYEE work so that when i pass an object of LCL_EMPLOYEE, it updates I_EMPLOYEE_LIST.
*& Report: ZOO_HR_SAMPLE_1
*& Author: Avinash Pandey
*& Date: 25.03.2009
*& Description: Concepts of OO in ABAP
REPORT zoo_hr_sample_1.
*& Class LCL_EMPLOYEE
Local class
CLASS lcl_employee DEFINITION.
Public section
PUBLIC SECTION.
Data type
TYPES:
BEGIN OF t_employee,
no TYPE i,
name TYPE string,
wage TYPE i,
END OF t_employee.
Method
METHODS:
constructor
IMPORTING im_employee_no TYPE i
im_employee_name TYPE string
im_wage TYPE i,
add_employee
IMPORTING im_employee TYPE REF TO lcl_employee,
display_employee_list,
display_employee,
get_no EXPORTING ex_no TYPE i,
get_name EXPORTING ex_name TYPE string,
get_wage EXPORTING ex_wage TYPE i.
Class methods are global for all instances
CLASS-METHODS: display_no_of_employees.
Protected section
PROTECTED SECTION.
Class data are global for all instances
CLASS-DATA: g_no_of_employees TYPE i.
CLASS-DATA: i_employee_list TYPE TABLE OF t_employee.
Private section
PRIVATE SECTION.
CLASS-DATA: i_employee_list TYPE TABLE OF t_employee.
DATA: g_employee TYPE t_employee.
ENDCLASS. "LCL_EMPLOYEE
*& Class (Implementation) LCL_EMPLOYEE
Text
CLASS lcl_employee IMPLEMENTATION.
Class constructor method
METHOD constructor.
g_employee-no = im_employee_no.
g_employee-name = im_employee_name.
g_employee-wage = im_wage.
g_no_of_employees = g_no_of_employees + 1.
ENDMETHOD. "constructor
Method
METHOD display_employee.
WRITE:/ 'Employee', g_employee-no, g_employee-name.
ENDMETHOD. "display_employee
Method
METHOD get_no.
ex_no = g_employee-no.
ENDMETHOD. "get_no
Method
METHOD get_name.
ex_name = g_employee-name.
WRITE: / 'Name is:' , ex_name.
ENDMETHOD. "get_no
Method
METHOD get_wage.
ex_wage = g_employee-wage.
ENDMETHOD. "get_no
Method
METHOD add_employee.
Adds a new employee to the list of employees
DATA: l_employee TYPE t_employee.
l_employee-no = im_employee->get_no.
l_employee-name = im_employee->get_name.
l_employee-wage = im_employee->get_wage.
APPEND l_employee TO i_employee_list.
ENDMETHOD. "add_employee
Method
METHOD display_employee_list.
Displays all employees and there wage
DATA: l_employee TYPE t_employee.
WRITE: / 'List of Employees'.
LOOP AT i_employee_list INTO l_employee.
WRITE: / l_employee-no, l_employee-name, l_employee-wage.
ENDLOOP.
ENDMETHOD. "display_employee_list
Class method
METHOD display_no_of_employees.
WRITE: / 'Number of employees is:', g_no_of_employees.
ENDMETHOD. "display_no_of_employees
ENDCLASS. "LCL_EMPLOYEE
REPORT
DATA: g_employee1 TYPE REF TO lcl_employee,
g_employee2 TYPE REF TO lcl_employee.
START-OF-SELECTION.
Create class instances
CREATE OBJECT g_employee1
EXPORTING
im_employee_no = 1
im_employee_name = 'John Jones'
im_wage = 20000.
CREATE OBJECT g_employee2
EXPORTING
im_employee_no = 2
im_employee_name = 'Sally Summer'
im_wage = 28000.
Call methods
CALL METHOD g_employee1->display_employee.
CALL METHOD g_employee1->add_employee
EXPORTING
im_employee = g_employee1.
CALL METHOD g_employee1->get_name.
CALL METHOD g_employee2->display_employee.
CALL METHOD g_employee2->display_no_of_employees.
The error I am getting is:
Field GET_NO/GET_NAME/GET_WAGE is unknown.
Please help me out on this.
Thanks a lot you peoplehi.
The following parts of your program were changed.
The result is OK?.
*(1)change
CLASS lcl_employee DEFINITION.
Public section
PUBLIC SECTION.
display_employee,
*get_no EXPORTING ex_no TYPE i,
*get_name EXPORTING ex_name TYPE string,
*get_wage EXPORTING ex_wage TYPE i.
get_no returning value(ex_no) TYPE i,
get_name returning value(ex_name) TYPE string,
get_wage returning value(ex_wage) TYPE i.
*(2)change
CLASS lcl_employee IMPLEMENTATION.
Method
METHOD add_employee.
Adds a new employee to the list of employees
DATA: l_employee TYPE t_employee.
*l_employee-no = im_employee->get_no.
*l_employee-name = im_employee->get_name.
*l_employee-wage = im_employee->get_wage.
l_employee-no = im_employee->get_no( ).
l_employee-name = im_employee->get_name( ).
l_employee-wage = im_employee->get_wage( ).
APPEND l_employee TO i_employee_list.
ENDMETHOD. "add_employee
Result List
Employee 1 John Jones
Name is: John Jones
Name is: John Jones
Employee 2 Sally Summer
Number of employees is: 2 -
Why not passing only one XML String parameter to Axis Web Service interface
Hi,
I am a newbie of axis and this is the first post in SUN site.
I am writing a web service. I am considering this question after trying some examples in Axis:
Why not defined parameters of our service interface (Service method.) as a XML String? -We can provide a XML Schema to Client, client fill all required information to a XML according to XML Schema. Seem that it is more straightforward than passing some complex objects.
Your answer will be high appreciated!
Thanks,
-HutDid you find a solution for that? Even im trying the same...
-
How to pass an object from jsp to other jsp using SendRedirect
How to pass an object from one jsp to the other jsp using ssendRedirect with out using the session
I am having 2 jsps
x.jsp and y.jsp
From x.jsp using sendRedirect iam going to y.jsp
From x.jsp i have pass an object to the y.jsp
Is it possible without putting the object in session
Is it possible using EncodeUrl
Please help me Its UrgentIs it possible without putting the object in sessionAnything is possible. Would you accept that it is very difficult?
When you send a redirect, it tells the browser to send a new request for the target page. That means any request parameters/attributes are lost.
Is it possible using EncodeUrl response.encodeURL() puts the session id into a url if the browser does not support cookies. It is purely for retaining the session.
There are two ways that you can communicate across a sendRedirect.
1 - use the session
2 - pass a parameter in the url.
parameters are string based, so passing objects is almost out of the question.
Potentially you could serialize your object, encode it in base64 (so it is composed completely as characters) and pass it as a parameter to the other page, where you retrieve it, unencode it, and then load the serialized object.
Or you can just use the session. -
How to pass internal table values to parameter
hi,
how to pass internal table values to parameter in selection screen.if is it possible means please sent codeings.
thanks.
stalin.hi,
tables : mara.
data : begin of itab_mara occurs 0,
matnr like mara-matnr,
ernam like mara-ernam,
end of itab_mara.
selection-screen : begin of block blk1 with frame title text-001.
parameters : p_matnr like mara-matnr.
selection-screen : end of block blk1.
select matnr ernam from mara into corresponding fields of itab_mara
where matnr = p_matnr.
loop at itab_mara.
write :/ itab_mara-matnr,
itab_mara-ernam.
endloop.
<b><REMOVED BY MODERATOR></b>
Message was edited by:
Alvaro Tejada Galindo -
MVC2.0-- how to pass bean object to jsp
Hi All,
Anybody please tell me how to pass bean class object from controller to jsp ?
I am developing an application in MVC2.0.
I am creating an object of bean class in controller servlet and want to pass this object to jsp so anybody please tell how to pass this object to jsp.
ControllerServlet--
Bean obj = new Bean();
Bean --
public String aMethod() {
return data;
I have to use this method in my jsp and I am creating an object of this bean in controller servlet.
Please help
Thanks
Please reply soonHi,
Thanks for your response. I knew it is possible with session objects. But I want to perform this operation with out using session objects. Is there a way to accomplish this with out using Session objects.
Please help.
Thanks -
How to pass value object to BPM process and access process returned data
Hi,
I am new to Oracle BPM studio and gone through the tutorial. I did not find anywhere how to orchestrate the java components or ejb components or web services in BPM process. if any one provide sample business process orchestered with java component or ejb component or webservice, it will be great. Or atleast provide steps to do that.
Thanks and Regards
Mahesh BabuThere is a tutorial available online.. But you can always catalogue web services and JARs files into the ALBPM..
Just create a new module inside the Catalogue and then right click on it to see Catalogue Component and then select what component u want to add to ALBPM and then follows the steps of adding that component from your local machine and introspecting it..
If it is successful, then all the web-service methods or the JAR file methods would be catalogued into ALBPM..
You can put the WSDL address in the space provided for Web Services.. If password is required that too can be put..
Another way is to create a component in External Resources and then Cataloguing it... -
MDM Server Password Parameter in SRM Web Service for SRM MDM Catalog 2.0
Hi Experts,
We have password set on our MDM server. I am little confused about how to define MDM server password parameter in external Web service Call structure in SRM System for SRM MDM Catalog 2.0.
Will Catalog webservice work, if we don;t define password for MDM server in webservice??if No, then please let me know how to define MDM server password in SRM websevice.
Any help will be highly appreciated.
Thanks,
ShivHi Shiv,
The MDM Server password is needed when you are changing Webdynpro UI Configuration.
For catalogs, all you need is the repository userid/password parameters in the call structutre.
SG -
How to bind list data to XML Web service request
How do I bind specific columns in a DataGrid to the Web
service request? I'm having trouble finding any documentation that
addresses that specific pattern, i.e. sending a complex list to the
server via a Flex Web service send() command. I'm fairly new to
Flex programming and don't know if what I want to do is possible.
Here what I've been able to do so far.
1. Using a Web service called a service on the server and
retrieved a complex list.
2. Poplulated a DataGrid with the result
3. The user has selected multiple rows from the DataGrid
using a checkbox column
4. The user pressed a button that calls a Web service send().
This Web service should only send data from only two columns and
only for those rows the user has checked.
5. I can loop over the DataGrid and find the selected rows
and put them in another ArrayCollection called 'selectedRows'.
The issue is that I don't know how to bind 'selectedRows' to
the Web service. Right now I'm reading up on "Working with XML" in
the Programming with ActionScript 3.0 chapter. But I'm just fishing
here. No bites yet.Don't bind. Build the request object programatically, as you
are doing with your selectedRows AC, and send(myObject) that.
Tracy -
How Stateless Web services requests can be authenticated using HTTP Login
Hi All,
How Stateless Web services requests can be authenticated using HTTP Login (with Oracle CRM On Demand Single Sign On (SSO) Token in HTTP Header).
If there is any code regarding stateless Web services requests to CRMOD please send it to me that will be helpful for me.
Please help me.
Thanks,
Jaysing
Edited by: 883663 on Sep 19, 2011 12:06 AMYou cant use stateless web services when you're using SSO. It's called out in the documentation.
-
How to pass a "object" as a prameter from one java class to another java
hi experts, I want to know "How to pass and get object as a parameter from one java class to another java class". I tried follwoing code just check it and give suggetions..
import Budget.src.qrybean;
public class ConfirmBillPDF extends HttpServlet
qrybean db = new qrybean();
SimplePDFTable pdfTable = new SimplePDFTable();
pdfTable.simplePDFTableShow("2010","2011","1","2","1","131","102");
}Here i want to pass db with simplePDFTableShow method. simplePDFTableShow is in another java class. So how can i do this.
And also i want to know, how this obj will get.
please help me.
Edited by: andy_surya on Jul 14, 2010 7:51 AMHi andy_surya
what is this i am not understand
pdfTable.simplePDFTableShow("2010","2011","1","2","1","131","102");but i am try to solve your problem try this
qrybean db = new qrybean();
SimplePDFTable pdfTable = new SimplePDFTable();
pdfTable.simplePDFTableShow(db);and access like this in SimplePDFtable class update your method
simplePDFTable(qrybean tempDB)
// write your code
} -
How to pass a Class as a parameter of a method?
I have a method like below. Inside this method I need to create a variable that his type is the type of the class I have passed as a method's parameter.
For example, if I call the method like this "Meth1(ClassPerson);" insed the method I need to declare a variable of class "ClassPerson", but if I call like "Meth1(ClassCity);" I need the same variable to be declared as a ClassCity.
public function Meth1( /*I dont know what to put here*/ ):void{
/*I dont know what to put here to declare my variable*/
/*here
comes
more
code
using
the
variable*/
I tried as below but dont worked:
public function Meth1( classtype:Class):void{
var var1:classtype = new classtype();
Can someone help me?evyatarBH, after declare the variable like you said an error occurs when I try to access some property of the variable. I receive a mesage telling that this property dont exists.
public function Meth1( classtype:Class ):void{
var var1:* = new ClassFactory(classe);
//when I try to do something like the line below the error appear
inputtext1.text = var1.fieldname;
rashare, I can't do this because I can't declare the object before the method is called. I must inform to the method only which class I will use, but the object must be created only inside the method.
Maybe you are looking for
-
Recording audio from a Channel Send
I've done this before, but I can't seem to do it again. I am trying to record audio from one channel (which is using an audio instrument) to another channel (an audio channel) using an audio send. I am not having a problem setting up the send. I am a
-
Hi I would like to know alternative way for getting the sold to id in action class. Currently I am using following way to get sold to id from BusinessObjectManager. This method is deprecated in the ISA. bom.getUser().getSoldTo().getId() let me know t
-
Hello, I'm having trouble trying to get my signed applet to work. Here's my situation: I've created a signed .jar file that relies on classes in another .jar file. The second .jar file comes from a 3rd party and is signed by them. I'm using IE. When
-
hello, i'm working on a small school project, i'm experimenting a little with listeners and I wanted to know if it was possible to exit a listener? as soon as i start draging, i want to execute the commando "jPanel1.add(com)" and right after that i w
-
Why is the "App Store" App so user-unfriendly?
I like to add several Apps at a time (I like to try out all the "free apps" in a section). Why is it that the "App Store" App will only allow you to click on one app then reverts back to the home page where you have to go back to the "App Store" app,