Re: Sending SOAP Messages

2005-04-26 Thread Rakesh Lakshminarayana
I modified one of the samples (misc/TestClient.java). On first look It
seems to work. I am listing the code here. Is there an easy way, given
a wsdl and a method name, to generate Server Address, SOAPAction and
SOAP Message?

   public static String msg = "" +
 "http://www.w3.org/2001/XMLSchema-instance\";
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\";
xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\";> " +
" " +
"http://ripedev.com/webservices/\";> " +
"atlanta " +
" " +
" " +
""; 

public static String doTest (String args[], String op) throws Exception {
  Options  opts= new Options( args );
  String   url = "http://www.ripedev.com/webservices/ZipCode.asmx";;
  String   soapAction  =
"http://ripedev.com/webservices/CityToZipCode"; ;

  if (op != null) soapAction = op;

  args = opts.getRemainingArgs();
  if ( args != null ) soapAction = args[0];

  InputStream   input   = new ByteArrayInputStream(msg.getBytes());
  Service   service = new Service();
  Call  call= (Call) service.createCall();
  SOAPEnvelope  env = new SOAPEnvelope(input);

  call.setTargetEndpointAddress( new URL(url) );
  if (soapAction != null) {
  call.setUseSOAPAction( true );
  call.setSOAPActionURI( soapAction );
  }

  System.out.println( "Request:\n" + msg );

  env = call.invoke( env );

  System.out.println( "Response:\n" + env.toString() );
  return( env.toString() );
}

Thanks,
Rakesh

On 4/26/05, Plorks mail <[EMAIL PROTECTED]> wrote:
> 
> 
> Have you found any help yet?
> 
> I'm looking to do soemthing similar and very stuck
> 
> >From: Rakesh Lakshminarayana <[EMAIL PROTECTED]>
> >Reply-To: Rakesh Lakshminarayana <[EMAIL PROTECTED]>
> >To: axis-user@ws.apache.org
> >Subject: Sending SOAP Messages
> >Date: Tue, 26 Apr 2005 09:48:40 -0400
> >
> >I am looking for starting code that can send SOAP Messages using AXIS.
> >If you have any then please do share it with me at [EMAIL PROTECTED]
> >  Thank You.
> >
> >Given Parameters
> >Server Address: http://www.ripedev.com/webservices/ZipCode.asmx
> >SOAPAction: http://ripedev.com/webservices/CityToZipCode
> >SOAP Message::
> > >standalone="no"?> >xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
> >xmlns:http="http://schemas.xmlsoap.org/wsdl/http/";
> >xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
> >xmlns:s="http://www.w3.org/2001/XMLSchema";
> >xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
> >xmlns:tns="http://ripedev.com/webservices/";
> >xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/";
> >xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/";
> >xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
> >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> >xmlns:xsd="http://www.w3.org/2001/XMLSchema";
> > > >xmlns:tns="http://ripedev.com/webservices/";>atlanta
> 
> _
> Be the first to hear what's new at MSN - sign up to our free newsletters!
> http://www.msn.co.uk/newsletters
> 
>


Sending SOAP Messages

2005-04-26 Thread Rakesh Lakshminarayana
I am looking for starting code that can send SOAP Messages using AXIS.
If you have any then please do share it with me at [EMAIL PROTECTED] 
 Thank You.

Given Parameters
Server Address: http://www.ripedev.com/webservices/ZipCode.asmx
SOAPAction: http://ripedev.com/webservices/CityToZipCode
SOAP Message:: 
http://schemas.xmlsoap.org/soap/envelope/";
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/";
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
xmlns:s="http://www.w3.org/2001/XMLSchema";
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:tns="http://ripedev.com/webservices/";
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/";
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/";
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
>http://ripedev.com/webservices/";>atlanta