Forum Discussion

saiAAA's avatar
saiAAA
Frequent Visitor
10 years ago

Webservice testing with TypeFactory method - Error: Token StartElement in state

 I am facing issue below error while fetching the response from the request xml using formed using Typefactory method where service has Header info as object. Please find the details of the error below and let me know the next step to fix this issue.

 

Error:

Token StartElement in state EndRootElement would result in an invalid XML document. Make sure that the ConformanceLevel setting is set to ConformanceLevel.Fragment or ConformanceLevel.Auto if you want to write an XML fragment

 

 

################

 

' This function creates the reference object for GetmembershipInfo which can be consumed to fetch the node values of response

' Whenever i try to run this function to response node value, i am getting error saying "Token StartElement in state EndRootElement would result in an invalid XML document"

 

Function GetMembershipInfoRequest

 

  set resultValue = WebServices.CS_M_Services.getMembershipInfo(getMembershipInfo1, securityHeaderBean)     

  FirstName = resultValue.return.membership.primaryMember.firstName      

         

End Function

 

 

 

' Body Info function

Function getMembershipInfo1

  Dim TypeFactory

  'Get the type factory for the web service

  Set TypeFactory = WebServices.CS_M_Services.TypeFactory

  Set getMembershipInfo1 = TypeFactory.getMembershipInfo1

  Set getMembershipInfo1.getMembershipInfoRequest = TypeFactory.GetMembershipInfoRequest

  getMembershipInfo1.getMembershipInfoRequest.membershipNumber = "123456789"

  getMembershipInfo1.getMembershipInfoRequest.promotionalCode = "" 

End Function

 

' Header Info

Function securityHeaderBean

  Dim TypeFactory

  'Get the type factory for the web service

  Set TypeFactory = WebServices.CS_M_Services.TypeFactory

  Set securityHeaderBean = TypeFactory.securityHeaderBean

  securityHeaderBean.authorizationToken = "jewrmmsxyXEmBkFpVcrdiktAj_IUrCLZ2o07IkgcSAh"

End Function

 

 

  

I have attached the TestComplete web service structure.

 

 

1 Reply