cancel
Showing results for 
Search instead for 
Did you mean: 

Error in WebServices - There are multiple root elements

Former Member
0 Kudos

hi,

I am working on consuming webservice which has a WSDL to get the RouteDetails with a structure like:

<Source>

<HouseNumber>1</HouseNumber>

<Street>XYZ</Street>

<City>Hyderabad</City>

<Country>India</Country>

<PostalCode>500018</PostalCode>

</Source>

<Destination>

<HouseNumber>2</HouseNumber>

<Street>X1Y1Z1</Street>

<City>Bangalore</City>

<Country>India</Country>

<PostalCode>500067</PostalCode>

</Destination>

When I am calling the method RouteDetails of the proxy I created, I am getting the error 'There are multiple root elements in line 1 column 178 and the column is indicating <HouseNumber> in <Destination> node.

Please let me know how to overcome this.

Thanks for the help

Githa

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

This is now resolved.

Thanks,

Githa

Former Member
0 Kudos

Hi Githa,

It's quite useful to other's that may encounter a similar issue to post how it was resolved.

SCN is quite powerful that way.

Regards, Trevor

Former Member
0 Kudos

hi,

While calling the webservice method, I included the root node as well which resolved the issue.

My Webservice had the structure like

<GetRoute xmlns="<webservice url with extension .asmx>">

<Source>

<HouseNumber>1</HouseNumber>

<Street>XYZ</Street>

<City>Hyderabad</City>

<Country>India</Country>

<PostalCode>500018</PostalCode>

</Source>

<Destination>

<HouseNumber>2</HouseNumber>

<Street>X1Y1Z1</Street>

<City>Bangalore</City>

<Country>India</Country>

<PostalCode>500067</PostalCode>

</Destination>

</GetRoute>

While calling the method initially I was passing only

<Source>

<HouseNumber>1</HouseNumber>

<Street>XYZ</Street>

<City>Hyderabad</City>

<Country>India</Country>

<PostalCode>500018</PostalCode>

</Source>

<Destination>

<HouseNumber>2</HouseNumber>

<Street>X1Y1Z1</Street>

<City>Bangalore</City>

<Country>India</Country>

<PostalCode>500067</PostalCode>

</Destination>

and it was giving the error 'There are multiple root elements in line 1 column 178

Now I am passing :

<GetRoute xmlns="<webservice url with extension .asmx>">

<Source>

<HouseNumber>1</HouseNumber>

<Street>XYZ</Street>

<City>Hyderabad</City>

<Country>India</Country>

<PostalCode>500018</PostalCode>

</Source>

<Destination>

<HouseNumber>2</HouseNumber>

<Street>X1Y1Z1</Street>

<City>Bangalore</City>

<Country>India</Country>

<PostalCode>500067</PostalCode>

</Destination>

</GetRoute>

and it resolved the issue

Thanks,

Githa