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, <liter...@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" <shashikantsar...@gmail.com>
> > Komu: <java-user@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, <liter...@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-unsubscr...@axis.apache.org
> >> For additional commands, e-mail: java-user-h...@axis.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org
> For additional commands, e-mail: java-user-h...@axis.apache.org
>
>


-- 
Jaime Hablutzel - 9-9956-3299

(tildes omitidas intencionalmente)

Reply via email to