Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Some Doubts in Web service

 
Atul Prabhu
Ranch Hand
Posts: 60
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3150
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
>>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.
 
Gurumurthy Ramamurthy
Ranch Hand
Posts: 273
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic