Date: Sat, 11 Jan 2014 09:59:13 -0800 From: [email protected] To: [email protected] Subject: Re: Fwd: Need Help Regarding AXIS2 Client Implementation
Not sure why you want to create an
OMElement, what does the WSDL says about the method signature ?
Deepal
Hi,
Can you please help me? I have got
stuck for last 4 days with AXIS2 client
also have done lot of googling as well,
but couldn't get help. This is first time
I am working with AXIS2. I have a .asmx
service hosted over IIS, I have generated
stub using AXIS2 (WSDL2Java -uri
approvalrequestmanager.wsdl -p ne
t.approva.BizRights.Services -d
adb)
as well as have used below command
and wrote client for both.
WSDL2Java
-uri approvalrequestmanager.wsdl -p
net.approva.BizRights.Services
-d xmlbeans -s
I have posted this on
stackOverflow.com as well PSB link-
http://stackoverflow.com/questions/20999991/exception-while-trying-to-execute-axis2-service-client
I have written client using
generated stub from above command.
In my client code there is method
which accepts two parameters one is
kind of string and another is kind
of OMElement(XML).
When I try to send payload XML
using code below:
Create req = new Create();
org.apache.axiom.om.OMFactory fac
=
org.apache.axiom.om.OMAbstractFactory.getOMFactory();
org.apache.axiom.om.OMNamespace
omNs =
fac.createOMNamespace("http://www.approva.net/BizRights/Services",
null);
http://www.approva.net/BizRights/Services
MG>Lots of marketing but no xsd (XML Schema)
MG>if you want Deepal, Andreas, Brian or myself to help you're going to have to
share all applicable XSDs
MG>once we have an idea of how the Complex and Simple elements are defined
MG>we can determine the method signature for operation which Deepal had
requested
org.apache.axiom.om.OMElement
_valueObjXML =
fac.createOMElement("approvalrequests",
omNs);
_valueObjXML.addChild(fac.createOMText(_valueObjXML,
content));
req.setObjXML(_valueObjXML);
req.setObjType(WellKnownType.ApprovalRequest);
res = stub.create(req,
brSoapHeader);
I got exception below:
rg.apache.axis2.AxisFault:
System.Web.Services.Protocols.SoapException:
Server was unable to process
request. --->
System.InvalidCastException: Unable
to cast object of type
'System.Xml.XmlNode[]' to type
'System.String'.
Looking at the exception my
assumption is OMelement is getting
passed as XML type and and web
service expecting string type so is
there any way to handle such
situation in AXIS2.
Thanks in advance..!!
Regards,
Rajnish Thakur
Pune, INDIA
