axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Fremantle" <pzf...@gmail.com>
Subject Re: Axis 1 to Axis 2
Date Thu, 24 May 2007 18:21:31 GMT
Doug

>    Service service = new Service();
>    Call call = (Call) service.createCall();

ServiceClient sc = new ServiceClient();

>    //set the properties for using the SOAPaction
>    call.setProperty(Call.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
>    call.setProperty(Call.SOAPACTION_URI_PROPERTY, SOAPaction);

sc.getOptions().setAction(SOAPAction);


>    //set the endpoint url
>    call.setTargetEndpointAddress( new java.net.URL(endpointUrl) );

sc.setTargetEPR(new EndpointReference(endpointUrl));



>    //add SOAP elements
>    SOAPBodyElement[] input = new SOAPBodyElement[1];
>
>    Element inputQuery =  doc.getDocumentElement();
>
>    input[0] = new SOAPBodyElement(inputQuery);
>

OMElement el = // here you have to create an OMElement!

>    result = (String) call.invoke( input );

OMElement result = sc.sendReceive(el);

The OMElement interface is similar to DOM. If you are creating by hand
using DOM APIs it might be worth porting over to OM. There is also a
DOM over OM implementation called DOOM if you have a lot of DOM code.

Paul

On 5/24/07, Doug Schaible <dougjrs@gmail.com> wrote:
> Good afternoon!
>
> Can anyone tell me what the code below would look like in Axis2?  I need to
> create a SOAP client in Axis 2 that allows me to pass the payload and one
> that allows me to pass the entire message.  I understand that I should use
> the operation client interface and the service client interface, but I can
> not find an example of using those two without first generating stubs with
> wsdl2java.  I can not use wsdl2java.
>
> Thanks,
> Doug
>
>
>
>
>
>    //create new service to be able to use for call
>    Service service = new Service();
>    Call call = (Call) service.createCall();
>
>    //set the properties for using the SOAPaction
>    call.setProperty(Call.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
>    call.setProperty(Call.SOAPACTION_URI_PROPERTY, SOAPaction);
>
>    //set the endpoint url
>    call.setTargetEndpointAddress( new java.net.URL(endpointUrl) );
>
>    //add SOAP elements
>    SOAPBodyElement[] input = new SOAPBodyElement[1];
>
>    Element inputQuery =  doc.getDocumentElement();
>
>    input[0] = new SOAPBodyElement(inputQuery);
>
>    result = (String) call.invoke( input );


-- 
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair

blog: http://pzf.fremantle.org
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

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


Mime
View raw message