Calling TIBCO side Webservice from Java
hi,
I want the **java client code** which **calls the TIBCO webservice** (AND)
I want the **java client code** which **calls the webservice implemented using ECLIPSE and Apche Axis.**
I need it As soon as possible as my client is insisting me.
Pls help me.
Thanks,
Masthan
Hi Timo,
In Soap ui we are not getting any error. We are generating a webserviceproxy out of the wsdl. After creating proxy we right click the wsdl and do a test webservice.
Then we are getting the below error.
"invalid namespace for prefix ns1. The operation cannot proceed"
Just wanted to check with you can webserviceproxy be created of the wsdl which contain multiple schemas?
Thanks Timo.
Best Regards,
Rahul
Similar Messages
-
Calling secured webservice from java
Hi Experts,
I am trying to call a secured webservice from java.
I got the code to call a non secured web service in java.
What changes do i need to do in this to call a secured webservice.
Please help me.
Thank you
Regards
Gayaz
calling unsecured webservice
package wscall1;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.StringBufferInputStream;
import java.io.StringReader;
import java.io.StringWriter;
import java.io.Writer;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.security.Permission;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.xml.serialize.OutputFormat;
import org.apache.xml.serialize.XMLSerializer;
import org.w3c.css.sac.InputSource;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
public class WSCall2 {
public WSCall2() {
super();
public static void main(String[] args) {
try {
WSCall2 ss = new WSCall2();
System.out.println(ss.getWeather("Atlanta"));
} catch (Exception e) {
e.printStackTrace();
public String getWeather(String city) throws MalformedURLException, IOException {
//Code to make a webservice HTTP request
String responseString = "";
String outputString = "";
String wsURL = "https://ewm52rdv:25100/Saws/SawsService";
URL url = new URL(wsURL);
URLConnection connection = url.openConnection();
HttpURLConnection httpConn = (HttpURLConnection)connection;
ByteArrayOutputStream bout = new ByteArrayOutputStream();
//Permission p= httpConn.getPermission();
String xmlInput =
"<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ser=\"http://www.ventyx.com/ServiceSuite\">\n" +
" <soapenv:Header>\n" +
" <soapenv:Security>\n" +
" <soapenv:UsernameToken>\n" +
" <soapenv:Username>sawsuser</soapenv:Username>\n" +
" <soapenv:Password>sawsuser1</soapenv:Password>\n" +
" </soapenv:UsernameToken>\n" +
" </soapenv:Security>" + "</soapenv:Header>" + " <soapenv:Body>\n" +
" <ser:GetUser>\n" +
" <request><![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?> \n" +
" <GetUser xmlns=\"http://www.ventyx.com/ServiceSuite\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n" +
" <UserId>rs24363t</UserId>\n" +
" </GetUser>]]>\n" +
" </request>\n" +
" </ser:GetUser>\n" +
" </soapenv:Body>\n" +
"</soapenv:Envelope>";
byte[] buffer = new byte[xmlInput.length()];
buffer = xmlInput.getBytes();
bout.write(buffer);
byte[] b = bout.toByteArray();
String SOAPAction = "GetUser";
// Set the appropriate HTTP parameters.
httpConn.setRequestProperty("Content-Length", String.valueOf(b.length));
httpConn.setRequestProperty("Content-Type", "text/xml; charset=utf-8");
httpConn.setRequestProperty("SOAPAction", SOAPAction);
// System.out.println( "opening service for [" + httpConn.getURL() + "]" );
httpConn.setRequestMethod("POST");
httpConn.setDoOutput(true);
httpConn.setDoInput(true);
OutputStream out = httpConn.getOutputStream();
//Write the content of the request to the outputstream of the HTTP Connection.
out.write(b);
out.close();
//Ready with sending the request.
//Read the response.
InputStreamReader isr = new InputStreamReader(httpConn.getInputStream());
BufferedReader in = new BufferedReader(isr);
//Write the SOAP message response to a String.
while ((responseString = in.readLine()) != null) {
outputString = outputString + responseString;
//Parse the String output to a org.w3c.dom.Document and be able to reach every node with the org.w3c.dom API.
Document document = parseXmlFile(outputString);
NodeList nodeLst = document.getElementsByTagName("User");
String weatherResult = nodeLst.item(0).getTextContent();
System.out.println("Weather: " + weatherResult);
//Write the SOAP message formatted to the console.
String formattedSOAPResponse = formatXML(outputString);
System.out.println(formattedSOAPResponse);
return weatherResult;
public String formatXML(String unformattedXml) {
try {
Document document = parseXmlFile(unformattedXml);
OutputFormat format = new OutputFormat(document);
format.setIndenting(true);
format.setIndent(3);
format.setOmitXMLDeclaration(true);
Writer out = new StringWriter();
XMLSerializer serializer = new XMLSerializer(out, format);
serializer.serialize(document);
return out.toString();
} catch (IOException e) {
throw new RuntimeException(e);
private Document parseXmlFile(String in) {
try {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
InputSource is = new InputSource(new StringReader(in));
InputStream ins = new StringBufferInputStream(in);
return db.parse(ins);
} catch (ParserConfigurationException e) {
throw new RuntimeException(e);
} catch (SAXException e) {
throw new RuntimeException(e);
} catch (IOException e) {
throw new RuntimeException(e);
} catch (Exception e) {
throw new RuntimeException(e);
static {
javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier(new javax.net.ssl.HostnameVerifier() {
public boolean verify(String hostname, javax.net.ssl.SSLSession sslSession) {
if (hostname.equals("ewm52rdv")) {
return true;
return false;
}Gayaz wrote:
What we are trying is we are invoking webservice by passing SOAP request and we will get soap response back.I understand what you're trying to do, the problem is with tools you're using it will take a while for you do anything a little away from the trivial... Using string concatenation and URL connection and HTTP post to call webservices is like to use a hand drill... It may work well to go through soft wood, but it will take a lot of effort against a concrete wall...
JAX-WS and JAXB and annotations will do everything for you in a couple of lines and IMHO you will take longer to figure out how to do everything by hand than to learn those technologies... they are standard java, no need to add any additional jars...
That's my thought, hope it helps...
Cheers,
Vlad -
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 -
Calling SAP Webservice from JAVA ME bad response time
Hello together,
I'm calling a SAP RFC as a Webservice from JAVA ME (Netbeans 6.8). The stub classes I've generated with the Sun Wireless Toolkit. The RFC function stores entries in a SAP database table. The call of the websevice with transmitting the data and the database update in SAP works fine, but I got the response message from SAP with a delay of 40 seconds.
Does anyone know why there is so a long delay in the response and how to fix it?hi,
is this reproducible or was it just the first call to that service?
it usually occurs that once you call a webservice for the first time, some of the programs (be it your application programs or the even the SOAP runtime itself) required have not been compiled until that and so they are compiled during the webservice call.
This leads to slow response times even time-outs. The effect vanishes once all sources are compiled (i.e. depending on the complexity of your calls after one to a few calls to that service).
So, if the slow response times persist, you should turn on debugging in SICF and see where time is spent...
my 2 cents,
anton -
How to Call abap functn/program from java layer
Hi all,
I have to develop a program which has to call abap function/program from java side or how to call a abap program through java ..
pls send me related links or explanations.. dont send unrelated answers..
Regards,
Arivarasu SHi,
You mean accessing ABAP functions from J2EE perspective, then I think we can do this by using SAP Java Resource Adapter and also through webservices.
SAP Java Resource Adapter (SAP JRA) can be used as an add-on for the SAP JCo SAP JRA enables the implementation of standard interfaces from diverse J2EE servers to the SAP JCo in the SAP Web AS. The SAP JRA thus simplifies
communication with ABAP within heterogeneous J2EE landscapes.
Go through the following links which has Good documentation on how to achieve this
Accessing BAPIs Using the SAP Java Resource Adapter
[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ad09cd07-0a01-0010-93a9-933e247d3ba4]
Connectivity and Interoperability
[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/326d82e5-0601-0010-fca4-9caf27b89c26]
Finally with WebServices. Accessing SAP Business Functions (ABAP) via Web Services
[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/06adbf03-0a01-0010-f386-d8e45561a3c4]
Regards
Raghu -
How can I call a stateful webservice from a user-defined XPath function?
I'm calling a stateful webservice from a BPEL process using a PartnerLink which implements Custom Header Handler classes to handle the session state, storing the cookie as a property of the PartnerLink.
I'd also like to call this same stateful webservice, in the same session, from a user-defined XPath function enabling me to call this from an XSL Transformation.
Is this in any way possible? Can I access the cookie and attach it to the webservice call made by the user-defined XPath function?Actually, as long as the servlet returns valid javascript, you can indeed "call it" from the client. It will initiate a request and return the result to the browser.
This example uses Perl, but it could be easily modified to go to a servlet instead.
Note that it is only supported in DOM browsers (IE6+/NN6+/etc)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title> Test server-side JS </title>
</head>
<body>
<script type="text/javascript">
function checkIt(variable, value)
var newScript = "cgi-bin/validateJS.cgi?"+variable+"="+value;
var body = document.getElementsByTagName('body').item(0)
var scriptTag = document.getElementById('loadScript');
if(scriptTag) body.removeChild(scriptTag);
script = document.createElement('script');
script.src = newScript;
script.type = 'text/javascript';
script.id = 'loadScript';
body.appendChild(script)
</script>
<p>Test.</p>
<form id="f1" action="">
<input type="text" name="t1" id="t1" onChange="checkIt(this.name, this.value)">
</body>
</html>
validateJS.cgi
#!/opt/x11r6/bin/perl
use CGI qw(:all);
my @valArray = split(/=/,$ENV{QUERY_STRING});
print "Content-type: text/javascript\n\n";
# myPass is the password
$myPass = "foobar";
if ("$valArray[1]" eq "$myPass")
print "alert(\"Success!!\")";
else
print "alert(\"Failure!!\")"; -
Calling packaged stored procedure from Java
Hi All,
I'm trying to call a stored procedure from Java but I'm having
problems with registrating the output parameter. I'm getting
the error: Conflicting parameters.: sqltype=2003
This is the stored procedure which is located in a package in
the Oracle database:
package Pack_GetAgencyInformation as
Type InfoType is record ( agen_code varchar(3), agen_designation
varchar(30), agen_adresse varchar(60), agen_tel varchar(12) );
function GetAgencyInformation( P_AGENCE VARCHAR )
return Pack_GetAgencyInformation.InfoType
end Pack_GetAgencyInformation;
This is the Java source from where I'm calling the procedure:
//DriverManager.registerDriver (new
oracle.jdbc.driver.OracleDriver());
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection
("jdbc:oracle:thin:@164.48.69.125:1521:ventes", "system", "*****
// @machineName:port:SID,
userid, password
CallableStatement cs = conn.prepareCall("{ ? = call
Pack_GetAgencyInformation.GetAgencyInformation( ? )}");
try {
cs.registerOutParameter( 1,
oracle.jdbc.driver.OracleTypes.ARRAY);
} catch (SQLException e) {
e.printStackTrace();
cs.setString(2, "001" );
//ResultSet rset = cs.executeQuery();
The stacktrace:
java.sql.SQLException: Parametertypen conflicteren.:
sqlType=2003
at oracle.jdbc.dbaccess.DBError.throwSqlException
(DBError.java:168)
at oracle.jdbc.dbaccess.DBError.throwSqlException
(DBError.java:210)
at
oracle.jdbc.driver.OracleCallableStatement.registerOutParameter
(OracleCallableStatement.java:220)
at
oracle.jdbc.driver.OracleCallableStatement.registerOutParameter
(OracleCallableStatement.java:350)
at dbAccess.main(dbAccess.java:25)
I think it has to do with the type InfoType which is created in
the Stored Procedure. I'm absolute no Oracle expert and I
prefer not to make changes to the Oracle database. So any
solution in Java is welcome!
BR, H.RietmanI managed to get it to work only by changing the stored
procedure. I have changed the return type record to a Ref
Cursor type (had to change alot of code for this). It seams
that Oracle JDBC drivers DON'T support the Record type as a
return type.
So the next question is: is it possible to typecast a record
type to a ref cursor type in Oracle. In this way I can easily
change the return type for the stored procedures.
/Harald -
On making call to Oracle procedures from Java, Value becomes null on oracle
We are using some user defined Oracle data types in my Java/J2EE application
and some of them are Oracle collections(ex. VARRAY).
We are making a call to Procedures/Functions from Java, there are some
parameters of user defined data types declared in the
procedures/functions, from java the values are properly setting to these
user defined data type parameters and sending to Procedures.
We are not getting any exception at Java side and Oracle side and values
are becoming blank/null at oracle procedure side for the parameters of
user defined data types.
But when do the count of collection of user defined data type then it is
properly giving the size of collection(VARRAY).
When we are trying to read the values from the collection(VARRAY) it is
giving blank/null value and there is no exception.
Please let me know if you have any suggestion on this?user7671994 wrote:
When we are trying to read the values from the collection(VARRAY) it is
giving blank/null value and there is no exception.If you are talking about VARCHAR2 parameters of the objects - then you should add orai18n.jar to classpath. -
How can we call a external webservice from sandboxed webpart?
Hi,
I need to call an external webservice from sandboxed visual webpart in 2013. And that webpart would be used in office-365 site. Please let me whether it is possible or not.
Thanks,
ArindamSandboxed solution server code can't call an external web service. There are ways to write a sandboxed solution that calls a web service using client side code. Here's a sample of a silverlight application deployed via the sandbox that can call
an external web service.
http://msdn.microsoft.com/en-us/library/gg615590(v=office.14).aspx
Paul Stork SharePoint Server MVP
Principal Architect: Blue Chip Consulting Group
Blog: http://dontpapanic.com/blog
Twitter: Follow @pstork
Please remember to mark your question as "answered" if this solves your problem. -
Call more external webservice from apex
How can call more external webservice from apex - consecutively one after another - one execute, than next used as a parameter of the previous webservice results
Sandboxed solution server code can't call an external web service. There are ways to write a sandboxed solution that calls a web service using client side code. Here's a sample of a silverlight application deployed via the sandbox that can call
an external web service.
http://msdn.microsoft.com/en-us/library/gg615590(v=office.14).aspx
Paul Stork SharePoint Server MVP
Principal Architect: Blue Chip Consulting Group
Blog: http://dontpapanic.com/blog
Twitter: Follow @pstork
Please remember to mark your question as "answered" if this solves your problem. -
How to call a VB application from Java
Hi,
does anybody know how to call a VB application from java.
Would appreciate if you can provide me with an example.
thankstry exec()ing the cad program with the name of the file as a command line parameter...
Runtime.getRuntime().exec("CADProg.exe Test.prt");
i have no clue if this will work but it seems like it's worth a try. -
How to call a .bat file from java code?
How to call a .bat file from java code? and how can i pass parameters to that .bat file?
Thanks in advancethanks for ur reply
but still i am getting the same error.
I am trying to run a .bat file of together tool, my code looks like below
import java.lang.Runtime;
import java.lang.Process;
import java.io.File;
class SysCall{
public static void main(String args[]){
String cmd="D://Borland//Together6.2//bin//Together.bat -script:com.togethersoft.modules.qa.QA -metrics out:D://MySamples//Metrics// -fmt:html D://Borland//Together6.2//samples//java//CashSales//CashSales.tpr";
//String path="D://Borland//Together6.2//bin//Together.bat ";
Runtime r= Runtime.getRuntime(); //Declare the system call
try{
System.out.println("Before batch is called");
Process p=r.exec(cmd);
System.out.println(" Exit value =" + p.exitValue());
System.out.println("After batch is called");
/*can produce errors which must be caught*/
catch(Exception e) {
e.printStackTrace();
System.out.println (e.toString());
I am getting the below exception
Before batch is called
java.lang.IllegalThreadStateException: process has not exited
at java.lang.Win32Process.exitValue(Native Method)
at SysCall.main(SysCall.java:17)
java.lang.IllegalThreadStateException: process has not exited -
Calling a Web Service from Java
Our java guru (who is out sick....AHHHH) created all the calls that are needed to access the web service that he has running. For example the call getLongList(String user, String password) will return a list of all outstanding transactions. He made a jar file that has service has class files for PortType, Service, Service Locator and Soap Binding stub.
How do I call this web service from java? Do I have to import it into my classpath? or just call these parameters from within my java code?never mind...i got it
-
Calling a Web Service from Java Webdynpro
Hi,
Can any one give me step by setp details on how to call a Web Service from Java Webdynpro ?
I tried creating a model using Import Web Service Model but when I completed creating the model, I got some errors as shown below.
Error The method setRouteGeometryLineArray(double[][]) in the type Trip is not applicable for the arguments (double[]) ComplexType_Trip.java WS_INVOKE/gen_wdp/packages/com/cintas/test/model/p1 line 249
thanks
SBKHi SBK,
I assume you may already have read the [help guide|http://help.sap.com/saphelp_nw70/helpdata/EN/81/12703e5da3e946e10000000a114084/content.htm] This gives a pretty good idea of how to do it (step by step).
Is there a typo in the error you pasted?
Error The method setRouteGeometryLineArray(double][) in the type Trip is not applicable for the arguments (double[]) ComplexType_Trip.java WS_INVOKE/gen_wdp/packages/com/cintas/test/model/p1 line 249
The square brackets [] after double in the method call appear to be reversed. Is that also in the code? or just a mistake here?
Hope this points you in the right direction.
BRgds,
Simon -
How to call a BPEL process from Java ?
How can I call a BPEL process from Java?
The Java client should be outside of the PEL engine.
Does someone have a piece of sample code for
a "Hello world" java-to-bpel call (+ java client src)?http://www.oracle.com/technology/products/ias/bpel/pdf/orabpel-Tutorial7-InvokingBPELProcesses.pdf
Maybe you are looking for
-
Error in loading workflow status page
Hi, In workflow process , In one place i have a step - In stage D if task is rejected the task it needs to go to stage C. Its able to move to stage C , I get a mail,but the workflow stage status is not loading. It shows error . For most of the sta
-
Cmd-k doesn't work with Leopard to access Win XP
With 10.5.4 on an iBook I was able to get to Win XP shared files just fine. With 10.5.6 on a new Macbook I've been unable to get this to work despite having fully researched the situation with Google and having tried all the suggestions that apparent
-
What causes the FP-AI-110 module READY LED to flash upon power up?
The ready light flashes continuously on the FP-AI-110 module upon power up. The power light also seems to have a very short flash as well. The module part number is 184105C-01. The module has worked fine in the application for about two years. It had
-
Concerning midi data in GarageBand for iOS: can we copy midi data from one virtual instrument to another? For instance: I play my "lucky take" on the virtual piano, and now I am curious how it would sound on let's say a organ. Normally I would select
-
adding a mail account?