First i generate a sample xml file using the Eclipse IDE, using the xsd, then 
use the parse method of axis generated wrapper class for my request, passing it 
the XMLStreamReader created from the sample xml. This worked fine end to end 
earlier. Sample class, calling stub passing the request object, server 
responding properly with expected response.
 
Only after i include a simple type element into one of the existing complex 
types within the xsd, it fails saying unexpected element. Just another peice of 
information, when i place this new simple type into its own complex type, it 
works fine again. Seems like only when i add it as a simple type it refuses to 
parse at the server side. 
 
In the intial case, i had debugged the axis client side parsing the tags, and 
the new simple type tag conditions pass through properly and it recognizes it. 
Why is it only at the server i get this error. 
 
I lieterally need some help on this. I can give the full file set if you need 
more information. 
 

-----Original Message-----
From: Amila Suriarachchi [mailto:[EMAIL PROTECTED]
Sent: 10 October 2007 10:39
To: [email protected]
Subject: Re: Peculiar Issue while testing a service




On 10/10/07, Gudla, Natraj (GE Money, consultant) < [EMAIL PROTECTED]> wrote: 

Hi,

Any ideas on this?


how do you generate this request?  some problem there. 



Cheers
Natraj

>  -----Original Message-----
> From:         Gudla, Natraj (GE Money, consultant)
> Sent: 09 October 2007 10:01
> To:   ' [email protected]  <mailto:[email protected]> '
> Subject:      Peculiar Issue while testing a service
>
> Hi,
>
> I am reporting a peculiar issue which i am facing since yesterday working 
> with AXIS2 1.2. Addition of an extra simple element to an existing complex 
> type of an xsd throws an "Un Expected Element" error. Following is the brief. 
>
> The current set up : Working Fine.
>
> The complext type part of my xsd
>       <xsd:complexType name="GEM_Ln_LoanRequestDetails">
>               <xsd:sequence> 
>                       <xsd:element name="LoanPreference" 
> type="GEM_Ln_LoanPreference"/>
>                       <xsd:element name="CustomerDetails" 
> type="GEM_Ln_CustomerDetails"/> 
>                       <xsd:element name="CustomerAddr" 
> type="GEM_Ln_CustomerAddr"/>
>                       <xsd:element name="EmployerDetails" 
> type="GEM_Ln_EmployerDetails"/> 
>                       <xsd:element name="CustomerFinances" 
> type="GEM_Ln_CustomerFinances"/>
>                       <xsd:element name="CardDetails" 
> type="GEM_Ln_CardDetails" minOccurs="0"/> 
>                       <xsd:element name="LoanDetails" 
> type="GEM_Ln_LoanDetails" minOccurs="0"/>
>               </xsd:sequence>
>       </xsd:complexType> 
>
> I used a wsdl, generated binding ( ADB ) classes using WSDL to Java tool on 
> Axis2 1.2. Using the build.xml, running the jar.server task i created the 
> services.aar and deployed on tomcat. Created a sample java class, which reads 
> a sample loan request xml ( formed using IDE based on the xsd ) and submits a 
> request to the service. 
> Every thing works fine, i get the response as i coded within the skeleton 
> method. This looks fine end to end.
>
> Change to the existing schema: : Not Working
>
>       <xsd:complexType name="GEM_Ln_LoanRequestDetails"> 
>               <xsd:sequence>
>                       <xsd:element name="ProductId" type="xsd:string"/>
>                       <xsd:element name="LoanPreference" 
> type="GEM_Ln_LoanPreference"/> 
>                       <xsd:element name="CustomerDetails" 
> type="GEM_Ln_CustomerDetails"/>
>                       <xsd:element name="CustomerAddr" 
> type="GEM_Ln_CustomerAddr"/> 
>                       <xsd:element name="EmployerDetails" 
> type="GEM_Ln_EmployerDetails"/>
>                       <xsd:element name="CustomerFinances" 
> type="GEM_Ln_CustomerFinances"/> 
>                       <xsd:element name="CardDetails" 
> type="GEM_Ln_CardDetails" minOccurs="0"/>
>                       <xsd:element name="LoanDetails" 
> type="GEM_Ln_LoanDetails" minOccurs="0"/> 
>               </xsd:sequence>
>       </xsd:complexType>
>
> I have a need to add new field to hold a product id. after this, i generated 
> the binding classes again ( to make sure, i deleted all the existing classes, 
> and re generated every thing ). Then did the same procedure as above to 
> generated the services.aar, then created the sample java class callling the 
> stub. Changed the sample xml file to add a product id tag and then executed 
> the program. This time un expectedley i get the "Un expected sub element 
> Product Id" error repeatedly. 
>
> Not sure what is the problem, this looks to be simple. I tried various 
> combinations adding a test tag, then making product id a simple type etc etc. 
> Any idea why this occurs. I made sure, i replaced the correct services.aar on 
> the server. The new resource folder generated second time, properly refers to 
> the product id which was included.
>
> Just as a work around, i tested with some sample test and test simple tags, 
> observed the xml input on TCP Monitor. For your reference attached is the 
> request and response xmls from the monitory. Observe for the "test" and 
> "testsimple" tags. The actual loan request xml read by my program is also 
> attached for reference. 
>
>  << File: Response.txt >>  << File: Request.txt >>  << File: LnRq.xml >>
>
> Cheers
> -Natraj.
>
>
>
>

--------------------------------------------------------------------- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]  <mailto:[EMAIL PROTECTED]> 






-- 
Amila Suriarachchi,
WSO2 Inc. 

Reply via email to