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 Chris Riekenberg <ax...@christian-riekenberg.de> on 2006/09/06 11:09:29 UTC

Consuming a web service

Hi,

I'm new with web services in java an got an
understanding problem.

There are two types for consuming a web service:

1) Call a service direct

Service service = new Service();
Call call = (Call)service.createCall();
...
String ret = (String)call.invoke(params);



2) Consuming a WSDL and creating stubs

MI_RFC_CALL_SYNC_OUTService serviceLocator =
  new MI_RFC_CALL_SYNC_OUTServiceLocator();
...


Questions:
==========

1.) When do you use which one?? I tried first way and it
works good with open/free web services, but it failed
with a web service of SAP XI.

2.) In first way, the WSDL-File isn't needed, is it?
I only need information out of it, but it's binded nowhere, right?

3.) Did anyone got a good example for the second way?
I read the user's guide of apache, but got problems with it.


thanks
christian



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Consuming a web service

Posted by Anne Thomas Manes <at...@gmail.com>.
The WSDL should tell you what you need to know. If you compile a stub,
Axis should generate everything for you. If you use the DII, then you
need to define the WSDL settings in your code.

On 9/6/06, Chris Riekenberg <ax...@christian-riekenberg.de> wrote:
> Thanks for response and the tutorial.
> Do you also know an example for configure
> a SAP XI web service in the java client???
>
> regards
> chris
>
>
> > Both programming models create a SOAP message and send it to the
> > service endpoint. The first method gives you more explicit control
> > over the interaction, and it supports more dynamic capabilities. The
> > second method is more automatic, but less dynamic. You can choose your
> > method based on your programming preferences and your application
> > requirements.
> >
> > One reason why you may have had trouble with the XI service is that
> > you may not have set all the necessary settings properly. One
> > advantage of using a compiled stub is that you can depend on Axis to
> > set all the necessary settings properly (as specified in the WSDL).
> >
> > Here's a tutorial using a compiled stub:
> > http://ws.apache.org/axis/cpp/arch/End-2-End-Sample.html
> >
> > Anne
> >
> > On 9/6/06, Chris Riekenberg <ax...@christian-riekenberg.de> wrote:
> >> Hi,
> >>
> >> I'm new with web services in java an got an
> >> understanding problem.
> >>
> >> There are two types for consuming a web service:
> >>
> >> 1) Call a service direct
> >>
> >> Service service = new Service();
> >> Call call = (Call)service.createCall();
> >> ...
> >> String ret = (String)call.invoke(params);
> >>
> >>
> >>
> >> 2) Consuming a WSDL and creating stubs
> >>
> >> MI_RFC_CALL_SYNC_OUTService serviceLocator =
> >>   new MI_RFC_CALL_SYNC_OUTServiceLocator();
> >> ...
> >>
> >>
> >> Questions:
> >> ==========
> >>
> >> 1.) When do you use which one?? I tried first way and it
> >> works good with open/free web services, but it failed
> >> with a web service of SAP XI.
> >>
> >> 2.) In first way, the WSDL-File isn't needed, is it?
> >> I only need information out of it, but it's binded nowhere, right?
> >>
> >> 3.) Did anyone got a good example for the second way?
> >> I read the user's guide of apache, but got problems with it.
> >>
> >>
> >> thanks
> >> christian
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> >> For additional commands, e-mail: axis-user-help@ws.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Consuming a web service

Posted by Chris Riekenberg <ax...@christian-riekenberg.de>.
Thanks for response and the tutorial.
Do you also know an example for configure
a SAP XI web service in the java client???

regards
chris


> Both programming models create a SOAP message and send it to the
> service endpoint. The first method gives you more explicit control
> over the interaction, and it supports more dynamic capabilities. The
> second method is more automatic, but less dynamic. You can choose your
> method based on your programming preferences and your application
> requirements.
>
> One reason why you may have had trouble with the XI service is that
> you may not have set all the necessary settings properly. One
> advantage of using a compiled stub is that you can depend on Axis to
> set all the necessary settings properly (as specified in the WSDL).
>
> Here's a tutorial using a compiled stub:
> http://ws.apache.org/axis/cpp/arch/End-2-End-Sample.html
>
> Anne
>
> On 9/6/06, Chris Riekenberg <ax...@christian-riekenberg.de> wrote:
>> Hi,
>>
>> I'm new with web services in java an got an
>> understanding problem.
>>
>> There are two types for consuming a web service:
>>
>> 1) Call a service direct
>>
>> Service service = new Service();
>> Call call = (Call)service.createCall();
>> ...
>> String ret = (String)call.invoke(params);
>>
>>
>>
>> 2) Consuming a WSDL and creating stubs
>>
>> MI_RFC_CALL_SYNC_OUTService serviceLocator =
>>   new MI_RFC_CALL_SYNC_OUTServiceLocator();
>> ...
>>
>>
>> Questions:
>> ==========
>>
>> 1.) When do you use which one?? I tried first way and it
>> works good with open/free web services, but it failed
>> with a web service of SAP XI.
>>
>> 2.) In first way, the WSDL-File isn't needed, is it?
>> I only need information out of it, but it's binded nowhere, right?
>>
>> 3.) Did anyone got a good example for the second way?
>> I read the user's guide of apache, but got problems with it.
>>
>>
>> thanks
>> christian
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Consuming a web service

Posted by Anne Thomas Manes <at...@gmail.com>.
Both programming models create a SOAP message and send it to the
service endpoint. The first method gives you more explicit control
over the interaction, and it supports more dynamic capabilities. The
second method is more automatic, but less dynamic. You can choose your
method based on your programming preferences and your application
requirements.

One reason why you may have had trouble with the XI service is that
you may not have set all the necessary settings properly. One
advantage of using a compiled stub is that you can depend on Axis to
set all the necessary settings properly (as specified in the WSDL).

Here's a tutorial using a compiled stub:
http://ws.apache.org/axis/cpp/arch/End-2-End-Sample.html

Anne

On 9/6/06, Chris Riekenberg <ax...@christian-riekenberg.de> wrote:
> Hi,
>
> I'm new with web services in java an got an
> understanding problem.
>
> There are two types for consuming a web service:
>
> 1) Call a service direct
>
> Service service = new Service();
> Call call = (Call)service.createCall();
> ...
> String ret = (String)call.invoke(params);
>
>
>
> 2) Consuming a WSDL and creating stubs
>
> MI_RFC_CALL_SYNC_OUTService serviceLocator =
>   new MI_RFC_CALL_SYNC_OUTServiceLocator();
> ...
>
>
> Questions:
> ==========
>
> 1.) When do you use which one?? I tried first way and it
> works good with open/free web services, but it failed
> with a web service of SAP XI.
>
> 2.) In first way, the WSDL-File isn't needed, is it?
> I only need information out of it, but it's binded nowhere, right?
>
> 3.) Did anyone got a good example for the second way?
> I read the user's guide of apache, but got problems with it.
>
>
> thanks
> christian
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org