You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Duseja, Sushil" <Su...@fiserv.co.in> on 2008/02/11 13:21:44 UTC
document/literal web service
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
Re: document/literal web service
Posted by Anne Thomas Manes <at...@gmail.com>.
In the WSDD, specify
<service name="MyService" style="wrapped" use="literal">
The wrapped style supports an RPC-like programming interface.
For the client, use WSDL2Java to generate a client proxy. The DII call
interface wasn't designed to work with document/literal.
Anne
On Feb 11, 2008 7:21 AM, Duseja, Sushil <Su...@fiserv.co.in> wrote:
>
>
>
>
> 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
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org