Tuesday, June 21, 2011

"Error in line 1 position 2130. Expecting state 'Element'.. Encountered 'Text' with name '', namespace ''. "

“Error in line 1 position 2130. Expecting state 'Element'.. Encountered 'Text'  with name '', namespace ''.”
 
I was working on a BT+WCF integration project and I was continuously getting this error though I thought I did all right.
 
At times google is helpful but this time, it could not help me much. May be I tried wrong search key words. So I digged myself into what actually is happening and found out that this error means your service at some position expects element whereas you are passing something else.
 
For my case for instance my service was expecting a schema like below…
 
<student>
        <schoolInfo>
                <schName></schName>
</schoolInfo>
</student>
 
Instead I was passing
<student>
        <schoolInfo>My school</schoolInfo>
</student>
 
This was a fault in my biztalk map where I by mistake dropped a string to a element root which BT does not validate.
 
I removed the thing and mapped to correct leaf and it fixed the piece!
 
trivedimehulk@gmail.com
 
 

No comments:

Post a Comment