Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 69037 invoked from network); 28 Mar 2008 03:33:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Mar 2008 03:33:33 -0000 Received: (qmail 62681 invoked by uid 500); 28 Mar 2008 03:33:22 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 62660 invoked by uid 500); 28 Mar 2008 03:33:22 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 62649 invoked by uid 99); 28 Mar 2008 03:33:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Mar 2008 20:33:22 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [64.161.158.12] (HELO smtp.selectica.com) (64.161.158.12) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Mar 2008 03:32:27 +0000 Received: from sltcmsx.selectica.net ([10.0.12.245]) by smtp.selectica.com (8.12.8/8.12.8) with ESMTP id m2S3WidN028208 for ; Thu, 27 Mar 2008 19:32:44 -0800 Received: from sltcmsx.selectica.net ([10.0.12.245]) by sltcmsx.selectica.net ([10.0.12.245]) with mapi; Thu, 27 Mar 2008 20:32:45 -0700 From: "Pantvaidya, Vishwajit" To: "axis-user@ws.apache.org" Date: Thu, 27 Mar 2008 20:32:43 -0700 Subject: [Axis2] WstxParsingException: Expected a text token, got START_ELEMENT - while passing array from Axis2 client to Axis2 service Thread-Topic: [Axis2] WstxParsingException: Expected a text token, got START_ELEMENT - while passing array from Axis2 client to Axis2 service Thread-Index: AciQhGIM1qCeD26yQyWmBjvRI7lheg== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_A8CDAF70C43E5C47BAF859D660CEAD1002D1D0322Dsltcmsxselect_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_A8CDAF70C43E5C47BAF859D660CEAD1002D1D0322Dsltcmsxselect_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Using the suggestions from the case 2 mentioned in http://wso2.org/library/= 332, I wrote an Axis2 client to call my Axis2 service that has a string arr= ay as one of the params. But I got following error when the call executes: org.apache.axis2.AxisFault: com.ctc.wstx.exc.WstxParsingException: Expected= a text token, got START_ELEMENT. at [row,col {unknown-source}]: [1,401] at org.apache.axis2.util.Utils.getInboundFaultFromMessageContex= t(Utils.java:486) at org.apache.axis2.description.OutInAxisOperationClient.handle= Response(OutInAxisOperation.java:343) at org.apache.axis2.description.OutInAxisOperationClient.send(O= utInAxisOperation.java:389) at org.apache.axis2.description.OutInAxisOperationClient.execut= eImpl(OutInAxisOperation.java:211) at org.apache.axis2.client.OperationClient.execute(OperationCli= ent.java:163) at org.apache.axis2.client.ServiceClient.sendReceive(ServiceCli= ent.java:528) at org.apache.axis2.client.ServiceClient.sendReceive(ServiceCli= ent.java:508) Any suggestions? Here is the relevant snippet from my WSDL: ... And here is the client code: svcClient =3D new ServiceClient(); Options options =3D new Options(); options.setTo(new EndpointReference(serviceURL)); options.setAction("http://localhost:8080/services/ECMServiceSoap/AssignUser= ToRoles"); svcClient.setOptions(options); OMNamespace ns =3D fac.createOMNamespace(serviceNamespace, "ns1"); payload =3D fac.createOMElement("AssignUserToRoles", ns); OMElement value =3D fac.createOMElement("SessionToken", ns); value.setText(sessionId); payload.addChild(value); OMElement value =3D fac.createOMElement("Email", ns); value.setText(email); payload.addChild(value); //roles is a String[] OMElement value =3D BeanUtil.getOMElement(new QName(ns.getNamespaceURI(),"R= oleId"), roles, null, false, null); payload.addChild(value); OMElement responseElement=3D(OMElement) svcClient.sendReceive(payload); --_000_A8CDAF70C43E5C47BAF859D660CEAD1002D1D0322Dsltcmsxselect_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Using the suggestions from the case 2= mentioned in http://wso2.org/library/332,= I wrote an Axis2 client to call my Axis2 service that has a string array as one of = the params. But I got following error when the call executes:=

 

org.apache.axis2.AxisFault: com.ctc.wstx.exc.WstxParsingException: Expected a text token, got START_ELEMENT.

 at [row,col {unknown-source}]: [1,401]

            at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java= :486)

            at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(Out= InAxisOperation.java:343)

            at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOper= ation.java:389)

            at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInA= xisOperation.java:211)

            at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163= )

            at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:528= )

      &= nbsp;     at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:508= )

 

Any suggestions?

 

Here is the relevant snippet from my = WSDL:

 

<types>

<s:schema elementFormDefault=3D"qualified" targetNamespace=3D"http://ws.selectica.com/ecm/">

<s:element name=3D"AssignUserToRoles">

      &= nbsp;           &nbs= p;     <s:complexType>

      &= nbsp;           &nbs= p;            &= nbsp;    <s:sequence>

      &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;    <s:element name=3D"SessionToken" type=3D"s:string"></s:eleme= nt>

      &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;    <s:element name=3D"Email" type=3D"s:string"></s:element><= o:p>

      &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;    <s:element name=3D"RoleId" type=3D"s:string" maxOccurs=3D"unbounded" minOccurs=3D"1"></s:eleme= nt>

      &= nbsp;           &nbs= p;            &= nbsp;    </s:sequence>

      &= nbsp;           &nbs= p;     </s:complexType><= /p>

      &= nbsp;     </s:element>

<s:element name=3D"AssignUserToRolesResponse">

      &= nbsp;     <s:complexType></s:complexType>

</s:element><= /font>

</s:schema>

</types>

 

<wsdl:message name=3D"AssignUserToRolesRequest">

      &= nbsp;     <wsdl:part name=3D"parameters" element=3D"tns:AssignUserToRoles"></wsdl:part>

</wsdl:message>

<wsdl:message name=3D"AssignUserToRolesResponse">

      &= nbsp;     <wsdl:part name=3D"parameters" element=3D"tns:AssignUserToRolesResponse"></wsdl:part>

</wsdl:message>

      &= nbsp;    

<portType name=3D"ECMServiceSoap">

      &= nbsp;     <wsdl:operation name=3D"AssignUserToRoles">

      &= nbsp;           &nbs= p;     <wsdl:input message=3D"tns:AssignUserToRolesRequest"></wsdl:input>

      &= nbsp;           &nbs= p;     <wsdl:output message=3D"tns:AssignUserToRolesResponse"></wsdl:output>=

      &= nbsp;     </wsdl:operation>

</portType>

      &= nbsp;    

<binding name=3D"ECMServiceSoap" type=3D"tns:ECMServiceSoap">=

      &= nbsp;     <soap:binding transport=3D"http://schemas.xmlsoap.org/soap/http" style=3D"document"/>

      &= nbsp;     <operation name=3D"AssignUserToRoles">

      &= nbsp;           &nbs= p;     <soap:operation soapAction=3D"" style=3D"document"/>

      &= nbsp;            &nb= sp;    <input>

      &= nbsp;            &nb= sp;             = ;   <soap:body use=3D"literal"/>

      &= nbsp;           &nbs= p;     </input>

      &= nbsp;           &nbs= p;     <output>

      &= nbsp;           &nbs= p;             =     <soap:body use=3D"literal"/>

      &= nbsp;           &nbs= p;     </output>

      &= nbsp;     </operation>

</binding>

 

 

And here is the client code:

 

svcClient =3D new ServiceClient();

Options options =3D new Options();

options.setTo(new EndpointReference(serviceURL));

options.setAction("http://localhost:8080/services/ECMServiceSoap/Assi= gnUserToRoles");

svcClient.setOptions(options);

 

OMNamespace ns =3D fac.createOMNamespace(serviceNamespace, "ns1");=

payload =3D fac.createOMElement("AssignUserToRoles", ns);

 

OMElement value =3D fac.createOMElement("SessionToken", ns);

value.setText(sessionId);

payload.addChild(value);

 

OMElement value =3D fac.createOMElement("Email", ns);

value.setText(email);

payload.addChild(value);

 

//roles is a String[]

OMElement value =3D BeanUtil.getOMElement= (new QName(ns.getNamespaceURI(),"= RoleId"), roles, null, false, null);

payload.addChild(value);

 

OMElement responseElement=3D(OMElement) svcClient.sendReceive(payload);

 

--_000_A8CDAF70C43E5C47BAF859D660CEAD1002D1D0322Dsltcmsxselect_--