Can we call a webservice using standalone java application ?
Hi friends,
Can we call configurd webservice in xi , using standalone java application by just giving url of webservice ?
OR
Only by means of WEBDynapro we can call ?
Can you please tell me the answer for this .
Regards .,
V.Rangarajan
HI Ranga Rajan
well, If at all if you have webservice...you can import that werbserivce as External definition in to IR.
How to import:
1) Go to IR and and move to your requied component and there you can see the option called imported objects...select on imported objects where you can give the name and you can select the webservices which you want to use it.
2) Hope you are aware of that a werbservice will have the request and response.
3) Create the mapping program accroding to your requirement.
Go through blogs of Bhavesh and Naveen which talks about calling webservice in a specific condition:
Webservice Calls From a User Defined Function - /people/bhavesh.kantilal/blog/2006/11/20/webservice-calls-from-a-user-defined-function
Consuming/Calling webservices from DataBases - /people/sap.user72/blog/2005/10/20/consumingcalling-webservices-from-databases
Also check this help file on Web Services:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/336365d3-0401-0010-9884-a651295aeaa9
Cheers..
Vasu
<i>** Reward Points if found useful **</i>
Similar Messages
-
How to call SAP Webservice in standalone java program
Hi,
In our Java application, we want to use the SAP Webservices. I dont know much about authentication mechanism used by SAP. Can any one please help me with any sample code how to Call SAP webservice in Standalone Jave Program. I searched alot on the web regarding this, but helpless. Please help me.
Thanks,
MohanHi Mohan,
You need an account for the ES Workplace. I'm afraid this is not free, e.g. check [SAP NetWeaver, Composition Subscription|https://www.sdn.sap.com/irj/sdn/subscriptions/composition].
But I thought you wanted to play with a WSDL [you already had at hand|Sample code to access BAPI Web services from JAVA required;? -
Creating webservice using webdynpro java calling bapi from r/3
hi all,
as i am new to this area can anyone provide me a guide to create a simple webservice using webdynpro java to call bapi's from r/3?
i want to consume the created webservice on a .net client.
Thanks in advance,
RaghunandanYou can use the SAP .NET Connector to do it.
Download from [http://service.sap.com/connectors|http://service.sap.com/connectors]. -
How to call web-service using only java code
Hello, how to call web-service using only java code. I can call it from BPM process or Web Dynpro Java Application, but if I need to call it from ejb component?
I'm found answer:
Java and SAP Portal blog: How to call web service from java code example -
RE: How can I call Windows .DLL components in Java
Hi, there,
I have a wondows dll component registered on my server. I want to call this componet in my Java application(Servlet). Could you tell me the syntex or is this possible to do in this way?
TIA,
XinThank you for your reply. Did you suggest using JNI? Since this DLL is a comercial component and we can not recompile or modify it, I donot know how to use it. Could you give me some more detail ?
Thank you,
Xin
You can use either of the load or loadLibrary methods
in java.lang.System. The library has to be loaded at
the very beginning of loading of the class , if the
class were to access any native method in the
library.
Hence, it shoud be in a static block.
Syntax-
static {
try{
System.load("C:\\x.dll");
}catch( Exception e ) {
System.out.println(e); -
Standalone java application that calls Db2
Hi,
I am trying to use coherence in my standalone java
application that makes JDBC calls to Db2.
The sql statemet is like below:
select lastName,firstName from employee where empNo=2224;
In the application,I would read from the flat file say
200 account numbers and query the database.
If I have queried the database already with the given
account,I want to retreive from the cache.
I am having real trouble in getting this work with
coherence software.
Any psudo code in this regard will help me a lot.
Thanks
DJonHi Jon,
Thanks for the mail.I am struck in
implementing the coherence in the sample program.
any help in this regard is appreciated.
Thanks
DJon
Below is the sample program that works without coherence.go to db2 and get the information.
import java.sql.*;
import java.util.*;
public class DB2Client
static void printColumn(String in)
System.out.print(in);
System.out.print(" | ");
public static void main(String[] args)
Driver myDriver = null;
Connection myConnection = null;
try
myDriver =
(Driver)Class.forName("com.ibm.db2.jcc.DB2Driver").newInstance();
myConnection =
DriverManager.getConnection("jdbc:db2:sample","dujon","jeff");
PreparedStatement myStatement
= myConnection.prepareStatement("SELECT
empno,firstnme,lastname FROM employee where empno > ?");
myStatement.setString(1,"00");
ResultSet
myResults=myStatement.executeQuery();
while (myResults.next())
printColumn(myResults.getString("empno") + "");
printColumn(myResults.getString("firstnme") + "");
printColumn(myResults.getString("lastname"));
System.out.println();
} catch (Exception e)
e.printStackTrace();
} finally
try
if (myConnection != null)
myConnection.close();
} catch (Exception e)
Now,to implement the above sample with
coherence I have written 2 programs.
1. TangosolDB2Cache.java
2. TestDB2Cache.java
import com.tangosol.net.cache.CacheStore;
import com.tangosol.util.Base;
import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
* An example implementation of CacheStore
* interface.
* @author erm 2003.05.01
public class TangosolDB2Cache extends
Base implements CacheStore
// ----- constructors
* Constructs DBCacheStore for a given
database table.
* @param sTableName the db table name
public TangosolJDBCCache(String
sTableName)
m_sTableName = sTableName;
configureConnection();
* Set up the DB connection.
protected void configureConnection()
try
Class.forName("com.ibm.db2.jcc.DB2Driver");
m_con =
DriverManager.getConnection(DB_URL, DB_USERNAME, DB_PASSWORD);
m_con.setAutoCommit(true);
catch (Exception e)
throw ensureRuntimeException(e,
"Connection failed");
// ---- accessors
* Obtain the name of the table this
CacheStore is persisting to.
* @return the name of the table this
CacheStore is persisting to
public String getTableName()
return m_sTableName;
* Obtain the connection being used to
connect to the database.
* @return the connection used to
connect to the database
public Connection getConnection()
return m_con;
// ----- CacheStore Interface
* Return the value associated with the
specified key, or null if the
* key does not have an associated
value in the underlying store.
* @param oKey key whose associated
value is to be returned
* @return the value associated with
the specified key, or
* <tt>null</tt> if no value is
available for that key
public Object load(Object oKey)
Integer iKey = (Integer)key;
return query("select
lastName,firstName from employee where empNo = " + iKey);
* Store the specified value under the
specific key in the underlying
* store. This method is intended to
support both key/value creation
* and value update for a specific key.
* @param oKey key to store the
value under
* @param oValue value to be stored
* @throws
UnsupportedOperationException if this implementation or the
* underlying store is
read-only
public void store(Object oKey, Object
oValue)
mycacheTable(oKey,oValue);
public void erase(Object oKey)
public void eraseAll(Collection
colKeys)
throw new
UnsupportedOperationException();
public Map loadAll(Collection colKeys)
throw new
UnsupportedOperationException();
public void storeAll(Map mapEntries)
throw new
UnsupportedOperationException();
// ----- data members
Hashtable mycacheTable = new Hashtable(1000);
* The connection.
protected Connection m_con;
* The db table name.
protected String m_sTableName;
* Driver class name.
private static final String DB_DRIVER =
"org.gjt.mm.mysql.Driver";
* Connection URL.
private static final String DB_URL =
"jdbc:db2:sample";
* User name.
private static final String DB_USERNAME =
"dujon";
* Password.
private static final String DB_PASSWORD =
"jeff";
TESTING THE ABOVE PROGRAM
import com.tangosol.net.cache.CacheStore;
import com.tangosol.util.Base;
import
com.tangosol.net.cache.MapCacheStore;
import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
public class TestDB2Cache {
public static void main(String args[]){
TangosolJDBCCache mycache = new
TangosolDB2Cache("employee");
Connection
con=mycache.configureConnection();
MapCacheStore cacheStuff = new
MapCacheStore(HashMap hmap);
String[] employeeNumbers =
{"000010","000020","000030","000040","000050"};
// find whether it has been cached already
for(int
i=0;i<employeeNumbers.length();i++){
oCurValue =
cacheStuff.load(employeeNumbers);
if(oCurValue == null){
// execute SQL statement
con.executeQuery(oCurKey);
else
//get from cache the values and return
cacheStuff.load(oCurKey); -
Can we run the batch file using simple java application
Hello sir,
we want to run the batch file using simple java application. i tried with some example, we run the exe files but not batch file.
Runtime r = Runtime.getRuntime();
r.exec("D:\\jboss\\bin\\run.bat");
My application is server will run when we run the java appliation.
any suggestion? plz give me the solutionsyes you can run html file
WEB.SHOW_DOCUMENT is a built-in that is used in Forms to call URL from a Web Form. It works much like the similar way that a link on an HTML page works and it takes two arguments, one is URL and second one is TARGET, in your case use following.
WEB.SHOW_DOCUMENT('http://channas.iil.informatics.lk:8890/forms/frmservlet?config=abc.html', '_blank');
Hope this will work for you
Abbas -
Revision: 9838
Author: [email protected]
Date: 2009-08-31 11:27:50 -0700 (Mon, 31 Aug 2009)
Log Message:
Bug: BLZ-416 - Can bypass checks for which channel and protocol a destination can be called over by using NetConnection instead of BlazeDS messaging.
QA: Yes
Doc: Yes - note the new enforce-endpoint-validation setting.
Details: Added the following config setting:
Ticket Links:
http://bugs.adobe.com/jira/browse/BLZ-416
Modified Paths:
blazeds/trunk/modules/common/src/flex/messaging/config/ConfigurationConstants.java
blazeds/trunk/modules/core/src/flex/messaging/MessageBroker.java
blazeds/trunk/modules/core/src/flex/messaging/config/MessagingConfiguration.java
blazeds/trunk/modules/core/src/flex/messaging/config/ServerConfigurationParser.java
blazeds/trunk/modules/core/src/flex/messaging/config/SystemSettings.java -
How can i call forpro prg file from java
Hai friends,
I have a doubt,clear it.
how can i call forpro prg file from java file
by,
N.VijayThanks to your reply,
I have some print statements in my foxpro program file.
Then i like to invoke that foxpro file from my java file
This want i want..,
by,
N.Vijay -
Report Engine SDK - Rbean usage in standalone java application
Post Author: Berndb
CA Forum: JAVA
In BOXI the rebean sdk is available in the Report Engine SDK.
I remember that in the 6.5 world one could use RBEAN interface in a standalone java application.
Is this still possible in BOXI R2?
If yes can you supply a sample classpath which shows all libraries that needs to be assigned.
Thanks in advance.
berndPost Author: datahog
CA Forum: JAVA
Ted's right, but for fun, take what you need from:
<installation drive>:\Program Files\Business Objects\Tomcat\webapps\businessobjects\enterprise115\desktoplaunch\WEB-INF\lib
and de-reference what's not needed when your project's done, but be careful.
I've actually done some standalone Swing-based webi report renderers using https://xhtmlrenderer.dev.java.net/ + docHTMLView.getStringpart + TagSoup -
To support certficate based client authentication using 2-way SSL from a standalone java application which uses JNDI and JSSE1.0.2 to connect to an SSL enabled LDAP Server how do we configure the certmap.conf?Is there any additional setup required at the LDAP Server side apart from enablinf SSL with the option"Required Client Authentication" enabled.The 2 way SSL handshake goes through but the access log file (After configuring the certmap.conf for the issuer DN of the client certficate etc..)shows SSL failed to LDAP DN?But inspite of this access log error the Java client does get an SSL Connection object with which it is able to connect to the LDAP.IS the certmap.conf file being looked up by the LDAP Server at all?
have you out.flush() and out.close() before you call connection.getInputStream()?
-
How to get Portal user from a standalone Java application
Hi,
I have a standalone Java application from where I need to fetch the Portal User Information like userid and email id.
I am using the below line of code
iUser = UMFactory.getUserFactory().getUserByLogonID("e017939");
I have included the jar file com.sap.security.api , But it was giving me the below exception
java.lang.NoClassDefFoundError: com/sap/tc/logging/Location
at com.sap.security.api.UMFactory.<clinit>(UMFactory.java:55)
at com.am.wcas.java.mailscheduler.kmaccess.FetchDataFromKM.getiUser(FetchDataFromKM.java:29)
at com.am.ScheduleEmails.main(ScheduleEmails.java:89)
and I am getting a pop Up message from the Java Virtual Machine Launcher, saying a Fatal Exception has occured and the Program will exit.
Then I went throught he SDN threads and they asked me to include the
logging.jar and com.sap.security.perm.api .
I Included them, then also, it is giving me Exception
java.lang.NoClassDefFoundError: com/sap/engine/lib/logging/LoggingHelper
at com.sap.security.api.UMFactory.<clinit>(UMFactory.java:56)
at com.am.FetchKMData.main(FetchKMData.java:30)
Exception in thread "main"
and I am getting a pop Up message from the Java Virtual Machine Launcher, saying a Fatal Exception has occured and the Program will exit.
Kindly let me know if it is possible to access the User info using UMFactory in a standalone Java application. If yes kindly let me know where i am going wrong.
Regards,
Shilpa B.VHi Shilpa,
1. Check that you have added com.sap.security.api within the Your Project>Libraries folder (under navigation tab) and also added jars in the build path of the Your Project under project>properties>Build Path.
2. In case you have a DC instead of Web Dynpro Project then you have to add the com.sap.security.api under Your DC>Used DCs and have compile time and runtime dependency added.
Here java.lang.NoClassDefFoundError is caused basically due to only build time dependency added and reference to the jar missing at runtime. Rest the code to retrieve the current user id using UME API and getUserByLogOnID("....") method with/without portal environment would not be an issue at all.
Regards,
Tushar SInha -
Reading a XML file in a standalone java application
Hi,
What are my options if I have a standalone java application running outside any app. server and I need to read an XML file, probably read some of the attributes in the file...? Please explain clearly as I'm new to this. Appreciate your help.
Thanks,
Mahdadnope you don't need a DTD
you have to write your Java code in a way that doesn't rely too much on the structure:
- avoid getFirstChild().getFirstChild()... because you know that this element is first grandson of that element)
- prefer using getElementByTagName() or some XPath() API
but if the XML completely changes, well, yeah, you have to do some programmation: better think well your document structure in the beginning. -
Accessing JNDI from Standalone JAVA application
Hi,
I want to access the JNDI tree from my
standalone java application. (ie I have
one weblogic server contains all my ejbs and client - swing - application which accesses that. )
Here I don't want to ship weblogic.jar
file to the client with swing application
because it is of ~ 20 MP.
Any other way to specify the INITIAL_CONTEXT_FATORY class.
My code is
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL, DTEConfig.PROVIDER_URL);
But since I don't want to give the
weblogic.jar bundle to my client, how he
could manage this with out weblogic.jndi.WLInitialContextFactory
with him to get the initialContext ?
-Rajan KumarYou can strip out the jndi related classes from the weblogic.jar which can be distributed
to the client installation. I don't think you will be violating any bea licensing
policies with this.
Rajan Kumar <[email protected]> wrote:
Hi,
I want to access the JNDI tree from my
standalone java application. (ie I have
one weblogic server contains all my ejbs and client - swing - application
which accesses that. )
Here I don't want to ship weblogic.jar
file to the client with swing application
because it is of ~ 20 MP.
Any other way to specify the INITIAL_CONTEXT_FATORY class.
My code is
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL, DTEConfig.PROVIDER_URL);
But since I don't want to give the
weblogic.jar bundle to my client, how he
could manage this with out weblogic.jndi.WLInitialContextFactory
with him to get the initialContext ?
-Rajan Kumar -
Can u tell some source codes of java application
can u tell some source codes of java application?
i want to get some source codes .such as a proxy source code .
any help will be appreciated.hi
check www.rgagnon.com for more source code in java.
regards
Pradheep
Maybe you are looking for
-
the screen on my iPhone is frozen and I can access apps through Siri. The touch screen works within the apps but not in the home screen. What do I do?
-
How to access my files from damaged boot drive?
Hello Guys , I need your help to get the files from my Macbook , The OS cant start and I need a way to boot from some external to copy my files. I have old time machine back up from last april , but it cant restore because the drive is full. is there
-
No net value and quantity in the DSO
Hi Gurus, I would like to ask questions related to SRM Data sources. In the SRM data source 0BBP_TD_SC_1 related to shopping carts, we have the concept of GUID. Here for main SC number there is a GUID, but for item level there is a different GUID. Wh
-
Adding menus and submenus to Photoshop
Hello, Is it possible to add a menu and several submenus to this menu under, for example, the Photoshop main "window" menu?. It is possible to add then dynamically? Thank you very much.
-
Problem Recording Video: Automatic Screen Cropping
My Skype video recording is being automatically cropped, and I don't know why. I record a number of Skype video interviews and before I begin, I make sure that the person is completely centered. However, after I view the recording, I often find that