cancel
Showing results for 
Search instead for 
Did you mean: 

web service client in java single program

Former Member
0 Kudos

hi there

i am trying to use axis to call a web service using a pojo but unable to get it am i worng in any where here let me know

package mc_style.functions.soap.sap.document.sap_com;

import org.apache.axis.client.Call;

import org.apache.axis.client.Service;

import javax.xml.namespace.QName;

public class TestClient

{

public static void main(String [] args) {

try {

String endpoint =

"http://uscirs5.wdf.sap.corp:8077/sap/bc/srt/rfc/sap/ZCCONVERTER?wsdl=1.1" ;

System.out.println("first" );

Service ZCCONVERTER = new Service();

Call call = (Call) ZCCONVERTER.createCall();

call.setTargetEndpointAddress( new java.net.URL(endpoint) );

call.setOperationName(new QName("http://soapinterop.org", "ZCurrency") );

// Call to addParameter/setReturnType as described in user-guide.html

//call.addParameter("testParam",

// org.apache.axis.Constants.XSD_STRING,

// javax.xml.rpc.ParameterMode.IN);

//call.setReturnType(org.apache.axis.Constants.XSD_STRING);

String ret = (String) call.invoke( new Object[] { " 5 " } );

System.out.println("second" );

System.out.println("Sent 'input param', got return value :'" + ret + "'");

} catch (Exception e) {

System.err.println(e.toString());

}

}

}

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

HI

Can u plz reconfirm that the operation (method) name of the Web Service is correct, ie ZCurrency

Former Member
0 Kudos

HI

Are you getting any Exception while invoking the Service ? If so please post the stack trace

Former Member
0 Kudos

hi there

it is giving message a below

Operation not supported

and no other message or trace.

dont know why.

Message was edited by:

zain

Former Member
0 Kudos

is it must to use AXIS for calling it? if not then you can try creating a standalone proxy from the WSDL of your web service and then use the API library to give a call to the web service from standalone java app..

Former Member
0 Kudos

hi there

i am using axis library in the porgram but unable to get the result can u tell me where i am being wronged in the above one

thanks