How to call webservice using java client
Hi,
I am new to webservice related stuff.Can any body help me.
How can i call the webservice using simple java programing using jdeveloper tool is very useful for me.
Thanks
venuj
user10394151 wrote:
Hi,
I am new to webservice related stuff.Can any body help me.
How can i call the webservice using simple java programing using jdeveloper tool is very useful for me.
Thanks
venujTry this simple webservice client.
You will need apache-axis.jar in your classpath. The following client is apache axis based. A similiar client can be built also using the JAX-WS only[without apache-axis.jar].
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;
public class WEBSERVICE_CLIENT{
public static void main(String [] args) {
try {
String endpoint ="<YOUR WS ENDPOINT>";
Service service = new Service();
Call call = (Call) service.createCall();
// YOU CAN SET VARIOUS PROPERTIES IN THE "CALL" OBJECT...LIKE
// USERNAME,PASSWORD,PROPERTIES OF HTTP HEADER. SEE "CALL" OBJECT'S API FOR MORE PROPERTIES.
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("<YOUR WS SERVICE NAMESPACE>", "<WS SERVICE TO BE INVOKED>"));
String msg = (String) call.invoke( new Object[] { "data" } );
System.out.println("RETURNED MESSAGE : "+msg);
} catch (Exception e) {
System.err.println(e.toString());
}
Similar Messages
-
How to call webservice using jdev9i
Hi gurus and experts,
i need to consume a webservice using oaf. with great effort finally i created stub using axis s/w.
now i dont know how to use the stub in jdev.where to write the code and what to write.iam strucked :-( .
since there were no sample tutorial about how to call webservice from jdev9i, iam struggling to make.iam jus a starter.
and while googling i came to know that stubs can be created using jdev9i .but when i see new-->webservices--web service stub it is greyed out.
i have 2 questions now:
1)if stub created using axis can it be used in jdev9i? if yes ,please tell me how? any tutorial links also helps me.
2)if the stubs should be created only by jdev9i so that webservices can be called using jdev,then please guide me how to make it.
i need some helping hands from u guys.
Thanks a lot
Edited by: 881533 on Oct 25, 2011 2:34 AM
Edited by: 881533 on Oct 25, 2011 2:37 AMHello sir,
i got following reply:
<returnRecordResponse xmlns="http://xyz" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<returnResult>Error_request</returnResult>
</returnRecordResponse>
but correct response is
<returnRecordResponse xmlns="http://xyz" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<returnResult>Success</returnResult>
</returnRecordResponse>
can you tell me correction in the code which i have put on the forum?or tell me other way to call webservice? -
How to create Webservice using java
Hi Experts,
I am very new to Visual composer, can any one of you suggest how to create a webservice using java so that i can use that webservice in Visual Composer application.If it is possible please give me detailed description about it.
Regards,
Prasanna.Hi Prasanna,
See if my article is of any use to you:
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/b00917dc-ead4-2910-3ebb-b0a63e49ef10">How to Create a Web Service using an Enterprise JavaBean</a>
For creating Web Services, you won't need to do the MS SQL Part explained in my doc. You can just concentrate on the part where i explain how to create a Web Service using an EJB.
Bye
Ankur -
How to call webservice using flex?
Hello,
i want to call webservice in flex.i tryied following code.but it is not giving correct response.what is wrong with this code?
can anybody tell me ,how to call webservice in flex?
Code:
<mx:Script>
<![CDATA[
public function button1_clickHandler(event):void
ws.returnRecord(para1,para2);//i am sending two parameter to returnRecord service here
public function remotingCFCHandler(event:ResultEvent):void
trace(event.result);
]]>
</mx:Script>
<mx:WebService
id="ws"
wsdl="http://localhost:8500/flexapp/returnusers.cfc?wsdl">
<mx:operation name="returnRecords" resultFormat="object"
fault="mx.controls.Alert.show(event.fault.faultString)"
result="remotingCFCHandler(event)"/>
<mx:Button label="Go" fontWeight="bold" click="button1_clickHandler(event)"/>Hello sir,
i got following reply:
<returnRecordResponse xmlns="http://xyz" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<returnResult>Error_request</returnResult>
</returnRecordResponse>
but correct response is
<returnRecordResponse xmlns="http://xyz" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<returnResult>Success</returnResult>
</returnRecordResponse>
can you tell me correction in the code which i have put on the forum?or tell me other way to call webservice? -
How to call webservice using standalone application
Hi,
Actually i am trying to connect with one free webservice using client. but i am uanble to get the result and it is throwing the Exception.Exception is Execution failed. Exception: java.net.ConnectException: Connection timed out: connection reset
i am using the following code.
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.utils.Options;
import javax.xml.namespace.QName;
import java.io.*;
public class AddFunctionClient {
public static void main(String [] args) {
try {
String endpoint = "http://www.startvbdotnet.com/web/sample2.asmx?wsdl";
System.setProperty("http.proxyHost", proxyHost);
System.setProperty("http.proxyPort", portNumber);
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName(endpoint, "add"));
System.out.println("connected");
System.out.println("value is"+call.invoke(new Object[]{new Integer(10),new Integer(20)}));
} catch (Exception e) {
System.err.println("Execution failed. Exception: " + e);
can any one help on thisHi,
If your JAVA Application is Web based application, you can expose it as Webservice.
JAVA People will pick the data from Dbase using their application and will send the data to XI by using our XI Details like Message Interface and Data type structure and all.
So we can Use SOAP Adapter or HTTP in XI..
If you use HTTP for sending the data to XI means there is no need of Adapter also. why because HTTP sits on ABAP Stack and can directly communicate with the XI Integration Server Directly
If you are dealing with the Webservice and SAP Applications means check this
Walkthrough - SOAP XI RFC/BAPI
REgards
Seshagiri -
How to call webservice from Java application
Hi XI gurus
Pls let me know how to call a webservice from Java application.
I wanted to build synchronous interface from Java Application to SAP using SAP XI
For example, i need to create Material master from Java application and the return message from SAP, should be seen in Java application
Regards
MDHi,
If your JAVA Application is Web based application, you can expose it as Webservice.
JAVA People will pick the data from Dbase using their application and will send the data to XI by using our XI Details like Message Interface and Data type structure and all.
So we can Use SOAP Adapter or HTTP in XI..
If you use HTTP for sending the data to XI means there is no need of Adapter also. why because HTTP sits on ABAP Stack and can directly communicate with the XI Integration Server Directly
If you are dealing with the Webservice and SAP Applications means check this
Walkthrough - SOAP XI RFC/BAPI
REgards
Seshagiri -
How to call webservices function - java importer 6i -Duncan?
I've imported methods of a webservice from salcentral following instructions in otn.
Now I need to figure out how to call the resulting function in forms
Here is the function, the pl/sql error is wrong number or type of arguments
Anyone done this and know how to get the function signature correct?
I want to call checkemail
PACKAGE BODY MXCheckerStub IS
-- DO NOT EDIT THIS FILE - it is machine generated!
cls ORA_JAVA.JCLASS;
fid ORA_JAVA.JFIELD;
mid ORA_JAVA.JMETHOD;
args JNI.ARGLIST;
-- Constructor for signature ()V
FUNCTION new RETURN ORA_JAVA.JOBJECT IS
BEGIN
cls := JNI.GET_CLASS('mypackage/MXCheckerStub');
mid := JNI.GET_METHOD(FALSE, cls, '<init>', '()V');
args := NULL;
RETURN (JNI.NEW_OBJECT(cls, mid, args));
END;
-- Method: CheckEmail (Lorg/w3c/dom/Element;)Ljava/util/Vector;
FUNCTION CheckEmail(
obj ORA_JAVA.JOBJECT,
a0 ORA_JAVA.JOBJECT) RETURN ORA_JAVA.JOBJECT IS
BEGIN
cls := JNI.GET_CLASS('mypackage/MXCheckerStub');
mid := JNI.GET_METHOD(FALSE, cls, 'CheckEmail', '(Lorg/w3c/dom/Element;)Ljava/util/Vector;');
args := JNI.CREATE_ARG_LIST(1);
JNI.ADD_OBJECT_ARG(args, a0, JNI.GET_CLASS('org/w3c/dom/Element'));
RETURN JNI.CALL_OBJECT_METHOD(obj, mid, args);
END;I would try to take an aproach where I'll generate a stub for the WSDL in JDeveloper, and also write a
Java class that calls this stub and return a simple variable (String, int, or boolean).
Then I would call this class from Forms.
I believe this would make it easier. -
How to Call Webservicer using Visuval composure Ce 7.1 server
Hi ,
We are created in ABAP , they r exposed in WSDL , if i have to call That web services using visuval composure please ASAP can u send , how to call WSDL In CE 7.1 Serve
Thnks & Regards,
SureshHi
you can try this links:
http://help.sap.com/saphelp_nwce10/helpdata/en/9f/9985f72084483cb316a3c2322fb090/content.htm
(here look for the therm Creating Web Service Physical Destinations that points to :
http://help.sap.com/saphelp_nwce10/helpdata/en/45/635dd614d73bdbe10000000a1553f7/content.htm
best regards,
v s
Edited by: v s on Dec 4, 2008 12:22 PM -
How to call webservices using soap in xi
Hello
I am tring to work on webserivces,bascially i am not having any knowledge on webservices,i have seen the documentation & i know how to configure soap adapter & how to define webservice in integration directory.can any one please help me out how to work with webservices & good documentation on webservices & soap.
Thanks
RajeshHi Rajesh,
Use server(tomcat server) or plain html coding for defining webservices....
check sample webservice coding
Purchase Order Web Application
dispDate(0)
Purchase Order Input Parameters:
Document Type:
Standard PO
Vendor Number:
Purchase Order Date:
Purchasing Material:
Delivery Date:
Quantity:
NetPrice:
Unit of Measurement:
PCs
PriceUnit:
Results:
/code
And gothrough the following weblogs which will be useful...
/people/siva.maranani/blog/2005/03/01/testing-xi-exposed-web-services
/people/thomas.jung3/blog/2005/06/05/web-services-the-case-of-the-missing-soap-action-header
/people/siva.maranani/blog/2005/09/03/invoke-webservices-using-sapxi
Hope u get some idea...
Regards,
Sridhar
Message was edited by: sridhar reddy kondam -
How to create database connection and how to call it using Java
Hi,
Good day! I'd like to know how I can create a db connection in JDev, then use this connection to retrieve data using a Java Class? I've seen using New Gallery > Database Connection. But I'm not sure how I can access this connection using Java and display some output from the retrieved records.
Any steps/tutorial link is appreciated.
Thanks in advance,
RianHi,
If you need to access the connection in the entity object then refer http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/bcadvgen.htm#BABEIFAI i.e in MODEL.
But if you want to access connection in ViewController part of application then you need to do it manually.For this i am giving you my code for reference.------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.faces.context.FacesContext;
import oracle.jdbc.pool.OracleDataSource;
public class DataHandler {
String jdbcUrl = null;
String userid = null;
String password = null;
Connection conn;
public static final String CONNECTION_STRING =
FacesContext.getCurrentInstance().getExternalContext().getInitParameter("connectionString");
public static final String USER_NAME =
FacesContext.getCurrentInstance().getExternalContext().getInitParameter("userName");
public static final String PASSWORD =
FacesContext.getCurrentInstance().getExternalContext().getInitParameter("password");
public DataHandler(String jdbcUrl, String userid, String password,
boolean shouldConnect) throws SQLException {
this.jdbcUrl = jdbcUrl;
this.userid = userid;
this.password = password;
if (shouldConnect) {
connect();
public void connect() throws SQLException {
OracleDataSource ds;
ds = new OracleDataSource();
ds.setURL(jdbcUrl);
conn = ds.getConnection(userid, password);
public Connection getConnection() {
return conn;
public ResultSet executeQuery(String sql) throws SQLException {
Statement s = conn.createStatement();
return s.executeQuery(sql);
public void closeConnection() throws SQLException {
if (!conn.isClosed()) {
conn.close();
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -
I have a web application.deployed on Tomcat.
the application(JSP page) accepts a login name and password..it works fine from Internet Explorer.
i have a java client and i want to login into the above application from the java client.I specify the login and password in the java client.
I want that the user should be logged in to the web applicationUse the Apache Jakarta Commons HttpClient package which has the ability to handle web application authorization. It is covered in the HttpClient documentation.
-
How to show busy cursor when call webservice using as?
I want to call webservice using script,but i don't know how
to show busy cursor.please help meShow busy cursor:
>>>
CursorManager.setBusyCursor();
<<<
and hide it:
>>>
CursorManager.removeBusyCursor();
<<<
Don't forget to catch all events of the web-service to
securely remove the busy cursor. Especially, you might wish to
handle events of the 'results received' and the 'faults appeared'
logical results. -
Hi',
I am trying to call OSB from java client,
The OSB proxy Service type is "WSDL Web Service", I am able to get response from SOAP UI with below request, Please help me with Java code,
I have been Googling a lot for this however didnt got enough.
Thanks
Yatan
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://core.xxx.com/schema/ServiceHeader/V1.0" xmlns:v11="http://core.xxx.com/schema/Customer/V1.0" xmlns:v12="http://core.xxx.com/schema/Customer/V1.0">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-2" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>weblogic</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">welcome1</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
<v1:GMWSHeader>
<v1:SourceId>String</v1:SourceId>
<v1:TransactionId>String</v1:TransactionId>
<v1:TransactionTimeStamp>1967-08-13</v1:TransactionTimeStamp>
<v1:ServiceVersion>LATEST</v1:ServiceVersion>
</v1:GMWSHeader>
</soapenv:Header>
<soapenv:Body>
<v11:GetDetailsRequest>
<v11:Condition>
<v12:SellingSource>?</v12:SellingSource>
<v12:FulfillingFCNNbr>?</v12:FulfillingFCNNbr>
</v11:Condition>
</v11:GetDetailsRequest>
</soapenv:Body>
</soapenv:Envelope>Thanks Guys, I tried the ways you mentioned I am getting below error, this error is coming in both weblogic clientgen and webservice proxy from jdeveloper,
I understand that this error has something to do with my process however not sure why is it coming, I will really appreciate if you can provide me some pointers.
error:
Buildfile: C:\JDeveloper\OSBClient\TestOSBClient\build.xml
javaFromWSDL:
[clientgen]
*********** jax-ws clientgen attribute settings ***************
wsdlURI: http://localhost:8001/xx/som/contracts/CustomerContract?wsdl
packageName : com.osb.client
destDir : C:\OSB
*********** jax-ws clientgen attribute settings end ***************
[clientgen] Consider using <depends>/<produces> so that wsimport won't do unnecessary compilation
[clientgen] parsing WSDL...
[clientgen]
[clientgen]
[clientgen] [ERROR] A class/interface with the same name "com.osb.client.SOMMessage" is already in use. Use a class customization to resolve this conflict.
[clientgen] line 89 of http://localhost:8001/xx/som/contracts/CustomerContract?SCHEMA%2FSOMResources%2FXSD%2FSOMCommon
[clientgen]
[clientgen] [ERROR] (Relevant to above error) another "SOMMessage" is generated from here.
[clientgen] line 51 of http://localhost:8001/xx/som/contracts/CustomerContract?SCHEMA%2FSOMResources%2FXSD%2FSOMCommon
[clientgen]
[clientgen] [ERROR] A class/interface with the same name "com.osb.client.TaskCompletionMessage" is already in use. Use a class customization to resolve this conflict.
[clientgen] line 82 of http://localhost:8001/xx/som/contracts/CustomerContract?SCHEMA%2FSOMResources%2FXSD%2FSOMCommon
[clientgen]
[clientgen] [ERROR] (Relevant to above error) another "TaskCompletionMessage" is generated from here.
[clientgen] line 76 of http://localhost:8001/xx/som/contracts/CustomerContract?SCHEMA%2FSOMResources%2FXSD%2FSOMCommon
[clientgen]
[clientgen] [ERROR] Two declarations cause a collision in the ObjectFactory class.
[clientgen] line 89 of http://localhost:8001/xx/som/contracts/CustomerContract?SCHEMA%2FSOMResources%2FXSD%2FSOMCommon
[clientgen]
[clientgen] [ERROR] (Related to above error) This is the other declaration.
[clientgen] line 51 of http://localhost:8001/xx/som/contracts/CustomerContract?SCHEMA%2FSOMResources%2FXSD%2FSOMCommon
[clientgen]
[clientgen] [ERROR] Two declarations cause a collision in the ObjectFactory class.
[clientgen] line 82 of http://localhost:8001/xx/som/contracts/CustomerContract?SCHEMA%2FSOMResources%2FXSD%2FSOMCommon
[clientgen]
[clientgen] [ERROR] (Related to above error) This is the other declaration.
[clientgen] line 76 of http://localhost:8001/xx/som/contracts/CustomerContract?SCHEMA%2FSOMResources%2FXSD%2FSOMCommon
[clientgen]
BUILD FAILED
weblogic.wsee.tools.WsBuildException: Error running JAX-WS clientgen: null
at weblogic.wsee.tools.clientgen.jaxws.ClientGenImpl.execute(ClientGenImpl.java:175)
at weblogic.wsee.tools.anttasks.ClientGenFacadeTask.execute(ClientGenFacadeTask.java:244)
at weblogic.wsee.tools.anttasks.ClientGenTask.execute(ClientGenTask.java:365)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatinxxethodAccessorImpl.invoke(DelegatinxxethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at org.apache.tools.ant.Main.runBuild(Main.java:758)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.Main.start(Main.java:179)
at org.apache.tools.ant.Main.main(Main.java:268)
Caused by: Error starting wsimport:
at com.sun.tools.ws.ant.WsImport2.execute(WsImport2.java:757)
at weblogic.wsee.tools.clientgen.jaxws.ClientGenImpl.execute(ClientGenImpl.java:169)
... 19 more
Caused by: com.sun.tools.ws.wscompile.AbortException
at com.sun.tools.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:136)
at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2255)
at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:194)
at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:140)
at com.sun.tools.ws.wscompile.WsimportTool.buildWsdlModel(WsimportTool.java:261)
at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:203)
at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:188)
at com.sun.tools.ws.ant.WsImport2.execute(WsImport2.java:738)
... 20 more
Total time: 3 seconds -
Exception while invoking webservices using Dynamic client without WSDL
Hi All,
I am getting the below exception while invoking webservices using Dynamic client without WSDL.
javax.xml.rpc.soap.SOAPFaultException: Exception during processing: java.lang.RuntimeException: Missing license file for: WebLogic Platform 8.1 (see Fault Detail for stacktrace)
at weblogic.webservice.core.ClientDispatcher.receive(ClientDispatcher.java:313)
at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:144)
at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:457)
at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:443)
at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:558)
at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:411)
at atthi.webservice.TestWSWithWSDL.main(TestWSWithWSDL.java:41)
Exception in thread "main"
Please find my source file below....
import javax.xml.rpc.ServiceFactory;
import javax.xml.rpc.Service;
import javax.xml.rpc.Call;
import javax.xml.rpc.ParameterMode;
import javax.xml.namespace.QName;
public class TestWSWithoutWSDL {
public static void main(String[] args) {
try{
String address = "<WSDL's SOAP Address>";
String namespaceURI = "<namespaceURI>";
String serviceName = "<serviceName>";
String portName = "<portName>";
String ENCODING_STYLE_PROPERTY = "javax.xml.rpc.encodingstyle.namespace.uri";
String URI_ENCODING = "http://schemas.xmlsoap.org/soap/encoding/";
String agencyID = "AGN00533";
String fileName = "testWS";
String xmlString = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><web-services>Sample Application</web-services>";
System.setProperty( "javax.xml.rpc.ServiceFactory", "weblogic.webservice.core.rpc.ServiceFactoryImpl");
ServiceFactory factory = ServiceFactory.newInstance();
* Create an instance of the Service with the given service QName
Service service = factory.createService(new QName(serviceName));
Call call = service.createCall(new QName(portName));
call.setTargetEndpointAddress(address);
call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));
call.setProperty(Call.SOAPACTION_URI_PROPERTY, "");
call.setProperty(ENCODING_STYLE_PROPERTY, URI_ENCODING);
QName stringQName = new QName("http://www.w3.org/2001/XMLSchema", "string");
* Set operation name to invoke.
call.setOperationName(new QName(namespaceURI,"<operationName>"));
* Add parameters definitions in the call object.
call.addParameter("string", stringQName, String.class, ParameterMode.IN);
call.addParameter("string0", stringQName, String.class, ParameterMode.IN);
call.addParameter("string1", stringQName, String.class, ParameterMode.IN);
* Set definition of the return type.
call.setReturnType(stringQName);
Object[] inParams = new Object[3];
inParams[0] = new String(agencyID);
inParams[1] = new String(fileName);
inParams[2] = new String(xmlString);
String result = ((String)call.invoke(inParams)).toString();
System.out.println(result);
}catch (Exception e){
e.printStackTrace();
Please give your suggestions for the above said exception....
Thanks & Regards....Hi All,
I am getting the below exception while invoking webservices using Dynamic client without WSDL.
javax.xml.rpc.soap.SOAPFaultException: Exception during processing: java.lang.RuntimeException: Missing license file for: WebLogic Platform 8.1 (see Fault Detail for stacktrace)
at weblogic.webservice.core.ClientDispatcher.receive(ClientDispatcher.java:313)
at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:144)
at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:457)
at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:443)
at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:558)
at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:411)
at atthi.webservice.TestWSWithWSDL.main(TestWSWithWSDL.java:41)
Exception in thread "main"
Please find my source file below....
import javax.xml.rpc.ServiceFactory;
import javax.xml.rpc.Service;
import javax.xml.rpc.Call;
import javax.xml.rpc.ParameterMode;
import javax.xml.namespace.QName;
public class TestWSWithoutWSDL {
public static void main(String[] args) {
try{
String address = "<WSDL's SOAP Address>";
String namespaceURI = "<namespaceURI>";
String serviceName = "<serviceName>";
String portName = "<portName>";
String ENCODING_STYLE_PROPERTY = "javax.xml.rpc.encodingstyle.namespace.uri";
String URI_ENCODING = "http://schemas.xmlsoap.org/soap/encoding/";
String agencyID = "AGN00533";
String fileName = "testWS";
String xmlString = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><web-services>Sample Application</web-services>";
System.setProperty( "javax.xml.rpc.ServiceFactory", "weblogic.webservice.core.rpc.ServiceFactoryImpl");
ServiceFactory factory = ServiceFactory.newInstance();
* Create an instance of the Service with the given service QName
Service service = factory.createService(new QName(serviceName));
Call call = service.createCall(new QName(portName));
call.setTargetEndpointAddress(address);
call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));
call.setProperty(Call.SOAPACTION_URI_PROPERTY, "");
call.setProperty(ENCODING_STYLE_PROPERTY, URI_ENCODING);
QName stringQName = new QName("http://www.w3.org/2001/XMLSchema", "string");
* Set operation name to invoke.
call.setOperationName(new QName(namespaceURI,"<operationName>"));
* Add parameters definitions in the call object.
call.addParameter("string", stringQName, String.class, ParameterMode.IN);
call.addParameter("string0", stringQName, String.class, ParameterMode.IN);
call.addParameter("string1", stringQName, String.class, ParameterMode.IN);
* Set definition of the return type.
call.setReturnType(stringQName);
Object[] inParams = new Object[3];
inParams[0] = new String(agencyID);
inParams[1] = new String(fileName);
inParams[2] = new String(xmlString);
String result = ((String)call.invoke(inParams)).toString();
System.out.println(result);
}catch (Exception e){
e.printStackTrace();
Please give your suggestions for the above said exception....
Thanks & Regards.... -
Hi
How can I to use java procedure and call RFC for to access tables of SAP ?
Thank YouRFC? That term in the IT environment usually means "+Request For Comments+" and refers to Internet protocol and usage standards.
Do you perhaps means RPC (Remote Process/Procedure Calls)? Or something else?
Also, SAP is a company. Not a product. SAP has a product called R3. This runs inside a database.
Connecting from Java to a database typically requires nothing more than a JDBC driver. So why can't you use a JDBC driver and need to call the database (and access tables) using another method?
Maybe you are looking for
-
Windows 8 can't recognize iphone
question as the title. I tried to insert my USB key, there is no pro. So, i guess it's the iphone pro. What should I do?
-
Score: is it possible to automatically place multiple rests on a part?
Score: is it possible to automatically place multiple rests on a part? (Rohan?)
-
Function to find Average salary
Hello everyone, First of all I would like to say that I am a newbie to PL/SQL so please be patient with me. I am trying to create a function that will calculate the average salary for employees and compare the average salary to each employee's salary
-
Good Day All, when I tried to create a model in SAP Netweaver Studio and I got the following error message: An internal error has ocurred, see error log for more details. Plugin name: Web Dynpro Model Editor Plugin ID: com.sap.ide.webdynpro.modeledit
-
SAP EP is getting shut down very often
Hello All, Our EP Portal 7.0 is getting shut down vey often..After restarting it is working for few hours but again getting down. OS=Windows 2003 server.Ram size=8GB Database=SQL server 2005. We are using HA sytem & MSCS Cluster. Sendin