This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Web Services and the fly likes Some Doubts in Web service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Some Doubts in Web service" Watch "Some Doubts in Web service" New topic
Author

Some Doubts in Web service

Atul Prabhu
Ranch Hand

Joined: Dec 17, 2002
Posts: 60
Hi all,

I am entirely new to web service. So please correct me if I am wrong somewhere.

I have read the basics of web services i.e WSDL,SOAP,UDDI.

I have also gone through the JWSDP package.

1. Is a web service, application server or web server dependent ?

2. What are these tools like Axis, Systinet ? Are they third party tools to be used along with web server/application server ?

3. Where does JWSDP fit ? Can we use the JWSDP package to deploy a web service independent w.r.t server (web/app)? In which scenarios we should use JWSDP package ?

I am pretty confused
Reg



---

A T U L
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
>>1. Is a web service, application server or web server dependent ?
Its web server dependent.

>2. What are these tools like Axis, Systinet ? Are they third party tools >to be used along with web server/application server ?
Axis or systinet is soap implementation tools to enable webserivces. You dont any third party tools unless you need addtional "special" features such as security,barcode etc.,

>3. Where does JWSDP fit ? Can we use the JWSDP package to deploy a web >service independent w.r.t server (web/app)? In which scenarios we should >use JWSDP package ?
JWSDP is another soap implementation tool like axis.
Start learning Axis and try to implement some simple examples, then you will more ideas about this whole buzz.


Spritle Software Blogs
Gurumurthy Ramamurthy
Ranch Hand

Joined: Feb 13, 2003
Posts: 273
Hi Balaji,

It seems you have knowledge on soap.

Hi,

I have written a simple web service:

public class SoapService extends Object {

/** Creates new SoapService */
public SoapService() {
}

/** This is the SOAP exposes method
*/
public String sayGreeting(String name)
{
return "Hello "+name;
}
}

I have written an soap.xml file:

<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
id="urn:greetingService">
<isd rovider type="java" scope="Request" methods="sayGreeting">
<isd:java class="SoapService" static="false"/>
</isd rovider>
</isd:service>

I have deployed this service in Tomcat:

java org.apache.soap.server.ServiceManagerClient
http://localhost:8080/soap/servlet/rpcrouter deploy soap.xml

It is deplyed also.

I have written a SOAP client:

public class ClientClass {

public static void main(String args[])
{
String urlString = args[0];
String name = args[1];

// build a Call object
Call call = new Call();
call.setTargetObjectURI("urn:greetingService");
call.setMethodName("sayGreeting");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);


//creating a parameter list
Vector params = new Vector();
params.addElement(new Parameter("name", String.class, name,null));

// adding the parameter(s) to the Call object
call.setParams(params);

// invoke the soap method
Response res =null;

try {
res= call.invoke(new URL(urlString), "");



if( res.generatedFault()==false)
{
Parameter retValue = res.getReturnValue();
Object value = retValue.getValue();
System.out.println(value);
}else
{
System.out.println("The faulty is: "+res.getFault().getFaultString());
}
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SOAPException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}


}
}

When I run this client:
java clientclass http://localhost:8080/soap/servlet/rpcrouter yourname

It gives me the error:
Unable to resolve target object: SoapService

Why?

Any thoughts?
Guru
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Some Doubts in Web service