Hello,
I am new to web services. Could anyone please let me know as to how to
create a document/literal web service using axis? And what type of
client is used to invoke it? I would really appreciate if deploy.wsdd's
contents and client code is provided as I am facing issues using my own.
In addition, what are the changes one needs to make to the client that
works well with rpc/encoded service, to access a doc/literal service?
Service
public class MyService
{
public String serviceMethod(String arg)
{
return arg;
}
}
deploy.wsdd
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="MyService" style="document" use="literal">
<parameter name="className"
value="samples.userguide.example3.MyService"/>
<parameter name="allowedMethods" value="*"/>
</service>
</deployment>
Client
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpointURL) );
call.setOperationName( new QName("http://example3.userguide.samples",
"serviceMethod") );
call.addParameter( "arg", org.apache.axis.encoding.XMLType.XSD_STRING,
ParameterMode.IN);
call.setReturnType( org.apache.axis.encoding.XMLType.XSD_STRING );
String ret = (String) call.invoke( new Object[] { textToSend } );
Thanks.
Regards,
Sushil Duseja