[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kandula-dev
Subject:    Re: Fwd: Need Help Regarding AXIS2 Client Implementation
From:       Rajnish Thakur <rajneesh.rt () gmail ! com>
Date:       2014-01-13 14:34:11
Message-ID: CALyeGLsePSrVmAjKu7BMz5Gs-oJXCt-LyJ8SMsga47snQP=YGA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi,

Please Somebody can help on below.

Regards,
Rajnish Thakur


On Mon, Jan 13, 2014 at 5:19 PM, Rajnish Thakur <rajneesh.rt@gmail.com>wrote:

> 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.
>
> [image: Inline image 1]
>
> [image: 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 <rajneesh.rt@gmail.com>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 <deepalk@gmail.com>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
>>>
>>>
>>>
>>>
>>>
>>
>

[Attachment #5 (text/html)]

<div dir="ltr">Hi,<div><br></div><div>Please Somebody can help on below.</div><div \
class="gmail_extra"><br clear="all"><div><div dir="ltr">Regards,<div>Rajnish \
Thakur</div></div></div> <br><br><div class="gmail_quote">On Mon, Jan 13, 2014 at \
5:19 PM, Rajnish Thakur <span dir="ltr">&lt;<a href="mailto:rajneesh.rt@gmail.com" \
target="_blank">rajneesh.rt@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
 <div dir="ltr">Hi All,<div><br></div><div>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. </div><div><br> </div>
<div><img src="cid:ii_1438b6328193e636" alt="Inline image \
1"><br></div><div><br></div><div><img src="cid:ii_1438b65f62543781" alt="Inline image \
2"><br></div><div><br></div><div>Let me know if further details required.</div>

<div><br></div><div>Regards,</div><div>Rajnish Thakur</div></div><div \
class="gmail_extra"><br clear="all"><div><div dir="ltr">Regards,<div>Rajnish \
Thakur</div></div></div><div><div class="h5"> <br><br><div class="gmail_quote">On \
Sun, Jan 12, 2014 at 7:40 PM, Rajnish Thakur <span dir="ltr">&lt;<a \
href="mailto:rajneesh.rt@gmail.com" \
target="_blank">rajneesh.rt@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


<div dir="ltr">Hi Deepal,<div><br></div><div>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.</div>


<div><br></div><div>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.</div>


<div><br></div><div class="gmail_extra"><br clear="all"><div><div \
dir="ltr">Regards,<div>Rajnish Thakur</div></div></div><div><div> <br><br><div \
class="gmail_quote">On Sat, Jan 11, 2014 at 11:29 PM, Deepal jayasinghe <span \
dir="ltr">&lt;<a href="mailto:deepalk@gmail.com" \
target="_blank">deepalk@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">




  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>Not sure why you want to create an
      OMElement, what does the WSDL says about the method signature ?<span><font \
color="#888888"><br>  <br>
      Deepal<br>
    </font></span></div><div><div>
    <blockquote type="cite">
      <div dir="ltr">
        <div class="gmail_quote">
          <div dir="ltr">
            <div class="gmail_quote">
              <div dir="ltr">
                <div class="gmail_quote">
                  <div dir="ltr">
                    <div>
                      <div>
                        <div class="gmail_quote">
                          <div dir="ltr">Hi,
                            <div><br>
                            </div>
                            <div>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&#39;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</div>
                            <div>
                              <div>
                                <div>t.approva.BizRights.Services -d
                                  adb)</div>
                                <div><br>
                                </div>
                                <div>as well as have used below command
                                  and wrote client for both.</div>
                                <div><br>
                                </div>
                                <div>
                                  <div style="color:rgb(34,34,34)">WSDL2Java
                                    -uri approvalrequestmanager.wsdl -p
                                    ne<span \
                style="color:rgb(80,0,80)">t.approva.BizRights.Services
                                      -d xmlbeans -s</span></div>
                                </div>
                                <div>
                                  <div><br>
                                  </div>
                                  <div>I have posted this on
                                    stackOverflow.com as well PSB link-</div>
                                  <div><a \
href="http://stackoverflow.com/questions/20999991/exception-while-trying-to-execute-axis2-service-client" \
target="_blank">http://stackoverflow.com/questions/20999991/exception-while-trying-to-execute-axis2-service-client</a><br>




                                  </div>
                                  <div><br>
                                  </div>
                                  <div>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).</div>
                                  <div>
                                    <br>
                                  </div>
                                  <div>When I try to send payload XML
                                    using code below:</div>
                                  <div><br>
                                  </div>
                                  <div>Create req = new Create();<br>
                                  </div>
                                  <div><br>
                                  </div>
                                  <div>
                                    <div>           
                                      org.apache.axiom.om.OMFactory fac
                                      =
                                      \
org.apache.axiom.om.OMAbstractFactory.getOMFactory();</div>  <div>           
                                      org.apache.axiom.om.OMNamespace
                                      omNs = fac.createOMNamespace(&quot;<a \
href="http://www.approva.net/BizRights/Services" \
target="_blank">http://www.approva.net/BizRights/Services</a>&quot;,  null);          \
  </div>
                                    <div>           
                                      org.apache.axiom.om.OMElement
                                      _valueObjXML =
                                      \
fac.createOMElement(&quot;approvalrequests&quot;,  omNs);                            
                                                         </div>
                                    <div>           
                                      \
_valueObjXML.addChild(fac.createOMText(_valueObjXML,  content));                   \
                </div>
                                    <div><span style="white-space:pre-wrap"> \
</span></div>  <div>           </div>
                                    <div>           
                                      req.setObjXML(_valueObjXML);</div>
                                  </div>
                                  <div><br>
                                  </div>
                                  \
<div>req.setObjType(WellKnownType.ApprovalRequest);</div>  <div><br>
                                  </div>
                                  <div> res = stub.create(req,
                                    brSoapHeader);  <br>
                                  </div>
                                  <div><br>
                                  </div>
                                  <div><b>I got exception below:</b></div>
                                  <div><br>
                                  </div>
                                  <div>rg.apache.axis2.AxisFault:
                                    System.Web.Services.Protocols.SoapException:
                                    Server was unable to process
                                    request. ---&gt;
                                    System.InvalidCastException: Unable
                                    to cast object of type
                                    &#39;System.Xml.XmlNode[]&#39; to type
                                    &#39;System.String&#39;.</div>
                                  <div><br>
                                  </div>
                                  <div>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.</div>
                                  <div><br>
                                  </div>
                                  <div>
                                    <br>
                                  </div>
                                  <div>Thanks in advance..!!</div>
                                  <div><br>
                                  </div>
                                  <div>
                                    <div>
                                      <div dir="ltr">Regards,
                                        <div>Rajnish Thakur</div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                    Pune, INDIA</div>
                </div>
                <br>
              </div>
            </div>
            <br>
          </div>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </div></div></div>

</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div></div>

--001a11364d303ff88104efdacd33--


["image.png" (image/png)]
["image.png" (image/png)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic