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 li...@centrum.cz on 2012/04/05 21:31:37 UTC

how to invoke web service without generating a client

Hi,

as I know axis, you need to generate a java client from WSDL and then invoke its stub to submit a remote service. My task is to create a proxy, that knows an endpoint and receives XML corresponding to the WSDL. The proxy then must open the endpoint and submit the soap body XML, read the response and send it back. The proxy must be dynamic and it must not contain java code specific to WSDL. Everything must be dynamic and configurable. Generating and compiling java code is not desirable.

How can I implement such proxy with axis2? Can you give me some hints please, where to start?

Thanks

Leoš

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


Re: AW: how to invoke web service without generating a client

Posted by li...@centrum.cz.
Thank you/ Danke schon Josef, Jaime and George, I will try your suggestions.

Leoš

______________________________________________________________
> Od: "Stadelmann Josef" <jo...@axa-winterthur.ch>
> Komu: <ja...@axis.apache.org>
> Datum: 10.04.2012 08:57
> Předmět: AW: how to invoke web service without generating a client
>
>Leos,
>
>I think what you need is
>to open the axis2 web pages from apache and 
>have a look at JAX-WS - Dynamic Proxy Client!
>There are two client models supported by JAX-WS
>And one should give you what you want,
>full dynamic creation of a client-stub at runtime.
>
>Josef

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


AW: how to invoke web service without generating a client

Posted by Stadelmann Josef <jo...@axa-winterthur.ch>.
Leos,

I think what you need is
to open the axis2 web pages from apache and 
have a look at JAX-WS - Dynamic Proxy Client!
There are two client models supported by JAX-WS
And one should give you what you want,
full dynamic creation of a client-stub at runtime.

Josef



-----Ursprüngliche Nachricht-----
Von: literakl@centrum.cz [mailto:literakl@centrum.cz] 
Gesendet: Donnerstag, 5. April 2012 21:32
An: java-user@axis.apache.org
Betreff: how to invoke web service without generating a client


Hi,

as I know axis, you need to generate a java client from WSDL and then invoke its stub to submit a remote service. My task is to create a proxy, that knows an endpoint and receives XML corresponding to the WSDL. The proxy then must open the endpoint and submit the soap body XML, read the response and send it back. The proxy must be dynamic and it must not contain java code specific to WSDL. Everything must be dynamic and configurable. Generating and compiling java code is not desirable.

How can I implement such proxy with axis2? Can you give me some hints please, where to start?

Thanks

Leoš

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


Re: how to invoke web service without generating a client

Posted by Jaime Hablutzel Egoavil <ha...@gmail.com>.
If you have the payload you want to send as a string then use
HTTPURLConnection

Construct your payload as a string
open a connection to the endpoint
send and receive the content as a input stream
parse the received content with an xml proccesor or regex, or whatever else

you can get a place to start here:
http://stackoverflow.com/questions/2793150/how-to-use-java-net-urlconnection-to-fire-and-handle-http-requests

If you wan't to use a more sophisiticated way with axis2 and axiom you can
you this way to construct the payload programmatically:

/**
 * Axis2ServiceClientSendReceive.java
 * Copyright (c) 2009 by Dr. Herong Yang, herongyang.com
 * All rights reserved
 */
import java.io.PrintStream;
import java.net.URL;
import javax.xml.namespace.QName;
import org.apache.axis2.client.ServiceClient;
import org.apache.axiom.om.OMElement;
class Axis2ServiceClientSendReceive {
   public static void main(String[] args) {
      PrintStream out = System.out;

// Setting initial values
      String wsdl = "file:///C:/herong/Hello_WSDL_11_SOAP.wsdl";
      String tns = "http://www.herongyang.com/Service/";
      String serviceName = "helloService";
      String portName = "helloPort";

      try {
         ServiceClient client = new ServiceClient(null,
            new URL(wsdl), new QName(tns, serviceName), portName);
         OMElement request = null;
	 OMElement response = client.sendReceive(
	    new QName(tns, "Hello"), request);
	out.println(response);
      } catch (Exception e) {
         e.printStackTrace();
      }
   }
}

Taken from
http://www.herongyang.com/WSDL/Java-Axis2-141-sendReceive-Method-Invoke-Operation.html





On Mon, Apr 9, 2012 at 2:17 PM, <li...@centrum.cz> wrote:

>
> Hi,
>
> I can use IntelliJ Idea or Eclipse. But as I wrote, I do not want to
> generate client specific to concrete WSDL. I need a client to support any
> SOAP service given I have binding details and XML according to WSDL. Can I
> do it with Axis2?
>
> Thanks
>
> Leoš
>
> ______________________________________________________________
> > Od: "Shashikant Sarade" <sh...@gmail.com>
> > Komu: <ja...@axis.apache.org>
> > Datum: 06.04.2012 15:20
> > Předmět: Re: how to invoke web service without generating a client
> >
> >Dear Leos
> >If you are using any IDE there is direct option of creating client ...
> >
> >On Fri, Apr 6, 2012 at 1:01 AM, <li...@centrum.cz> wrote:
> >
> >>
> >> Hi,
> >>
> >> as I know axis, you need to generate a java client from WSDL and then
> >> invoke its stub to submit a remote service. My task is to create a
> proxy,
> >> that knows an endpoint and receives XML corresponding to the WSDL. The
> >> proxy then must open the endpoint and submit the soap body XML, read the
> >> response and send it back. The proxy must be dynamic and it must not
> >> contain java code specific to WSDL. Everything must be dynamic and
> >> configurable. Generating and compiling java code is not desirable.
> >>
> >> How can I implement such proxy with axis2? Can you give me some hints
> >> please, where to start?
> >>
> >> Thanks
> >>
> >> Leoš
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> >> For additional commands, e-mail: java-user-help@axis.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>


-- 
Jaime Hablutzel - 9-9956-3299

(tildes omitidas intencionalmente)

Re: how to invoke web service without generating a client

Posted by Jaime Hablutzel Egoavil <ha...@gmail.com>.
actually George's approach is more specifc to your description

On Mon, Apr 9, 2012 at 3:23 PM, George Stanchev <Gs...@serena.com>wrote:

>
> http://stackoverflow.com/questions/2058963/any-way-to-use-axis2-client-web-services-w-o-generating-a-stub-class
>
>
>
> -----Original Message-----
> From: literakl@centrum.cz [mailto:literakl@centrum.cz]
> Sent: Monday, April 09, 2012 1:17 PM
> To: java-user@axis.apache.org
> Subject: Re: how to invoke web service without generating a client
>
>
> Hi,
>
> I can use IntelliJ Idea or Eclipse. But as I wrote, I do not want to
> generate client specific to concrete WSDL. I need a client to support any
> SOAP service given I have binding details and XML according to WSDL. Can I
> do it with Axis2?
>
> Thanks
>
> LeoĹĄ
>
> ______________________________________________________________
> > Od: "Shashikant Sarade" <sh...@gmail.com>
> > Komu: <ja...@axis.apache.org>
> > Datum: 06.04.2012 15:20
> > Předmět: Re: how to invoke web service without generating a client
> >
> >Dear Leos
> >If you are using any IDE there is direct option of creating client ...
> >
> >On Fri, Apr 6, 2012 at 1:01 AM, <li...@centrum.cz> wrote:
> >
> >>
> >> Hi,
> >>
> >> as I know axis, you need to generate a java client from WSDL and then
> >> invoke its stub to submit a remote service. My task is to create a
> >> proxy, that knows an endpoint and receives XML corresponding to the
> >> WSDL. The proxy then must open the endpoint and submit the soap body
> >> XML, read the response and send it back. The proxy must be dynamic
> >> and it must not contain java code specific to WSDL. Everything must
> >> be dynamic and configurable. Generating and compiling java code is not
> desirable.
> >>
> >> How can I implement such proxy with axis2? Can you give me some hints
> >> please, where to start?
> >>
> >> Thanks
> >>
> >> LeoĹĄ
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> >> For additional commands, e-mail: java-user-help@axis.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>
>


-- 
Jaime Hablutzel - 9-9956-3299

(tildes omitidas intencionalmente)

RE: how to invoke web service without generating a client

Posted by George Stanchev <Gs...@serena.com>.
http://stackoverflow.com/questions/2058963/any-way-to-use-axis2-client-web-services-w-o-generating-a-stub-class



-----Original Message-----
From: literakl@centrum.cz [mailto:literakl@centrum.cz] 
Sent: Monday, April 09, 2012 1:17 PM
To: java-user@axis.apache.org
Subject: Re: how to invoke web service without generating a client


Hi,

I can use IntelliJ Idea or Eclipse. But as I wrote, I do not want to generate client specific to concrete WSDL. I need a client to support any SOAP service given I have binding details and XML according to WSDL. Can I do it with Axis2?

Thanks

Leoš

______________________________________________________________
> Od: "Shashikant Sarade" <sh...@gmail.com>
> Komu: <ja...@axis.apache.org>
> Datum: 06.04.2012 15:20
> Předmět: Re: how to invoke web service without generating a client
>
>Dear Leos
>If you are using any IDE there is direct option of creating client ...
>
>On Fri, Apr 6, 2012 at 1:01 AM, <li...@centrum.cz> wrote:
>
>>
>> Hi,
>>
>> as I know axis, you need to generate a java client from WSDL and then 
>> invoke its stub to submit a remote service. My task is to create a 
>> proxy, that knows an endpoint and receives XML corresponding to the 
>> WSDL. The proxy then must open the endpoint and submit the soap body 
>> XML, read the response and send it back. The proxy must be dynamic 
>> and it must not contain java code specific to WSDL. Everything must 
>> be dynamic and configurable. Generating and compiling java code is not desirable.
>>
>> How can I implement such proxy with axis2? Can you give me some hints 
>> please, where to start?
>>
>> Thanks
>>
>> Leoš
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
>>
>

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



Re: how to invoke web service without generating a client

Posted by li...@centrum.cz.
Hi,

I can use IntelliJ Idea or Eclipse. But as I wrote, I do not want to generate client specific to concrete WSDL. I need a client to support any SOAP service given I have binding details and XML according to WSDL. Can I do it with Axis2?

Thanks

Leoš

______________________________________________________________
> Od: "Shashikant Sarade" <sh...@gmail.com>
> Komu: <ja...@axis.apache.org>
> Datum: 06.04.2012 15:20
> Předmět: Re: how to invoke web service without generating a client
>
>Dear Leos
>If you are using any IDE there is direct option of creating client ...
>
>On Fri, Apr 6, 2012 at 1:01 AM, <li...@centrum.cz> wrote:
>
>>
>> Hi,
>>
>> as I know axis, you need to generate a java client from WSDL and then
>> invoke its stub to submit a remote service. My task is to create a proxy,
>> that knows an endpoint and receives XML corresponding to the WSDL. The
>> proxy then must open the endpoint and submit the soap body XML, read the
>> response and send it back. The proxy must be dynamic and it must not
>> contain java code specific to WSDL. Everything must be dynamic and
>> configurable. Generating and compiling java code is not desirable.
>>
>> How can I implement such proxy with axis2? Can you give me some hints
>> please, where to start?
>>
>> Thanks
>>
>> Leoš
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
>> For additional commands, e-mail: java-user-help@axis.apache.org
>>
>>
>

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


Re: how to invoke web service without generating a client

Posted by Shashikant Sarade <sh...@gmail.com>.
Dear Leos
If you are using any IDE there is direct option of creating client ...

On Fri, Apr 6, 2012 at 1:01 AM, <li...@centrum.cz> wrote:

>
> Hi,
>
> as I know axis, you need to generate a java client from WSDL and then
> invoke its stub to submit a remote service. My task is to create a proxy,
> that knows an endpoint and receives XML corresponding to the WSDL. The
> proxy then must open the endpoint and submit the soap body XML, read the
> response and send it back. The proxy must be dynamic and it must not
> contain java code specific to WSDL. Everything must be dynamic and
> configurable. Generating and compiling java code is not desirable.
>
> How can I implement such proxy with axis2? Can you give me some hints
> please, where to start?
>
> Thanks
>
> Leoš
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>