Do I have to implement "Call" method of SOAPConnection object?
I was trying the example "saaj-simple" that comes with "jwsdp".
But it gave me NoSuchMethodError for the method "call" of "SOAPConnection" object.
I opened the "saaj-api.jar" and found that the "call" method is abstract.
Am I supposed to be implementing this method? I thought I should be using this method as it is.
Yup! I already have that.
In fact I have both the jars associated with SAAJ plus other jars related to javax.
But still it ain't working. It gives runtime error.
It compiled successfully.
Similar Messages
-
Calling Methods from Business Object BUS2032
Hi all,
Is it possible to call methods from the Business Object BUS2032.
If so, how can it be done??
Regards,Hi Marv,
you sure can. Here is an extract from the SAP Help. I found it at http://help.sap.com/saphelp_46c/helpdata/en/c5/e4ad71453d11d189430000e829fbbd/frameset.htm
<b>Programmed Method Call</b>
Call (fictitious) method Print of object type VBAK (sales document). The method receives the parameters Paperformat and Printertype as input.
* Call method Print of object type VBAK
* Data declarations
DATA: VBAK_REF TYPE SWC_OBJECT.
SWC_CONTAINER CONTAINER.
* Create object reference to sales document
SWC_CREATE_OBJECT VBAK_REF 'VBAK' <KeySalesDoc>
* Fill input parameters
SWC_CREATE_CONTAINER CONTAINER.
SWC_SET_ELEMENT CONTAINER 'Paperformat' 'A4'.
SWC_SET_ELEMENT CONTAINER 'Printertype' 'Lineprinter'.
* Call Print method
SWC_CALL_METHOD VBAK_REF 'Print' CONTAINER.
* Error handling
IF SY-SUBRC NE 0.
ENDIF.
Cheers
Graham -
Error on Calling Methods Using an Object of a Class
I keep getting the error cannot resolve variable addStud . I can't figure out why. I've created objects of classes before this way, then called methods within that class like this and it worked fine. I can't discern any difference between the syntax of the program that worked successfully and this one. I commented the parts where the error is when I tried to send a variable to a method in the class Recieve of which addStud is an object of. If you can see something that I can't I'd appreciate it. I've checked the obvious things like making sure the class name and method name is spelled the same way in both my frame and the class file.
import java.awt.event.*;
import java.awt.*; /* Used by IntroTest3.java. */
import javax.swing.*;
public class RegFrame extends JInternalFrame
{ // Begin class RegFrame
static final int xOffset = 30, yOffset = 30;
private JLabel nameLabel, displayLabel;
private JTextField nameField;
private JTextArea displayText;
private JButton addButton;
private String name;
private int numStu;
public RegFrame() { // Begin RegFrame constructor
super(" Register a New Student ",
true, //resizable
true, //closable
true, //maximizable
true);//iconifiable
//...Create the GUI and put it in the window...
//...Then set the window size or call pack...
setSize(400,300); //Set the window's location.
setLocation(xOffset, yOffset);
Container content = getContentPane();
setBackground(Color.white);
content.setBackground(Color.white);
content.setLayout( new FlowLayout());
//* CREATE LABELS AND TEST ENTRY FIELDS FOR REGISTERING A NEW STUDENT *
* HERE IS WHERE OBJECT OF RECIEVE IS CREATED *
Recieve addStud = new Recieve();
nameLabel = new JLabel(" Enter student name: ");
nameField = new JTextField(20);
content.add ( nameLabel );
content.add ( nameField );
addButton = new JButton( "Add Student" );
content.add( addButton );
addButton.addActionListener(
new ActionListener()
{ // Open ActionListener
public void actionPerformed (ActionEvent e)
getInput();
} // Close ActionListener
} // End RegFrame Constructor
// get input
private void getInput()
numStu++;
name = nameField.getText();
JOptionPane.showMessageDialog( null, "NAME: " + name + "\n"
+ "Student number:"+ numStu );
addStud.addName( name ); /** <--- HERE IS ERROR **/
} // End class RegFrame;This is the class:
public class Recieve
{ // Begin class Recieve
private double stAssign[];
private double stLab[];
private double stProject[];
private double stQuiz[];
private double stTest[];
private String stNames[];
int snc;
public Recieve ()
stAssign = new double[10];
stLab = new double[10];
stProject = new double[10];
stQuiz = new double[10];
stTest = new double[10];
stNames = new String[10];
snc = 0; // Student Name Counter
public void addName (String stName)
stNames[snc] = stName;
snc++;
} // End class Recieve1- Add the following class variable declaration for RegFrame:
private Recieve addStud;2- Change in the RegFrame constructor:
addStud = new Recieve(); -
Is it possible to call methods of JAVA objects from ABAP?
Hi all,
Does anyone know if it is possible to call methods of java classes from ABAP?
Regards,
SukruHi,
Yes we can access the classes of JAVA in ABP.
This is posible from version ECC 6 onward with NETWEAVER atrhcitecuture.
Pls go through this link-
http://help.sap.com/saphelp_nw04s/helpdata/en/84/54953fc405330ee10000000a114084/frameset.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/e1/b5443e02a9ab4186a6e1240a9a2455/frameset.htm
Here also we use the JCO connector objects
These clearly show the methods to use JAVA.
<removed_by_moderator_together_with_points>
Regards
Chandralekha
Edited by: Julius Bussche on Jul 8, 2008 5:58 PM -
Call the CALL METHOD and CREATE OBJECT
Hi Friends,
How to call the CALL METHOD and CALL OBJECT in the se38 edit program.For example for calling the FUNCTION MODULE we can use the pattern in that using the call function we can get the function module in the se38 edit.but in METHOD hoe to call if you explain me in detail it would be very much usefulfor me.
Thanks,
Regards,
Rajendra KumarHi rajendra,
its the same way we do. call pattern ..there will be another radiobutton whcich says 'ABAP objects' , give the method name and the class name there.. this will call the method similar to function module..
we can also write our own classes and methods...
say..you created your own class c1 and method m1
then first create the instance of the object..
data:obj1 type ref to c1.
create object obj1.
call method obj1->m1.
Regards,
Vidya. -
Calling methods of business objects
hi
pls post some docs on calling methods in business obj's from abap programs.
thkx
P.SDo you share your solution?
For other people interested, example for FMPSO object:
INCLUDE <cntn01>.
DATA : l_lotkz TYPE bkpf-lotkz,
l_order TYPE swc_object,
lt_fimsg LIKE fimsg1 OCCURS 0.
DATA : BEGIN OF ls_key,
sourcecompanycode LIKE vbkpf-ausbk,
requestnumber LIKE vbkpf-lotkz,
END OF ls_key.
swc_container lt_container.
ls_key-sourcecompanycode = 'value'.
ls_key-requestnumber = 'value'.
swc_create_object l_order 'FMPSO' ls_key.
IF sy-subrc EQ 0.
* Validate
swc_call_method l_order 'FlagReleaseSet' lt_container.
IF sy-subrc NE 0.
MESSAGE e000(zz).
ELSE.
* Post
swc_call_method l_order 'PostAll' lt_container.
swc_get_table lt_container 'TFimsg' lt_fimsg.
IF sy-subrc NE 4 AND sy-subrc NE 0.
MESSAGE e000(zz).
ENDIF.
ENDIF.
ENDIF. -
Best way to call methods on similar objects without an interface
Hi,
I have two objects that i need to iterate, they both have the same method i need to call during iteration, but those two objects are from different libraries and i cannot change them to add them as implement interface...
for (Iterator it = documents.iterator(); it.hasNext();) {
Document1 document = (Document1) it.next();
document.getName();
But I can also get a documents's collection where the object is Document2 and not Document1 that also has getName(), what's the best way to implement this? I mean i know i can just add if conditions to say if (instanceof) do this or that.. but I don't think this is good as everytime there's a new type of doc i'd have to add one more...
Any suggestions?
Thanks,I have two objects that i need to iterate, they both have the same method i need to call during iteration, but those two objects are from different libraries and i cannot change them to add them as implement interface...
You already know what you need to do. You just don't want to do it.
You can't treat two (or more) instances the same if they aren't the same. Here are three methods:
1. Add code (like you propose) to determine which type you have
2. Create your own classes that extend those classes and have your own class implement your own interface that has the 'getName' method. When you create instances of your own class the constructor can have code that determines which type you have and then use the appropriate 'getName' method. Your app code would use your own classes instead of the ones from the libraries
3. Use reflection to call the 'getName' method. -
Q: Calling Methods from Outside Object??
I am an old VB programmer trying to convert to JAVA.
I use a Jframe with a listbox to display and store general messages about the program status, etc. It is like a console or running log of events and messages. In VB, I know the form name and just call the function to add strings (frmDisplay.addString("HELP"). What is the best way in JAVA to send messages to this frame object even though the frame does not inherit or extend any of the other objects in the application? I must be missing something basic.
Thanks,
Scott
[email protected]1) You can extend JFrame and simply add a method public void addString(String s)
that does what you want to.
2) If you want to add something to the list on the Frame you can keep the name of the listbox and directly add to it.
3) You can extend Frame like in 1 but this time you add a variable
public listbox (or whatever) lb;
then you can access it via <framename>.lb and basically use 2) again. -
Implements interface method at the derived class
Hi all.
I have a class (Derived) that extends another class (Base).
In the base class (Base) there is a method f() with its implementation.
In the interface (C) there is also f() method exactlly like in the base class (Base).
The derived class (Derived) is implements the interface (C).
My question is:
Do i have to implement the method f() in the derived class (Derived) ?My guess is that you probably have to, even if it's just to call the parent's method.
This all sounds pretty sketchy. Why don't you just make the BASE class implement your interface? -
Calling methods from the Business Object BUS2032
Hi all,
Is it possible to call methods from the Business Object BUS2032.
If so, how can it be done??
Regards,Hi Marv,
you sure can. Here is an extract from the SAP Help. I found it at http://help.sap.com/saphelp_46c/helpdata/en/c5/e4ad71453d11d189430000e829fbbd/frameset.htm
<b>Programmed Method Call</b>
Call (fictitious) method Print of object type VBAK (sales document). The method receives the parameters Paperformat and Printertype as input.
* Call method Print of object type VBAK
* Data declarations
DATA: VBAK_REF TYPE SWC_OBJECT.
SWC_CONTAINER CONTAINER.
* Create object reference to sales document
SWC_CREATE_OBJECT VBAK_REF 'VBAK' <KeySalesDoc>
* Fill input parameters
SWC_CREATE_CONTAINER CONTAINER.
SWC_SET_ELEMENT CONTAINER 'Paperformat' 'A4'.
SWC_SET_ELEMENT CONTAINER 'Printertype' 'Lineprinter'.
* Call Print method
SWC_CALL_METHOD VBAK_REF 'Print' CONTAINER.
* Error handling
IF SY-SUBRC NE 0.
ENDIF.
Cheers
Graham -
Error after update : "Method 'Upgrade' does not have an implementation"
Hello,
After installing the last Updates for my SharePoint Farm 2013, I ran into an issue. When I try to connect to the site, I get this error :
Method 'Upgrade' in type 'Microsoft.SharePoint.WorkflowServices.WorkflowServiceApplicationProxy'
from assembly 'Microsoft.SharePoint.WorkflowServices, Version=15.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c' does not have an implementation.
And there is a lot of strange behaviours within my farm. I cannot run a psconfig, the services FIMService
and FIMSynchronizationService cannot start, I can see the category "Office 365" in Central Administration but I have a SharePoint Server 2013, not online or any 365 thing... And I cannot uninstall previous SharePoint Updates...
Any idea ?
Thanks in advance for your answer.
MikeHi Mike,
If you are using SharePoint 2013 Server edition, please re-download the
SharePoint Server 2013 SP1(KB2880552) instead of SharePoint Foundation version, then install it on the server and check results again, here is another post with similar
issue you can take a look.
http://social.technet.microsoft.com/Forums/sharepoint/en-US/ee5c9cee-2b8c-473a-adc6-05d74aac9511/error-after-update-installation-method-method-upgrade-in-type-?forum=sharepointadmin
http://blogs.technet.com/b/stefan_gossner/archive/2014/04/22/sp1-for-sharepoint-2013-has-been-rereleased.aspx
http://thesharepointfarm.com/2014/05/ms14-022-known-issues/
Thanks
Daniel Yang
TechNet Community Support -
Dynamic creation of class and calling methods
I've got and interface called Transformation and then two implementations called TxA and TxB, where TxA and TxB have their own attribtues and setter and getters for these attributes.
The question is, I need to create instances of TxA and TxB and called the setter and getters where I at runtime I only know the attribute to set, how can I create and instance and call the right getters and setters methods?
Thanks in advanceSmart money says your design sucks and needs to be rethought entirely. Can we get specifics?
Drake -
How to call methods from within run()
Seems like this must be a common question, but I cannot for the life of me, find the appropriate topic. So apologies ahead of time if this is a repeat.
I have code like the following:
public class MainClass implements Runnable {
public static void main(String args[]) {
Thread t = new Thread(new MainClass());
t.start();
public void run() {
if (condition)
doSomethingIntensive();
else
doSomethingElseIntensive();
System.out.println("I want this to print ONLY AFTER the method call finishes, but I'm printed before either 'Intensive' method call completes.");
private void doSomethingIntensive() {
System.out.println("I'm never printed because run() ends before execution gets here.");
return;
private void doSomethingElseIntensive() {
System.out.println("I'm never printed because run() ends before execution gets here.");
return;
}Question: how do you call methods from within run() and still have it be sequential execution? It seems that a method call within run() creates a new thread just for the method. BUT, this isn't true, because the Thread.currentThread().getName() names are the same instead run() and the "intensive" methods. So, it's not like I can pause one until the method completes because they're the same thread! (I've tried this.)
So, moral of the story, is there no breaking down a thread's execution into methods? Does all your thread code have to be within the run() method, even if it's 1000 lines? Seems like this wouldn't be the case, but can't get it to work otherwise.
Thanks all!!!I (think I) understand the basics.. what I'm confused
about is whether the methods are synced on the class
type or a class instance?The short answer is; the instance for non-static methods, and the class for static methods, although it would be more accurate to say against the instance of the Class for static methods.
The locking associated with the "sychronized" keyword is all based around an entity called a "monitor". Whenever a thread wants to enter a synchronized method or block, if it doesn't already "own" the monitor, it will try to take it. If the monitor is owned by another thread, then the current thread will block until the other thread releases the monitor. Once the synchronized block is complete, the monitor is released by the thread that owns it.
So your question boils down to; where does this monitor come from? Every instance of every Object has a monitor associated with it, and any synchronized method or synchonized block is going to take the monitor associated with the instance. The following:
synchronized void myMethod() {...is equivalent to:
void myMethod() {
synchronized(this) {
...Keep in mind, though, that every Class has an instance too. You can call "this.getClass()" to get that instance, or you can get the instance for a specific class, say String, with "String.class". Whenever you declare a static method as synchronized, or put a synchronized block inside a static method, the monitor taken will be the one associated with the instance of the class in which the method was declared. In other words this:
public class Foo {
synchronized static void myMethod() {...is equivalent to:
public class Foo{
static void myMethod() {
synchronized(Foo.class) {...The problem here is that the instance of the Foo class is being locked. If we declare a subclass of Foo, and then declare a synchronized static method in the subclass, it will lock on the subclass and not on Foo. This is OK, but you have to be aware of it. If you try to declare a static resource of some sort inside Foo, it's best to make it private instead of protected, because subclasses can't really lock on the parent class (well, at least, not without doing something ugly like "synchronized(Foo.class)", which isn't terribly maintainable).
Doing something like "synchronized(this.getClass())" is a really bad idea. Each subclass is going to take a different monitor, so you can have as many threads in your synchronized block as you have subclasses, and I can't think of a time I'd want that.
There's also another, equivalent aproach you can take, if this makes more sense to you:
static final Object lock = new Object();
void myMethod() {
synchronized(lock) {
// Stuff in here is synchronized against the lock's monitor
}This will take the monitor of the instance referenced by "lock". Since lock is a static variable, only one thread at a time will be able to get into myMethod(), even if the threads are calling into different instances. -
ABAP OOP / Calling Method ...Help
Trying out few oop codes....
While calling class instance methods and passing parameters, when to use the following syntax.
data: cvar type ref to class1.
cvar->method( exporting variable1 = value )
(or) some time i see sample codes with out key word 'exporting'
cvar->method( variable1 = value ) .
(or)
cvar->method( value ) .
(or) some times with key word CALL METHOD
CREATE OBJECT cvar
CALL METHOD cvar->method
EXPORTING
variable1 = value.
Tried out a uniform way of calling ,but getting errors.Any inputs please..
Thanks,
BvanBhavan,
First declare the class.
Implement the class.
Declare the Class reference variable
Create the class object.
call the method.
data: cvar type ref to class1.
CREATE OBJECT cvar
Calling Methods
To call a method, use the following statement:
CALL METHOD <meth> EXPORTING... <ii> =.<f i>...
IMPORTING... <ei> =.<g i>...
CHANGING ... <ci> =.<f i>...
RECEIVING r = h
EXCEPTIONS... <ei> = rc i...
The way in which you address the method <method> depends on the method itself and from where you are calling it. Within the implementation part of a class, you can call the methods of the same class directly using their name <meth>.
CALL METHOD <meth>...
Outside the class, the visibility of the method depends on whether you can call it at all. Visible instance methods can be called from outside the class using
CALL METHOD <ref>-><meth>...
where <ref> is a reference variable whose value points to an instance of the class. Visible instance methods can be called from outside the class using
CALL METHOD <class>=><meth>...
where <class> is the name of the relevant class.
When you call a method, you must pass all non-optional input parameters using the EXPORTING or CHANGING addition in the CALL METHOD statement. You can (but do not have to) import the output parameters into your program using the IMPORTING or RECEIVING addition. Equally, you can (but do not have to) handle any exceptions triggered by the exceptions using the EXCEPTIONS addition. However, this is recommended.
You pass and receive values to and from methods in the same way as with function modules, that is, with the syntax:
... <Formal parameter> = <Actual parameter>
after the corresponding addition. The interface parameters (formal parameters) are always on the left-hand side of the equals sign. The actual parameters are always on the right. The equals sign is not an assignment operator in this context; it merely serves to assign program variables to the interface parameters of the method.
If the interface of a method consists only of a single IMPORTING parameter, you can use the following shortened form of the method call:
CALL METHOD <method>( f).
The actual parameter <f> is passed to the input parameters of the method.
If the interface of a method consists only of IMPORTING parameters, you can use the following shortened form of the method call:
CALL METHOD <method>(....<ii> =.<f i>...).
Each actual parameter <f i > is passed to the corresponding formal parameter <i i >.
Pls. mark if useful -
SOAP Implementation missing methods
Hello,
I am developing a document based SOAP web service and I wish to add a
DOM Document to the SOAP Body. Looking at the Java 2 Platform
Enterprise Edition 1.4 specification on the Sun web site I have found
the following method "public SOAPBodyElement addDocument(Document
document)", which does exactly what I require. Although when I attempt
to call this method I get the following exception:
java.lang.AbstractMethodError:
weblogic.webservice.core.soap.SOAPBodyImpl.addDocument(Lorg/w3c/dom/Document;)Ljavax/xml/soap/SOAPBodyElement;
Has this method not been implemented in Weblogic 8.1? Any suggestions
would be very much appreciated.
Thanks, StuartHi Stuart,
The addDocument(org.w3c.dom.Document) method was introduced in SAAJ 1.2. The SAAJ
implementation in WLS 8.1 is version 1.1. SAAJ 1.2 will be supported in a future
service pack or release.
For now, you can still achieve what it sounds like you want to do (i.e. send the
XML contained in an org.w3c.dom.Document to a "document-style" web service, as
the immediate child element of the <SOAP-ENV:Body> element, in the SOAP request
message), using the javax.xml.rpc.Call object. You just need to call the setProperty(Call.OPERATION_STYLE,
"document") method, on the Call object you create in your web service consumer
code. You don't have to do this with a Stub model web service consumer, because
the WSDL will (or should) have a style="document" attribute, on the <soap:binding>
element :-)
Regards,
Mike Wooten
Stuart Williamson <[email protected]> wrote:
Hello,
I am developing a document based SOAP web service and I wish to add a
DOM Document to the SOAP Body. Looking at the Java 2 Platform
Enterprise Edition 1.4 specification on the Sun web site I have found
the following method "public SOAPBodyElement addDocument(Document
document)", which does exactly what I require. Although when I attempt
to call this method I get the following exception:
java.lang.AbstractMethodError:
weblogic.webservice.core.soap.SOAPBodyImpl.addDocument(Lorg/w3c/dom/Document;)Ljavax/xml/soap/SOAPBodyElement;
Has this method not been implemented in Weblogic 8.1? Any suggestions
would be very much appreciated.
Thanks, Stuart
Maybe you are looking for
-
Error While doing Goods Reciept
Hi all, While doing goods reciept for a PO we get an error"RFC destination required for GTS:it also says to see Note385830. Kindly assist on the same. Thanks, Adarsh N
-
Updated to ios 7.1, now my ipod screen is glitching!
So, I updated to ios 7.1 the other day and now I feel like my ipod is quiting on me. I will be doing something and the screen will glitch out of nowhere (screen gets all screwy and eventually gets dark and turns off). Sometimes it wont even unlock no
-
Css layout or style sheet not showing table layout
When I was working on my website I noticed that my tables don't show up in the browser of my site, they do however, show up in the dreamweaver design so I am wondering if when I was making changes somehow to the site if something in the css layout or
-
Contact Sheet II, Picture Package, & other options are grayed out on File menu
I just bought Photoshop Elements 11 yesterday, and Contact Sheet II, Picture Package, & other options are grayed out on the File menu.
-
After scheduling the PCs, I got a warning message "No Data available" in a pc and the pc run stopped when it was loading Program Definition because there was no data available in R/3. I have changed the infopackages in developpment (if warnings => su