I mean to say, Can I create a dynamic proxy while building the project.
Within the servlet code generated by Netbeans IDE can I communicate to web
service without having JNDI lookup.
I have the following standalone client code which doesn't perform any JNDI
lookup.
//*********************//
package test.client;
import javax.xml.rpc.Stub;
import com.test.*;
public class MyClient {
private String endpointAddress;
public static void main(String argv[]) {
try {
// Invoke createProxy() to create a stub object
String param="Client";
Stub stub = createProxy();
// Set the endpoint address the stub uses to access the service
stub._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY,
"
http://host:port/HelloService/Hello");
// Cast the stub to the service endpoint interface (MathFace)
HelloWs_Stub hell = (HelloWs_Stub)stub;
// String res=hell.sayHello(param);
// Invoke the add method
// System.out.println("Service Reply : "+res);
String s="xyz";
UserInfo ui=(UserInfo)hell.getUserInfo(s);
System.out.println("User Name :"+ui.getUserName());
System.out.println("User Address :"+ui.getUserAddress());
} catch (Exception ex) {
ex.printStackTrace();
}
}
private static Stub createProxy() {
// Create a stub object
// Note that MyFirstService_Impl, generated by wscompile, is
implementation-specific
return (Stub)(new HelloService_Impl().getHelloWsPort());
}
}
//*********************//
Using this code I am able to get the reply from the web service. But I am
unable to use it in the servlet.
Plese let me know what are the supporting files required to deploy a servlet
to talk to web service.
Srinivas.
-----Original Message-----
From: Velidanda Srinivas [mailto:srinivas.velidanda_at_singularity.co.uk]
Sent: 10 February 2006 16:54
To: 'users_at_jax-rpc.dev.java.net'
Subject: RE: Need Help to create a multi tier web service
How to create a servlet client to access a web service.
I tried creating a client using Net Beans but getting
Invocation Target Exception while testing the web service method.
I tried setting up the Proxy Host and Port numbers but getting the same
exception.
Is there a way to run the servlet without having Proxy Host setup on the IDE
instead generating dynamic proxy.
Please let me know the solution for this.
Srinivas.
-----Original Message-----
From: Rico Cruz [mailto:Roderico.Cruz_at_Sun.COM]
Sent: 08 February 2006 13:43
To: users_at_jax-rpc.dev.java.net
Subject: Re: Need Help to create a multi tier web service
As has been mentioned in this thread, web services created in Netbeans
are J2EE 1.4 compliant. You can first create an EJB module project then
create a web service in that project. All of these are wizard driven.
Follow the links mentioned in this thread.
Rico
Velidanda Srinivas wrote:
> Hi all,
>
> Can some one let me know how can I create a multi tier web service using
> EJB, by which I can deploy the client api using which thru any web server
I
> can invoke the web service residing on the App Server.
>
> This web service should be J2EE 1.4 compliant.
>
> thanks,
> Srinivas.
>
> -----Original Message-----
> From: Rico Cruz [mailto:Roderico.Cruz_at_Sun.COM]
> Sent: 08 February 2006 00:28
> To: users_at_jax-rpc.dev.java.net
> Cc: Geertjan Wielenga
> Subject: Re: Where can I get a sample application development details
> using JAXRPC
>
>
> Jagan,
> It sounds like you would like to develop and deploy J2EE web services.
> Netbeans provides tools for creating, deploying and running these web
> services, based on JAXRPC and JSR 109.
> Here is a link to get you started:
> http://www.netbeans.org/kb/41/tutorial-webservice.html
>
> Also, you may want to browse Geertjan Wielenga's blog. He is a prolific
> writer on web services in Netbeans as well as other topics:
> http://blogs.sun.com/geertjan
>
> Hope this helps.
> Rico Cruz
>
> Dulipala, Jagannadham wrote:
>
>> Hi
>>
>> I am trying to prepare a simple web service application using JAXRPC
>> tools
>> I saw the simple and simple bean applications when I install jwsdp under
>> samples.
>> And I was able to run them successfully using
>> http://docs.sun.com/source/817-5452/wsgjaxrpc.html#wp1009534 help
>>
>>
>> I want to take an Remote interface as a starting point.
>>
>> Further I want to generate wsdl, ofcourse implementation classes I have
>> for my remote interface.
>>
>> And also I want to prepare a ear file to deploy
>> I want the details of the deployment files to create the ear .
>>
>> If any help how to proceed to create a web service application
>> (deployeble) on sun system.
>>
>>
>> Tools guides etc can helps me a lot
>>
>> Jagan
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
>> For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
> For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
>
>
> ________________________________________________________________________
> This e-mail has been scanned for all viruses by MessageLabs.
> ________________________________________________________________________
>
> ________________________________________________________________________
> This e-mail has been scanned for all viruses by MessageLabs.
> ________________________________________________________________________
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
> For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
________________________________________________________________________
This e-mail has been scanned for all viruses by MessageLabs.
________________________________________________________________________
________________________________________________________________________
This e-mail has been scanned for all viruses by MessageLabs.
________________________________________________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
________________________________________________________________________
This e-mail has been scanned for all viruses by MessageLabs.
________________________________________________________________________
________________________________________________________________________
This e-mail has been scanned for all viruses by MessageLabs.
________________________________________________________________________