Response.Return_标记中的名称“return”与* Result.XMLName中的名称“Result”冲突

时间:2018-05-14 13:42:01

标签: xml go soap xml-parsing wsdl

实际错误为name "return" in tag of LoginToPublicPortalResponse.Return_ conflicts with name "ResultVO" in *ResultsVO.XMLName。代码是由gowsdl生成的,当我尝试调用方法时,它给出了冲突错误。 这是我的课程:

type LoginToPublicPortalResponse struct {
        XMLName xml.Name `xml:"http://publicportal.rest.powerschool.pearson.com/xsd loginToPublicPortalResponse"`

        Return_ *ResultsVO `xml:"return,omitempty"`
}

type ResultsVO struct {
        XMLName xml.Name `xml:"http://vo.rest.powerschool.pearson.com/xsd ResultsVO"`

        *BaseResultsVO

        CourseRequestGroupsVOs []*CourseRequestGroupVO `xml:"courseRequestGroupsVOs,omitempty"`
        CourseRequestRulesVO   *CourseRequestRulesVO   `xml:"courseRequestRulesVO,omitempty"`
        StudentDataVOs         []*StudentDataVO        `xml:"studentDataVOs,omitempty"`
        UserSessionVO          *UserSessionVO          `xml:"userSessionVO,omitempty"`
}

这是返回的实际XML:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <ns:loginToPublicPortalResponse xmlns:ns="http://publicportal.rest.powerschool.pearson.com/xsd">
         <return xmlns:ax290="http://vo.rest.powerschool.pearson.com/xsd" xmlns:ax291="http://model.rest.powerschool.pearson.com/xsd" xmlns:ax293="http://util.java/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ax290:ResultsVO">
            <courseRequestRulesVO xsi:nil="true" />
            <userSessionVO xsi:type="ax290:UserSessionVO">
               <locale xsi:nil="true" />
               <serverCurrentTime>2018-05-14T10:33:05.260Z</serverCurrentTime>
               <serverInfo xsi:type="ax291:ServerInfo">
                  <apiVersion>2.3.0</apiVersion>
                  <dayLightSavings>3600000</dayLightSavings>
                  <parentSAMLEndPoint />
                  <publicPortalDisabled>false</publicPortalDisabled>
                  <publicPortalDisabledMessage xsi:nil="true" />
                  <rawOffset>-18000000</rawOffset>
                  <serverTime>2018-05-14T10:33:05.261Z</serverTime>
                  <studentSAMLEndPoint />
                  <teacherSAMLEndPoint />
                  <timeZoneName>EDT</timeZoneName>
               </serverInfo>
               <serviceTicket>AAABY142UccKhfZkXiTvJ7x/Qa7mtUVb07hutu6fLO9zh1dQUQQKWbkID4uOY9/9dwqDKgYewKpe6YXiJp3xFcmU/UOLl4Cwox4i10Ak1LXKzfLSKUiiH3SscaA9hOsH</serviceTicket>
               <studentIDs>207032</studentIDs>
               <userId>207032</userId>
               <userType>2</userType>
            </userSessionVO>
         </return>
      </ns:loginToPublicPortalResponse>
   </soapenv:Body>
</soapenv:Envelope>

我是否需要更改返回ResultsVO?停止嵌入ResultsVO?

1 个答案:

答案 0 :(得分:0)

我不知道问题的根源,但是当您从LoginToPublicPortalResponse Return_中删除`xml:“ return,omitempty”时,它应该可以工作。