How to return List or Array from Web Service without using ADF?

All,
I would like to know how to do this before I use ADF. Sounds like a simple thing to do - common even - but I haven't found a solution in existing postings. My attempts have failed though I'm not sure exactly why.
I have created a declarative WS that takes a single parameter and tries to return a List<Employees> resultset. My Sample Java Client works just fine. When I change the result type from List to String[], for example, it also works fine.
What am I doing wrong??
Thanks
package wizard;
(imports removed for readability)
@WebService(name = "MyWebService1", serviceName = "MyWebService1", portName = "MyWebService1SoapHttpPort")
@Deployment(restSupport = true)
public class HelloWorld {
List<Employees> employees = null;
public HelloWorld() {
public List<Employees> sayHello (String s) {
try {
final Context context = getInitialContext();
ATOABPFacade aTOABPFacade = (ATOABPFacade)context.lookup("ATOABPFacade");
employees = aTOABPFacade.queryEmployeesFindByName(s);
return employees;
} catch (Exception ex) {
ex.printStackTrace();
return employees;
private static Context getInitialContext() throws NamingException {
return new InitialContext();
Trace:
Ready message received from Oc4jNotifier.
Embedded OC4J Server startup time: 24063 ms.
Target URL -- http://localhost:8988/JPA-Wizard-context-root/mywebservice1soaphttpport
Feb 18, 2008 7:42:49 PM com.evermind.server.ServerBase log
WARNING: JPA-Wizard-webapp: Error preloading servlet
javax.servlet.ServletException: java.lang.NullPointerException
     at oracle.j2ee.ws.server.provider.ProviderServlet.init(ProviderServlet.java:186)
     at javax.servlet.GenericServlet.init(GenericServlet.java:241)
     at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2674)
     at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:5162)
     at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:5085)
     at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:5275)
     at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:1357)
     at com.evermind.server.http.HttpApplication.init(HttpApplication.java:873)
     at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:699)

Gi,
not sure what you are doing there, but you can build the J2EE WebService from your working POJO, and create a Web Service proxy class from the WSDL description (of the deployed or local WSDL file). Then, using the proxy class, you can access the output of the WebService.
Frank

Similar Messages

  • Error returning large String arrays from web service

    Hi,
    I currently have an EJB that returns a String[] array that I have implemented as
    a Web Service. When I execute a Java client (JSP) from Weblogic, I don't have a problem
    as long as the returned array is relatively small, but when the array starts to get
    a little larger (say 20 elements, about 30 chars each), I consistently get:
    SAXException: java.lang.IllegalArgumentException:array element type mismatch.
    Strangely enough, when my web service client is a .asp page running under MS IIS
    (using the MS SOAP Toolkit), it works fine. I have returned as many as 15000 - 20000
    array elements in one call. And since I am calling the same Weblogic EJB with the
    MS client, I know it's a problem with the Java client, not the EJB.
    Anybody know of a bug or had this experience before? Or know what I might be doing
    wrong? FYI, I am using Weblogic 6.1 SP2.
    Thanks,
    Steve

    Hi Steve,
    Sure we're interested...I'll pass this along to the XML folks.
    Thanks for the feedback,
    Bruce
    Steve Alexander wrote:
    In case anyone is interested, I solved my problem. I was mis-diagnosing the problem
    - thinking it was a size issue when it actually was a data issue. On the calls where
    I was returning a large array, some of the array members were null. When I made them
    enpty strings "", it worked. Apparently the default SAX parser BEA uses doesn't like
    the nulls, whereas the MS parser doesn't care.
    "Steve Alexander" <[email protected]> wrote:
    Thanks Bruce,
    FYI - I have reproduced the problem on WL7.0. I have turned it in to support
    as you
    suggested.
    Steve
    Bruce Stephens <[email protected]> wrote:
    Hi Steve,
    This does not ring any bells, however I would suggest that you file a support
    case. If it
    is an option you might try a later release (7.0).
    Bruce
    Steve Alexander wrote:
    Hi,
    I currently have an EJB that returns a String[] array that I have implementedas
    a Web Service. When I execute a Java client (JSP) from Weblogic, I don'thave a problem
    as long as the returned array is relatively small, but when the arraystarts to get
    a little larger (say 20 elements, about 30 chars each), I consistentlyget:
    SAXException: java.lang.IllegalArgumentException:array element type mismatch.
    Strangely enough, when my web service client is a .asp page running underMS IIS
    (using the MS SOAP Toolkit), it works fine. I have returned as many as15000 - 20000
    array elements in one call. And since I am calling the same Weblogic
    EJB
    with the
    MS client, I know it's a problem with the Java client, not the EJB.
    Anybody know of a bug or had this experience before? Or know what I mightbe doing
    wrong? FYI, I am using Weblogic 6.1 SP2.
    Thanks,
    Steve

  • Return List of object from web service

    Hi to all.
    I have a java class which returns an array of ojects (custom objects).
    With jdeveloper tool i would like to create a ws around my class, but i receive this message:
    Method getUsers: The following JavaBean parameters have property descriptors using types that do not have an XML Schema mapping and/or serializer specified:
    Code is the following:
    public class GETUSERS
      //Costruttore di default
      public GETUSERS(){}
      public UserProfile[] getUsers(String LastName,String Name)
        CallableStatement proc = null;
        ResultSet rs = null;
        UserProfile users[]  = null;
        int cont=0;
        try
          Connessione connessione = new Connessione();
          Connection conn = connessione.getJNDIConnection();
          if (conn != null )
          proc = conn.prepareCall("{call procedure(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) }");
          //Cursore di output
          proc.registerOutParameter(1, oracle.jdbc.OracleTypes.CURSOR);
          proc.setInt(2,1);
          proc.setInt(3,100);
          proc.setString(4,null);
          proc.setString(5,LastName);
          proc.setString(6,Name);
          proc.setString(7,null);
          proc.setString(8,null);
          proc.setString(9,null);
          proc.setString(10,"n");
          proc.setString(11,null);
          proc.setString(12,null);
           proc.executeQuery();
           rs = (ResultSet)proc.getObject(1);
          rs.last();
          users= new UserProfile[rs.getRow()];
          rs.beforeFirst();
          while (rs.next())
           users[cont].setUID(rs.getString(1));
           users[cont].setName(rs.getString(2));
            cont++;
          rs.close();
          proc.close();
        catch(Exception ex)
        System.out.println(ex.getMessage());
        return users;
    }Any idea?
    Thanks

    Can you show the UserProfile.java ? That may have some variables, which are not supported in web services.

  • Steps to expose a web service without using SR

    Hello,
    How can I expose a web service without using the service registry?  Is there some documentation for this process?
    Thanks,
    Matt

    Thanks for the response.  Although, I do not have an * in the Sender Agreement.
    Here is the situation:
    When I attempt to reach the URL for my Web Service but using NWA instead of the Service Call I get into NWA.
    https://xxxxx.steelcasedev.com/nwa
    Result: Success
    When I use SOAPSonar to run this URL I get the CPA error:
    https://xxxxx.steelcasedev.com//XISOAPAdapter/MessageServlet?senderParty=&senderService=WSProcurement_Async_Sender&receiverParty=&receiverService=Steelcase_Dev&interface=WSProcure_Out&interfaceNamespace=urn:steelcasedev.com:wsprocure:xsuppliers
    Result:  Error
    <context>XIAdapter</context>
              <code>ADAPTER.JAVA_EXCEPTION</code>
              <text><![CDATA[
    com.sap.aii.af.service.cpa.CPAException: com.sap.aii.af.service.cpa.impl.exception.CPALookupException: Couldn't retrieve inbound binding for the given P/S/A values: FP=;TP=;FS=WSProcurement_Async_Sender;TS=Steelcase_SAPR3_D01;AN=WSProcurement_Out;ANS=urn:steelcase.com:wsprocurement:xml2suppliers;
         at com.sap.aii.af.service.cpa.impl.lookup.CommonLookup.checkForError(CommonLookup.java:53)
         at com.sap.aii.af.service.cpa.InboundRuntimeLookup.getBinding(InboundRuntimeLookup.java:411)
         at com.sap.aii.af.service.cpa.impl.lookup.AbstractLookupManager.getBinding(AbstractLookupManager.java:714)
         at com.sap.aii.adapter.soap.web.MessageServlet.doPost(MessageServlet.java:430)
    The sender adapter is active in ID but in RTWB it is "Started but Inactive".  I have found that this status could be related to the fact that I have not had a successful transaction for that channel yet.
    My NW Admin says he found this error: 
    Marked transaction for rollback for message 0015605e-09d7-1ddf-94f7-d5031c019713(INBOUND). Reason: Channel has been configured as inactive and cannot accept messages
    I am quite confused. 
    Thanks,
    Matt

  • Extraction from web service without XI

    Hello all!
    I want to realize data extraction scheme without usage XI
    DB2 Stored proc -> Web Service -> BW
    Is realy?

    Hello can you refine your question with more specification?
    Yes, it can possible data extraction from web service, but what you are exactly looking for?

  • Failure to generate WSDL from web service when use xmlbean

    Hi, I have a web service that uses xmlbean generated by schema. The schema from 3rd party is in a separate project since it's used by another web app and ejb project. In wlw103 I have included the schema project in this web service project's Java Build Path. The web service compiles, but when I tried to generate WSDL a Error window shows and says "The WSDL cannot be generated from the web service due to unexpected runtime errors".
    The following is the detail. What do I need to do to make the xmlbean available for my web service? Thanks
    com.bea.workshop.webservices.core.gen.WebServicesException: weblogic.wsee.tools.jws.build.CompileException: Error compiling web service: C:\workspace\ws\src\myPackage\testWS.java
         at com.bea.workshop.webservices.core.compiler.WebServiceCompilerImpl$3.invoke(WebServiceCompilerImpl.java:335)
         at com.bea.workshop.webservices.core.compiler.WebServiceCompilerImpl.accessCompiler(WebServiceCompilerImpl.java:390)
         at com.bea.workshop.webservices.core.compiler.WebServiceCompilerImpl.compile0(WebServiceCompilerImpl.java:330)
         at com.bea.workshop.webservices.core.compiler.WebServiceCompilerImpl.compile(WebServiceCompilerImpl.java:275)
         at com.bea.workshop.webservices.ui.actions.GenerateWsdlFromJwsAction.run(GenerateWsdlFromJwsAction.java:169)
         at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:256)
         at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:546)
    Caused by: weblogic.wsee.tools.jws.build.CompileException: Error compiling web service: C:\workspace\ws\src\myPackage\testWS.java
         at weblogic.wsee.tools.jws.build.JwsCompiler.buildWebServices(JwsCompiler.java:526)
         at weblogic.wsee.tools.jws.build.JwsCompiler.compile(JwsCompiler.java:483)
         at com.bea.workshop.webservices.core.compiler.WebServiceCompilerImpl$3.invoke(WebServiceCompilerImpl.java:333)
         ... 46 more
    Caused by: weblogic.wsee.tools.WsBuildException: weblogic.wsee.bind.buildtime.BindingException: ERROR ! could not add Xml Schema Type for XmlBean named '\[com.domain.UserDocument\]'. This is completely unexpected and might be caused by missing *.xsb and *.xsd files in the build environment. The building and running of this Service is likely to FAIL.
         at weblogic.wsee.tools.jws.jaxrpc.JAXRPCWebServiceInfo.createBindings(JAXRPCWebServiceInfo.java:227)
         at weblogic.wsee.tools.jws.wsdl.WsdlBuilder.processImpl(WsdlBuilder.java:43)
         at weblogic.wsee.tools.jws.jaxrpc.JAXRPCProcessor.process(JAXRPCProcessor.java:27)
         at weblogic.wsee.tools.jws.process.CompositeProcessor.process(CompositeProcessor.java:47)
         at weblogic.wsee.tools.jws.build.JwsCompiler.buildWebServices(JwsCompiler.java:522)
         ... 48 more
    Caused by: weblogic.wsee.bind.buildtime.BindingException: ERROR ! could not add Xml Schema Type for XmlBean named '\[com.domain.UserDocument\]'. This is completely unexpected and might be caused by missing *.xsb and *.xsd files in the build environment. The building and running of this Service is likely to FAIL.
         at weblogic.wsee.bind.buildtime.internal.SoapAwareJava2Schema.bindAsExplodedTylar(SoapAwareJava2Schema.java:1414)
         at weblogic.wsee.bind.buildtime.internal.TylarJ2SBindingsBuilderImpl.createBuildtimeBindings(TylarJ2SBindingsBuilderImpl.java:216)
         at weblogic.wsee.tools.jws.jaxrpc.JAXRPCWebServiceInfo.createBindings(JAXRPCWebServiceInfo.java:223)
         ... 52 more

    HI,
    I hope this issue can resolved by adding this patch CR349256
    Try to contact weblogic support to get more details about this patch.
    Regards,
    Kal.

  • Web Services without using the API

    Hi. I'm new to Web Services. I've been able to call a web service and get my result back without using the Web Services API -- easy enough. My question is this.... the concept of web services has been around for a long time... longer than the web services API. Can I not write a simple servlet it Java that would function as a Web Service without having to use the Web Services API.
    For example,
    Calling XML:
    <action><delete>jdoe</delete></action>
    Servlet recieves this as a stream, deletes the associated ID and returns:
    <action><result>Success</result></action>
    or
    <action><result>Failed</result></action>
    This seems to me like it would be pretty generic stuff (not requiring the API) and pretty basic (not very large).
    Can anyone head me in the right direction with this or provide an example?
    Thank you.
    dr

    Can... Servlet is very powerful to write the web services...

  • Return 2D array from web service

    Hi All,
    I am new to web services development and start developing web service using net bean 6.9. I want to create the web service which needs to return the 2-d array. So i created it like this
    public Object[][] getData(@WebParam(name = "startDate")
    String startDate, @WebParam(name = "endDate")
    String endDate) {
    HashMap hm= new HashMap();
    hm.put("key1", "val1");
    hm.put("key2", "val2");
    Object[][] twoDarray = new String[hm.size()][2];
    Object[] keys = hm.keySet().toArray();
    Object[] values = hm.values().toArray();
    for (int row = 0; row < twoDarray.length; row++) {
    twoDarray[row][0] = keys[row];
    twoDarray[row][1] = values[row];
    return twoDarray;
    But when i test the web service using SOAPui then it did not returning anything. Can anyone guide me where is the problem??
    Thanks
    Shuja

    Gi,
    not sure what you are doing there, but you can build the J2EE WebService from your working POJO, and create a Web Service proxy class from the WSDL description (of the deployed or local WSDL file). Then, using the proxy class, you can access the output of the WebService.
    Frank

  • Return arrary of objects from web service

    Hello ALL,
    This problem has stumped me for several days.
    I have a web service and a jsp client. the jsp client call the web service. the web service function return an array of object of DataBaseRecord type. I use XFire + MyEclipse + Tomcat to develop this project in a Linux box.
    the web service WelcomeYou is defined as follows
    {noformat}public List<DataBaseRecord> WelcomeYou(String ExampleDoc)
       List<DataBaseRecord> RetrievalResult = new ArrayList<DataBaseRecord>();
      //  Search relevant documents according to 'ExampleDoc' from a database
      //  The search result will be put into a RecordSet object 'rs'
       while(rs.next())
                  DataBaseRecord  NewRecord = new DataBaseRecord ();
                  NewRecord.RetrievedDocID = rs.getString("RetrievalDocID");
                  NewRecord.SimiScore =  Float.valueof(rs.getString("SimiScore"));
                  RetrievalResult.add(NewRecord );
    // I use the following for loop to see the content of RetrievalResult. I can see that the content is just what I expect. Additionally, the size of RetrievalResult is correct too.
    for(DataBaseRecord   databaserecord : RetrievalResult)
         System.out.println(databaserecord.RetrievedDocID + databaserecord.SimiScore);
      return RetrievalResult;{noformat}in a jsp file, the web service WelcomeYou is called
    {noformat}List<DataBaseRecord>  Result = new List<DataBaseRecord>();
    Result = srvc.WelcomeYou("some text ");
    // I use the following for loop to see the contentof Result, but each element of Result is empty. Moreover, the strange thing is that the size of Result is right.
    for(DataBaseRecord   databaserecord : Result)
         System.out.println(databaserecord.RetrievedDocID + databaserecord.SimiScore);
    {noformat}the class DataBaseRecord is defined as follows
    {noformat}public class DataBaseRecord{
        public String RetrievedDocID;
        public float SimiScore;
    {noformat}At the very end of the service function body(just before ' return RetrievalResult;'), i check the content of RetrievalResult using a for loop, it is correct.
    At the jsp file, immediately after the statement
    {noformat}   Result = srvc.WelcomeYou("some text ");
    {noformat}
    {code}
    , i check the content of Result using a for loop, it is incorrect except for the size of Result .
    I wonder where I am wrong in the above code.

    Can you show the UserProfile.java ? That may have some variables, which are not supported in web services.

  • How to view multiple output parameters from web services

    I have used the Labview tool to create a .NET assembly from a WSDL file.
    In the WSDL file the service has been defined to return 2 output parameters.
    In Labview, when I invoke the method for this service the first output parameter ends up as the return value of the method.  I can create an indicator for this and it gets updated properly when I run the VIS to use the web service..  The indicator is an integer value but recognizes the type defined within the WSDL file. 
    The second output parameter shows up as an output value.  When I right click on it and create an indicator for it I get a .NET icon on the front panel rather than an integer value. 
    How can I view the value for this second output parameter after running the web service?
    Is there a difference in how multiple output parameters handled in newer versions of Labview (I am using verison 7.1)?

    scrooge wrote:
    You can try this link .
    the link is dead... or i dont have access..

  • How to display complex type result from web service?

    Hi,
    I am trying to invoke a web service with the following code
    but I can't display the result. Can someone help me how to display
    the result?
    <cfset randomID = CreateUUID()>
    <cfset today = Now()>
    <cfset args = StructNew()>
    <cfset args.login = "wanna">
    <cfset args.key = "#DateFormat(today, 'YYYY-MM-DD')#
    #TimeFormat(today, 'hh:mm:ss')#:#Left(randomID,12)#">
    <cfset args.hash= LCase(Hash("123456" & args.key,
    "SHA"))>
    <CFINVOKE webservice="
    http://sandbox.voxbone.com/ws/services/VoxService?wsdl"
    METHOD="getCountriesList"
    AuthenticationToken="#args#"
    RETURNVARIABLE="Result">
    <cfoutput>#Result#</cfoutput>

    I have tried using that that it display the following. I was
    expecting a list of coutries but it display the following text
    only. Can you guide me in displaying list of countries?
    "object of
    voxbone.webservices.services.containers.ArrayOfCountry"
    Methods hashCode (returns int)
    equals (returns boolean)
    getCountry (returns
    [Lvoxbone.webservices.services.containers.Country;)
    getCountry (returns
    voxbone.webservices.services.containers.Country)
    getSerializer (returns interface
    org.apache.axis.encoding.Serializer)
    getDeserializer (returns interface
    org.apache.axis.encoding.Deserializer)
    getTypeDesc (returns org.apache.axis.description.TypeDesc)
    setCountry (returns void)
    setCountry (returns void)
    getClass (returns java.lang.Class)
    wait (returns void)
    wait (returns void)
    wait (returns void)
    notify (returns void)
    notifyAll (returns void)
    toString (returns java.lang.String)

  • How to bind list data to XML Web service request

    How do I bind specific columns in a DataGrid to the Web
    service request? I'm having trouble finding any documentation that
    addresses that specific pattern, i.e. sending a complex list to the
    server via a Flex Web service send() command. I'm fairly new to
    Flex programming and don't know if what I want to do is possible.
    Here what I've been able to do so far.
    1. Using a Web service called a service on the server and
    retrieved a complex list.
    2. Poplulated a DataGrid with the result
    3. The user has selected multiple rows from the DataGrid
    using a checkbox column
    4. The user pressed a button that calls a Web service send().
    This Web service should only send data from only two columns and
    only for those rows the user has checked.
    5. I can loop over the DataGrid and find the selected rows
    and put them in another ArrayCollection called 'selectedRows'.
    The issue is that I don't know how to bind 'selectedRows' to
    the Web service. Right now I'm reading up on "Working with XML" in
    the Programming with ActionScript 3.0 chapter. But I'm just fishing
    here. No bites yet.

    Don't bind. Build the request object programatically, as you
    are doing with your selectedRows AC, and send(myObject) that.
    Tracy

  • How to delete the Webservice entry from Web service navigator?

    Hi,
    My current issue is that, developers have created many webserivces and these web services are visible in web service navigator that i access by following link
    http://<host>:<port>/wsnavigator
    But now we have to remove the unwanted webservices i.e. i want that unwanted webservices should not be visible to anyone when we access WSNAVIGATOR.
    How should i go about it?
    Am i required to undeploy the web services that is deployed from SDM GUI?
    Please pour in your valuable inputs.
    Any help would be highly appreciated.
    Regards,
    Ameya

    I had to revove the entry from VA. Removing this entry also removes the web service from ws navigator.

  • Returning XML to client from web service

    Hi,
    I am new to developing web services using JAX_RPC. I am trying to return a xml document to the client from the web service.
    My Server implementation is as follows:
    Interface:
    public interface OntoIF extends Remote
    public DataHandler ontoCompare (String targetUrl,String sourceUrl ) throws RemoteException;
    Implementaion:
    public class OntoImpl implements OntoIF
    public DataHandler ontoCompare (String targetUrl,String sourceUrl ) throws RemoteException
    DataHandler dataHandler = new DataHandler( new StreamSource( new File ("status.xml")), "text/xml");
    return dataHandler;
    Client Implementation:
    Stub stb = (Stub) (new OntoService_Impl().getOntoIFPort());
    stb._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY,
         "http://localhost:8080/onto-service/onto");
    OntoIF onto = (OntoIF) stb;
    DataHandler retDHandler = onto.ontoCompare(targetOntoUrl, sourceOntoUrl);
    When I compile and run my client, it throws the following error -
    java.rmi.ServerException: JAXRPCSERVLET28: Missing port information
    at com.sun.xml.rpc.client.StreamingSender._raiseFault(StreamingSender.ja
    va:497)
    at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:294
    at sstub.OntoIF_Stub.echoDataHandler(OntoIF_Stub.java:122)
    at sstub.OntoClient.main(OntoClient.java:63)
    Can you please let me know what I am doing wrong? I have no problems in sending a DataHandler but receiving the DataHandler from the web service throws errors.
    Thanks!

    Hi I'm having the same problem. I try to set up a Web Service using JAX_RPC. My WS should invoke a native Method implemented in C++. Did you got a solution for this issue? My Error Message is as follows:
    java.rmi.ServerException: JAXRPCSERVLET28: Missing port information
         at com.sun.xml.rpc.client.StreamingSender._raiseFault(StreamingSender.java:497)
         at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:294)
         at com.sun.xml.rpc.client.dii.CallInvokerImpl.doInvoke(CallInvokerImpl.java:80)
         at com.sun.xml.rpc.client.dii.BasicCall.invoke(BasicCall.java:489)
         at com.sun.xml.rpc.client.dii.CallInvocationHandler.doCall(CallInvocationHandler.java:122)
         at com.sun.xml.rpc.client.dii.CallInvocationHandler.invoke(CallInvocationHandler.java:86)
    at $Proxy0.getHello(Unknown Source)
         at com.neuhaus.test.ws.client.NativeInvokeClient.main(NativeInvokeClient.java:44)
    Exception in thread "main"
    greetings, JAN

  • How to get client Ip address from web service

    Hello folks,
    I am quite new to web service and developing a web service using netbeans6.0 IDE, where i have to know which client called/used the service, After googling i got code snippet like below
    inject a WebServiceContext instance into your WebService class, and use it in each WebMethod to get the current request's MessageContext Map. Get the SERVLET_REQUEST item from that, cast as an HttpServletRequest. From that HttpServletRequest, you can invoke getRemoteAddr() to get the client's IP.
    @WebService
    public class MyService{
    @Resource
    WebServiceContext wsCtxt;
    @WebMethod
    public void myWebMethod(){
    MessageContext msgCtxt = wsCtxt.getMessageContext();
    HttpServletRequest req = (HttpServletRequest)msgCtxt.get(MessageContext.SERVLET_REQUEST);
    String clientIP = req.getRemoteAddr();
    }But it throws error in my PC like
    Service invocation threw an exception with message : null; Refer to the server log for more details
    Exceptions details : java.lang.reflect.InvocationTargetExceptionIs there any way that says client pc ip address using netbeans6.0 Or what went wrong in my code?
    Largely Thanks in advance.
    SRI.

    I am afraid,
    javax.servlet.ServletException: java.lang.reflect.InvocationTargetException
    at com.sun.enterprise.webservice.monitoring.WebServiceTesterServlet.doPost(WebServiceTesterServlet.java:340)
    at com.sun.enterprise.webservice.monitoring.WebServiceTesterServlet.invoke(WebServiceTesterServlet.java:121)
    at com.sun.enterprise.webservice.JAXWSServlet.doPost(JAXWSServlet.java:148)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:270)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:339)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:261)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:212)
    at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
    at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
    Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.sun.enterprise.webservice.monitoring.WebServiceTesterServlet.doPost(WebServiceTesterServlet.java:311) ... 35 more Caused by: javax.xml.ws.soap.SOAPFaultException: java.lang.NullPointerException at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:187) at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:117) at $Proxy102.processMessage999(Unknown Source) ... 40 more Caused by: java.lang.NullPointerException at org.shar.Handle.processMessage999(Handle.java:120) at com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:361) ... 2 more

Maybe you are looking for