Re: Fwd: Fwd: Need Help Regarding AXIS2 Client Implementation

Deepal Jayasinghe <[email protected]>
Newsgroups gmane.text.xml.axis.user
Message-ID <[email protected]>
Which means you are sending the wrong request, can use pass us the WSDL,
we can have a quick look at.

Deepal

> Hi,
>
> I have changed data-binding from ADB to XMLBeans while generating
> stubs i.e now I am using XMLbeans data binding so now I can pass
> payload XML as string to set operation of my service request so now
> I've got rid of OMElement but still I getting the same exception. any
> idea?
>
> Regards,
> Rajnish Thakur
>
>
> On Thu, Jan 16, 2014 at 10:19 PM, Deepal jayasinghe <[email protected]
> <mailto:[email protected]>> wrote:
>
>     And if the wsdl says it needs an "objXML" as a method parameter,
>     then it should ready to take any XML. So, problem should be in the
>     service, if it needs a string then the service should specify that
>     in the WSDL.
>
>     One possible way to handle that would be is to get the working
>     version of the client and send it through TCP monitor and find the
>     correct message format that the service is asking for. Then create
>     the OMElement with that format.
>
>     Deepal
>>     Hi,
>>
>>     Please somebody cab help me on issue below.
>>      
>>     Regards,
>>     Rajnish Thakur
>>
>>
>>     ---------- Forwarded message ----------
>>     From: *Rajnish Thakur* <[email protected]
>>     <mailto:[email protected]>>
>>     Date: Mon, Jan 13, 2014 at 5:19 PM
>>     Subject: Re: Fwd: Need Help Regarding AXIS2 Client Implementation
>>     To: [email protected] <mailto:[email protected]>
>>
>>
>>     Hi All,
>>
>>     PSB WSDL document that I used to generate stub using Wsdl2java
>>     tool. and have attached Interface Create generated using tool
>>     that causing exception in application. 
>>
>>     Inline image 1
>>
>>     Inline image 2
>>
>>     Let me know if further details required.
>>
>>     Regards,
>>     Rajnish Thakur
>>
>>     Regards,
>>     Rajnish Thakur
>>
>>
>>     On Sun, Jan 12, 2014 at 7:40 PM, Rajnish Thakur
>>     <[email protected] <mailto:[email protected]>> wrote:
>>
>>         Hi Deepal,
>>
>>         Thanks for your reply on my question. as my service accepts
>>         xml payload in form of string and in wsdl there is no type
>>         define for objXML hence AXIS2 automatically mapped it to
>>         OMElement type. another important note is wsdltojava tool map
>>         objXML parameter to OMElement in case of I am using ADB
>>         binding but when I generate stub using XMLBEAN databinding it
>>         map it as string.
>>
>>         When I debug it I found the problem is due to serialization
>>         of objXML parameter as service expects sting and AXIS2
>>         framework serialized objectXML using xmlstreamWriter hence
>>         exception comes out from AXIS2 core jar. This are my
>>         observations and assumption that I put here to understand the
>>         actual problem hope it helps let me know if you need any
>>         other details.
>>
>>
>>         Regards,
>>         Rajnish Thakur
>>
>>
>>         On Sat, Jan 11, 2014 at 11:29 PM, Deepal jayasinghe
>>         <[email protected] <mailto:[email protected]>> wrote:
>>
>>             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);                                              
>>>                         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
>>>
>>>
>>>
>>
>>
>>
>>
>>
>>
>>
>>     ---------------------------------------------------------------------
>>     To unsubscribe, e-mail: [email protected] <mailto:[email protected]>
>>     For additional commands, e-mail: [email protected] <mailto:[email protected]>
>
>

-- 
Blog - http://blogs.deepal.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.