Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Ankur Gupta
Web Service
0 Answer(s)      3 years and 8 months ago
Posted in : WebSevices


Dear Sir, My code is :-

For webService:-

import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebService;

@WebService public class PaymentInfo {

@WebMethod
public String updatePaymentDetails(@WebParam String[] parms)
{
    System.out.println("Length of Array = " + parms.length);
        return "abcd";

}

}

and for client is:-

import javax.xml.namespace.QName; import javax.xml.rpc.Call; import javax.xml.rpc.ParameterMode; import javax.xml.rpc.Service; import javax.xml.rpc.ServiceFactory;

public class PaymentInfoTestClient {

public static void main(String[] args) {
    try {
        String NS_XSD = "http://www.w3.org/2001/XMLSchema";
        ServiceFactory factory = ServiceFactory.newInstance();
        Service service = factory.createService(new QName("http://lhcc.rdmindia.com/", "ATOMService"));

        String ENCODING_STYLE_PROPERTY = "javax.xml.rpc.encodingstyle.namespace.uri";
        String URI_ENCODING = "http://schemas.xmlsoap.org/soap/encoding/";

        Call call = service.createCall(new QName("http://lhcc.rdmindia.com/", "ATOMPort"));

        call.setTargetEndpointAddress("http://localhost:8081/lhcc?wsdl");

        call.setOperationName(new QName("http://lhcc.rdmindia.com/","updatePaymentDetails"));

        QName QNAME_TYPE_STRING = new QName(NS_XSD, "string");
        call.setReturnType(QNAME_TYPE_STRING);

        call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));
        call.setProperty(Call.SOAPACTION_URI_PROPERTY, "");
        call.setProperty(ENCODING_STYLE_PROPERTY, URI_ENCODING);

        call.setReturnType(QNAME_TYPE_STRING);          

        call.addParameter("arg0", QNAME_TYPE_STRING,ParameterMode.IN);

        String arg0 = new String("123");
        String arg1 = new String("40502820");
        String arg2 = new String("0715");
        String arg3 = new String("21APR2011");
        String arg4 = new String("PNR123");
        String arg5 = new String("500");
        String arg6 = new String("xyz");

        String[] parms = {arg0, arg1, arg2, arg3, arg4,arg5, arg6};

        String result = (String)call.invoke(parms);
        System.out.println(result);


    } catch (Exception e) {
        e.printStackTrace();
    }

}

}

................................................................................. I am passing params (array of string type) its length is 7 , but it is printing only 1, could you please suggest me for this.


Advertisement
View Answers

Related Tutorials/Questions & Answers:
web service
web service  i want to make an web service example so please help me out thanks  
web service
would be grateful :):) So i want to creat a web service that display the bus... coordinate will be send to my web service in a array list but i cant translate this into a code; my problem is in the web service side : in wich class i will do
Advertisements
Web Service
Web Service  Dear Sir, My code is :- For webService:- import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebService..."; ServiceFactory factory = ServiceFactory.newInstance(); Service service
Web Service
Web Service  Dear Sir, My code is :- For webService:- import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebService..."; ServiceFactory factory = ServiceFactory.newInstance(); Service service
Web service
Web service  webservices in JSP
web service
web service  How servlet class create in web services or how html code used in webservice. pls give example which contain servlet code
web service
web service  How servlet class create in web services or how html code used in webservice. pls give example which contain servlet code
xcode web service example
xcode web service example  xcode web service example
Web service protocol stack
Web service protocol stack  hii, What is the Web service protocol stack?   hello, The Web service protocol stack is an evolving set of protocols used to define, discover, and implement Web services
web service & database
web service & database  Hi, I need help with importing data from web service to ms sql/my sql. I developed a web service using Axis2 (v1.6.2) and Tomcat (v7.0.27) running on Eclipse Indigo. I can connect to the web services
Web Service Tutorial - WebSevices
Web Service Tutorial  hi, i am asking you again for my previous question of web service. you told me about a link but there is no link in your... the attachment of a step by step procedure of creating web service. Thanks and Regards
Web Service - WebSevices
Web Service  Hi All I have web service in .net , and i have to call it from java spring. How can i do it? Thanks
web service frameworks
Web service Frameworks         Web service Frameworks: There are many frameworks for web services. Here is the list of some frameworks
web service protocols
Web service Protocols         Web service protocols: Here is the list of some protocols used for Web Services
Web Service Tutorial - WebSevices
Web Service Tutorial  hi, i am new to web service and not much have idea about web services. right now i am using myeclipse blue 7.1 as my java IDE... the steps of creating a simple web service. Thanks and Regards Nishi
web service client
web service client  i have implement web service client in netbeans and it work will using wsdl but know i want to Develop a webserivce (or a Java RMI server/client) for one of the e-services but i do not know the wsdl link how
web service - JSP-Servlet
web service  How to call a web service from JSP post method?  Method in JSPHi! In this JSP Example you'll see, how to call web service from JSP methodName the file as usingMethod.jsp JSP Code- - - - -<%@ page
web service problem - WebSevices
web service problem  I have created web service client and server for File transfering using axis2/java.I want to add JAX-RPC client Handler...; Thank u....Actually web service without client handler is working. I want
Spring web service - Spring
Spring web service   Respected service, I have found an error in this manner(Connecting to tomcat then coming this error at first time only) and then working correctly. error coming only at first time. What
How to Convert SOAP Web service to REST Web service In Java ?
How to Convert SOAP Web service to REST Web service In Java ?  I want to Convert SOAP Web service(WSDL) to REST web service in JSON Format with GET... service. What I know is that JAX-RS api is used to generate REST Web service
Java - Web Service
Java - Web Service code that allow the user to input file name with path  Hi, I wanted a simple java program for web services development as per below: ------ IN REQUEST ------ <FileName> FileName - Path
Fedex web service
Fedex web service  sir how can use fedex api
developing simple web service
Open Source web services tool in java   ...: The Web Services Invocation Framework (WSIF) is a simple Java API for invoking Web services, no matter how or where the services are provided
Java - Web Service
Java - Web Service  Hi, I wanted a simple java program for web services development as per below: ------ IN REQUEST ------ <FileName> FileName - Path of the file (For example: C/text.txt) ------ IN RESPONSE
Java - Web Service
Java - Web Service  Hi, I wanted a simple java program for web services development as per below: ------ IN REQUEST ------ <FileName> FileName - Path of the file (For example: C/text.txt) ------ IN RESPONSE
web service call in jsp page
web service call in jsp page  I am wandering on internet for hours... a web service when you have a WSDL. I am using tomcat web server and eclipse ,a simple example to demostrate the web service calling would be good for me... I
Security in Web Service
Security in Web Service   ... Develop a web service program for Square   area calculation. Make this web service secured using security mechanism of “Username
get images from web service
get images from web service  How to get images from web services in iPhone application?   to get images from web service xml? For Uploading NSString *encodedString=[self encode:(const uint8_t*)_secretData.bytes
Attachement in Web Service + EJB 3 + Jboss
Attachement in Web Service + EJB 3 + Jboss  How to send attachements in Web Service using EJB3 with JBoss Application Server
how to create SOAP based web service in java?
how to create SOAP based web service in java?  Hi, I want to create sample SOAP web-service based application using jsp/servlet. Please help me
create login java web service - WebSevices
create login java web service  Hi, I am kind of newb in java web service development , i want to write a simple web service application that client... in this web site, but it seems different. Thanks
 

 

 

DMCA.com