You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Hosamath, Viru" <VH...@att.com> on 2007/11/08 21:28:48 UTC

AXIS2 - Webservice Call - WS security - Urgent need help

HI,

 

I'm trying to connect Web service using AXIS2 which has WS security,

 

I have taken some code from this site -

http://wso2.org/library/240
http://wso2.org/library/695

 

Here is my code sample -

 

ServiceClient client = new ServiceClient(ctx,null);

 

Ctx - this is ConfigurationContext

client.setTargetEPR(new EndpointReference(WSDLServericeUrl));

 

//convert java object to AXIOM xml object - I need OMElement, that's why
I'm doing this, but this is not working for me - I'm getting NULL
Pointer exception when I try to convert my java object(I have complex
java object) to XMLStreamReader.

 

Can any one know, how to by-pass AXIOM here, instead OMElement, I want
to pass my java object oRquest. -

XMLStreamReader reader = BeanUtil.getPullParser(oRequest);

StreamWrapper parser = new StreamWrapper(reader);

StAXOMBuilder stAXOMBuilder =
OMXMLBuilderFactory.createStAXOMBuilder(OMAbstractFactory.getOMFactory()
, parser);

OMElement element = stAXOMBuilder.getDocumentElement();

OMElement response = client.sendReceive(element);

System.out.println("Return Code =
"+response.getFirstElement().getText());

 

Any help greatly appreciated! :-(

 

Thanks,

Viru