Scalaxb Parsing error - Namespace issue

158 views
Skip to first unread message

eshan TANDON

unread,
Feb 10, 2017, 12:39:41 AM2/10/17
to scalaxb
Hi Everyone,
I am trying to parse the following:

val obj = scalaxb.fromXML[com.test.SpAvailabilityResponse](<spAvailabilityResponse xmlns="http://servicebench.com/serviceOrder/service/types"> <version>5.0</version> <sourceSystemName>IVR</sourceSystemName> <sourceSystemVersion>IVR</sourceSystemVersion> <msgStatus>NORMAL</msgStatus> <availabilityResponse> <requestControlID>123456789</requestControlID> <availabilityFound>Y</availabilityFound> <serviceJobTypes> <serviceJobType> <jobType>DPM</jobType> <dates> <date> <availableDate/> <availableDay/> <serviceProviders> <serviceProvider> <serviceProviderAccount>1111111</serviceProviderAccount> <serviceProviderName>Random</serviceProviderName> <serviceProviderAddress1>Random Address</serviceProviderAddress1> <serviceProviderCity>City 1</serviceProviderCity> <serviceProviderStateProvince>IN</serviceProviderStateProvince> <serviceProviderPostalCode>1234567</serviceProviderPostalCode> <serviceProviderType>S</serviceProviderType> <priorityRank>10</priorityRank> <enabledForServiceJobType>2</enabledForServiceJobType> <serviceJobType>DPM</serviceJobType> <distance>123</distance> <businessHours> <dayOfTheWeek> <day>0</day> </dayOfTheWeek> <dayOfTheWeek> <day>1</day> </dayOfTheWeek> <dayOfTheWeek> <day>2</day> </dayOfTheWeek> <dayOfTheWeek> <day>3</day> </dayOfTheWeek> <dayOfTheWeek> <day>4</day> </dayOfTheWeek> <dayOfTheWeek> <day>5</day> </dayOfTheWeek> <dayOfTheWeek> <day>6</day> </dayOfTheWeek> </businessHours> <timeSlots> <timeSlot/> </timeSlots> <partsShipmentPreference>1</partsShipmentPreference> </serviceProvider> <serviceProvider> <serviceProviderAccount>211231</serviceProviderAccount> <serviceProviderName>Test Service</serviceProviderName> <serviceProviderAddress1>Unknown address</serviceProviderAddress1> <serviceProviderCity>city 2</serviceProviderCity> <serviceProviderStateProvince>NY</serviceProviderStateProvince> <serviceProviderPostalCode>1233333</serviceProviderPostalCode> <serviceProviderPhone>800-123-1234</serviceProviderPhone> <serviceProviderType>S</serviceProviderType> <priorityRank>12.0</priorityRank> <enabledForServiceJobType>2</enabledForServiceJobType> <serviceJobType>DPM</serviceJobType> <distance>1.9</distance> <businessHours> <dayOfTheWeek> <day>0</day> <fromHours>0900</fromHours> <toHours>1800</toHours> </dayOfTheWeek> <dayOfTheWeek> <day>1</day> <fromHours>0900</fromHours> <toHours>1800</toHours> </dayOfTheWeek> <dayOfTheWeek> <day>2</day> <fromHours>0900</fromHours> <toHours>1800</toHours> </dayOfTheWeek> <dayOfTheWeek> <day>3</day> <fromHours>0900</fromHours> <toHours>1800</toHours> </dayOfTheWeek> <dayOfTheWeek> <day>4</day> <fromHours>0900</fromHours> <toHours>1800</toHours> </dayOfTheWeek> <dayOfTheWeek> <day>5</day> <fromHours>1000</fromHours> <toHours>1400</toHours> </dayOfTheWeek> <dayOfTheWeek> <day>6</day> <fromHours>1000</fromHours> <toHours>1400</toHours> </dayOfTheWeek> </businessHours> <timeSlots> <timeSlot/> </timeSlots> <partsShipmentPreference>1</partsShipmentPreference> </serviceProvider> </serviceProviders> </date> </dates> </serviceJobType> </serviceJobTypes> </availabilityResponse> </spAvailabilityResponse>)


But we are getting this error:

scalaxb.ParserFailure: Error while parsing <XML>, : parser error "end of input" while parsing /{http://servicebench.com/serviceOrder/service/types}spAvailabilityResponse/{http://servicebench.com/serviceOrder/service/types}sourceSystemName{http://servicebench.com/serviceOrder/service/types}sourceSystemVersion{http://servicebench.com/serviceOrder/service/types}msgStatus{http://servicebench.com/serviceOrder/service/types}availabilityResponse

This seems like a namespace issue, however the response seems to be correct based on the WSDL. Can someone help us pinpoint what the issue is here? 



eugene yokota

unread,
Feb 10, 2017, 12:50:36 AM2/10/17
to scalaxb
Hi,

The error seem to indicate that spAvailabilityResponse contains child elements in unexpected order.
It's difficult to say for sure without looking at the actual WSDL, but the error message doesn't contain {http://servicebench.com/serviceOrder/service/types}version. Is <version>5.0</version> something that was added recently?

-eugene


--
You received this message because you are subscribed to the Google Groups "scalaxb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalaxb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

eshan TANDON

unread,
Feb 10, 2017, 12:53:59 AM2/10/17
to sca...@googlegroups.com
Here is the WSDL as an attachment.

--
You received this message because you are subscribed to a topic in the Google Groups "scalaxb" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scalaxb/IHyzg_7WLG8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scalaxb+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Warm Regards,
Eshan Tandon
FakeService.wsdl

eugene yokota

unread,
Feb 10, 2017, 1:00:20 AM2/10/17
to scalaxb
Are you missing statusDetails from your response?

            <complexType name="responseDetails">
                <sequence>
                    <element minOccurs="0" name="version" type="xsd:string"/>
                    <element minOccurs="0" name="v4CrmVersion" type="xsd:string"/>
                    <element minOccurs="0" name="sourceSystemName" type="xsd:string"/>
                    <element minOccurs="0" name="sourceSystemVersion" type="xsd:string"/>
                    <element name="msgStatus" type="xsd:string"/>
                    <element name="statusDetails" type="tns:statusDetails"/>
                </sequence>
            </complexType>

-eugene

eshan TANDON

unread,
Feb 10, 2017, 1:12:01 AM2/10/17
to sca...@googlegroups.com
Well that makes complete sense, don't know how I missed it. Thanks a lot for your help.
Reply all
Reply to author
Forward
0 new messages