cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Web services error when requesting field data with the 'im viewfield' command with 'Summary' field

TTEngineering
4-Participant

Web services error when requesting field data with the 'im viewfield' command with 'Summary' field

As described in: https://www.ptc.com/en/support/article?n=CS216213
I'm seeing this error when trying to execute the 'im viewfield' command through SoapUI

 

The linked article says that the bug was fixed in 10.9 but we are using version 11.2 and we still see this error for certain calls. 

 

The 'im viewfield' command works fine for several fields such as this one:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:gen="http://webservice.mks.com/2009/Generic" xmlns:sch="http://webservice.mks.com/2009/Generic/schema">
   <soapenv:Header/>
   <soapenv:Body>
      <gen:command>
         <!--Optional:-->
         <arg0 TransactionId="?">
            <sch:Username>myuser</sch:Username>
            <sch:Password>mypass</sch:Password>
            <sch:Application>im</sch:Application>
            <sch:Command>viewfield</sch:Command>
  		  <sch:Selection>Project</sch:Selection>
         </arg0>
      </gen:command>
   </soapenv:Body>
</soapenv:Envelope>

But when trying to request data for the 'Summary' field, like this: 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:gen="http://webservice.mks.com/2009/Generic" xmlns:sch="http://webservice.mks.com/2009/Generic/schema">
   <soapenv:Header/>
   <soapenv:Body>
      <gen:command>
         <!--Optional:-->
         <arg0 TransactionId="?">
            <sch:Username>myuser</sch:Username>
            <sch:Password>mypass</sch:Password>
            <sch:Application>im</sch:Application>
            <sch:Command>viewfield</sch:Command>
  		  <sch:Selection>Summary</sch:Selection>
         </arg0>
      </gen:command>
   </soapenv:Body>
</soapenv:Envelope>

We get a soap fault returned: 

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
   <env:Header/>
   <env:Body>
      <env:Fault>
         <faultcode>env:Server</faultcode>
         <faultstring>MKS170064: The command succeeded but there was an error processing the output in the web services layer.</faultstring>
         <detail>
            <ns1:MKSException class="com.mks.api.response.APIException" implication="MKS170064: The command succeeded but there was an error processing the output in the web services layer." xmlns:ns1="http://webservice.mks.com/2009/Generic/fault">Invalid valuelist type: "null".</ns1:MKSException>
         </detail>
      </env:Fault>
   </env:Body>
</env:Envelope>

I'm not sure why this works for some field and not for others. 

 

Below is the Visible Fields part of the response from the 'im viewtype document' command:

  <ns2:Field>
                  <ns2:Name>visibleFields</ns2:Name>
                  <ns2:Value>
                     <ns2:ItemList>
                        <ns2:Id>Summary</ns2:Id>
                        <ns2:ModelType>im.Field</ns2:ModelType>
                        <ns2:DisplayId>Summary</ns2:DisplayId>
                        <ns2:Field>
                           <ns2:Name>groups</ns2:Name>
                           <ns2:Value>
                              <ns2:ItemList>
                                 <ns2:Id>everyone</ns2:Id>
                                 <ns2:ModelType>im.Group</ns2:ModelType>
                                 <ns2:DisplayId>everyone</ns2:DisplayId>
                              </ns2:ItemList>
                           </ns2:Value>
                        </ns2:Field>
                     </ns2:ItemList>
                     <ns2:ItemList>
                        <ns2:Id>State</ns2:Id>
                        <ns2:ModelType>im.Field</ns2:ModelType>
                        <ns2:DisplayId>State</ns2:DisplayId>
                        <ns2:Field>
                           <ns2:Name>groups</ns2:Name>
                           <ns2:Value>
                              <ns2:ItemList>
                                 <ns2:Id>everyone</ns2:Id>
                                 <ns2:ModelType>im.Group</ns2:ModelType>
                                 <ns2:DisplayId>everyone</ns2:DisplayId>
                              </ns2:ItemList>
                           </ns2:Value>
                        </ns2:Field>
                     </ns2:ItemList>
                     <ns2:ItemList>
                        <ns2:Id>Project</ns2:Id>
                        <ns2:ModelType>im.Field</ns2:ModelType>
                        <ns2:DisplayId>Project</ns2:DisplayId>
                        <ns2:Field>
                           <ns2:Name>groups</ns2:Name>
                           <ns2:Value>
                              <ns2:ItemList>
                                 <ns2:Id>everyone</ns2:Id>
                                 <ns2:ModelType>im.Group</ns2:ModelType>
                                 <ns2:DisplayId>everyone</ns2:DisplayId>
                              </ns2:ItemList>
                           </ns2:Value>
                        </ns2:Field>
                     </ns2:ItemList>
                     <ns2:ItemList>
                        <ns2:Id>Shared Attachments</ns2:Id>
                        <ns2:ModelType>im.Field</ns2:ModelType>
                        <ns2:DisplayId>Shared Attachments</ns2:DisplayId>
                        <ns2:Field>
                           <ns2:Name>groups</ns2:Name>
                           <ns2:Value>
                              <ns2:ItemList>
                                 <ns2:Id>everyone</ns2:Id>
                                 <ns2:ModelType>im.Group</ns2:ModelType>
                                 <ns2:DisplayId>everyone</ns2:DisplayId>
                              </ns2:ItemList>
                           </ns2:Value>
                        </ns2:Field>
                     </ns2:ItemList>
                     <ns2:ItemList>
                        <ns2:Id>Shared Text</ns2:Id>
                        <ns2:ModelType>im.Field</ns2:ModelType>
                        <ns2:DisplayId>Shared Text</ns2:DisplayId>
                        <ns2:Field>
                           <ns2:Name>groups</ns2:Name>
                           <ns2:Value>
                              <ns2:ItemList>
                                 <ns2:Id>everyone</ns2:Id>
                                 <ns2:ModelType>im.Group</ns2:ModelType>
                                 <ns2:DisplayId>everyone</ns2:DisplayId>
                              </ns2:ItemList>
                           </ns2:Value>
                        </ns2:Field>
                     </ns2:ItemList>
                  </ns2:Value>
               </ns2:Field>

Does anyone know how to fix or work around this problem? 

 

Thanks

ACCEPTED SOLUTION

Accepted Solutions

You can get much of the metadata with the im fields command. I've tested with the fields that failed for viewfield, and it is working okay in my environment. You can give a list of the metadata you want in the fields option, and a list of the fields in the selections. A list of values for the fields option can be found in the CLI Reference Guide.

 

 For example the following will return Name, Type, Min/Max, Editability & Relevance rules for Summary and Pass Count.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:gen="http://webservice.mks.com/2009/Generic" xmlns:sch="http://webservice.mks.com/2009/Generic/schema">
   <soapenv:Header/>
   <soapenv:Body>
      <gen:command>
         <!--Optional:-->
         <arg0 TransactionId="?">
            <sch:Username>ascea</sch:Username>
            <sch:Password>ascea</sch:Password>
            <sch:Application>im</sch:Application>
            <sch:Command>fields</sch:Command>
            <!--Zero or more repetitions:-->
            <sch:Option Name="fields">name,type,max,min,maxLength,relevanceRule,editabilityRule</sch:Option>
            <!--Zero or more repetitions:-->
            <sch:Selection>Summary</sch:Selection>
            <sch:Selection>Pass Count</sch:Selection>
            
         </arg0>
      </gen:command>
   </soapenv:Body>
</soapenv:Envelope>

Output:

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
   <env:Header/>
   <env:Body>
      <ns3:commandResponse xmlns:ns2="http://webservice.mks.com/2009/Generic/schema" xmlns:ns3="http://webservice.mks.com/2009/Generic">
         <return TransactionId="?">
            <ns2:return>success</ns2:return>
            <ns2:Application>im</ns2:Application>
            <ns2:Command>fields</ns2:Command>
            <ns2:WorkItems>
               <ns2:Id>Summary</ns2:Id>
               <ns2:ModelType>im.Field</ns2:ModelType>
               <ns2:DisplayId>Summary</ns2:DisplayId>
               <ns2:Field>
                  <ns2:Name>name</ns2:Name>
                  <ns2:Value>
                     <ns2:string>Summary</ns2:string>
                  </ns2:Value>
               </ns2:Field>
               <ns2:Field>
                  <ns2:Name>type</ns2:Name>
                  <ns2:Value>
                     <ns2:string>shorttext</ns2:string>
                  </ns2:Value>
               </ns2:Field>
               <ns2:Field>
                  <ns2:Name>maxLength</ns2:Name>
                  <ns2:Value>
                     <ns2:int>250</ns2:int>
                  </ns2:Value>
               </ns2:Field>
               <ns2:Field>
                  <ns2:Name>relevanceRule</ns2:Name>
                  <ns2:Value>
                     <ns2:string/>
                  </ns2:Value>
               </ns2:Field>
               <ns2:Field>
                  <ns2:Name>editabilityRule</ns2:Name>
                  <ns2:Value>
                     <ns2:string/>
                  </ns2:Value>
               </ns2:Field>
            </ns2:WorkItems>
            <ns2:WorkItems>
               <ns2:Id>Pass Count</ns2:Id>
               <ns2:ModelType>im.Field</ns2:ModelType>
               <ns2:DisplayId>Pass Count</ns2:DisplayId>
               <ns2:Field>
                  <ns2:Name>name</ns2:Name>
                  <ns2:Value>
                     <ns2:string>Pass Count</ns2:string>
                  </ns2:Value>
               </ns2:Field>
               <ns2:Field>
                  <ns2:Name>type</ns2:Name>
                  <ns2:Value>
                     <ns2:string>integer</ns2:string>
                  </ns2:Value>
               </ns2:Field>
               <ns2:Field>
                  <ns2:Name>max</ns2:Name>
                  <ns2:Value/>
               </ns2:Field>
               <ns2:Field>
                  <ns2:Name>min</ns2:Name>
                  <ns2:Value/>
               </ns2:Field>
               <ns2:Field>
                  <ns2:Name>relevanceRule</ns2:Name>
                  <ns2:Value>
                     <ns2:string/>
                  </ns2:Value>
               </ns2:Field>
               <ns2:Field>
                  <ns2:Name>editabilityRule</ns2:Name>
                  <ns2:Value>
                     <ns2:string>(false)</ns2:string>
                  </ns2:Value>
               </ns2:Field>
            </ns2:WorkItems>
         </return>
      </ns3:commandResponse>
   </env:Body>
</env:Envelope>

 

View solution in original post

4 REPLIES 4

It looks like they fixed the error for one specific case but did not check all cases. 

I've tested and gotten the same error you are getting with 11.2. The issue with Summary is that it is a short text field with no suggestions. Any other short text field with no suggestions gives the same error.

 

Have you found other fields that give the error? 

 

What do you need from the im viewfield Summary information? 

 

I suggest contacting PTC Technical Support to post a new SPR. 

TTEngineering
4-Participant
(To:awalsh)

Thanks for the suggestions.

 

I've also seen the same error for the "Signature Comment" field. 

 

I'm trying to get the metadata for all fields so that I can determine any field constraint such as max length and editability. 

You can get much of the metadata with the im fields command. I've tested with the fields that failed for viewfield, and it is working okay in my environment. You can give a list of the metadata you want in the fields option, and a list of the fields in the selections. A list of values for the fields option can be found in the CLI Reference Guide.

 

 For example the following will return Name, Type, Min/Max, Editability & Relevance rules for Summary and Pass Count.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:gen="http://webservice.mks.com/2009/Generic" xmlns:sch="http://webservice.mks.com/2009/Generic/schema">
   <soapenv:Header/>
   <soapenv:Body>
      <gen:command>
         <!--Optional:-->
         <arg0 TransactionId="?">
            <sch:Username>ascea</sch:Username>
            <sch:Password>ascea</sch:Password>
            <sch:Application>im</sch:Application>
            <sch:Command>fields</sch:Command>
            <!--Zero or more repetitions:-->
            <sch:Option Name="fields">name,type,max,min,maxLength,relevanceRule,editabilityRule</sch:Option>
            <!--Zero or more repetitions:-->
            <sch:Selection>Summary</sch:Selection>
            <sch:Selection>Pass Count</sch:Selection>
            
         </arg0>
      </gen:command>
   </soapenv:Body>
</soapenv:Envelope>

Output:

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
   <env:Header/>
   <env:Body>
      <ns3:commandResponse xmlns:ns2="http://webservice.mks.com/2009/Generic/schema" xmlns:ns3="http://webservice.mks.com/2009/Generic">
         <return TransactionId="?">
            <ns2:return>success</ns2:return>
            <ns2:Application>im</ns2:Application>
            <ns2:Command>fields</ns2:Command>
            <ns2:WorkItems>
               <ns2:Id>Summary</ns2:Id>
               <ns2:ModelType>im.Field</ns2:ModelType>
               <ns2:DisplayId>Summary</ns2:DisplayId>
               <ns2:Field>
                  <ns2:Name>name</ns2:Name>
                  <ns2:Value>
                     <ns2:string>Summary</ns2:string>
                  </ns2:Value>
               </ns2:Field>
               <ns2:Field>
                  <ns2:Name>type</ns2:Name>
                  <ns2:Value>
                     <ns2:string>shorttext</ns2:string>
                  </ns2:Value>
               </ns2:Field>
               <ns2:Field>
                  <ns2:Name>maxLength</ns2:Name>
                  <ns2:Value>
                     <ns2:int>250</ns2:int>
                  </ns2:Value>
               </ns2:Field>
               <ns2:Field>
                  <ns2:Name>relevanceRule</ns2:Name>
                  <ns2:Value>
                     <ns2:string/>
                  </ns2:Value>
               </ns2:Field>
               <ns2:Field>
                  <ns2:Name>editabilityRule</ns2:Name>
                  <ns2:Value>
                     <ns2:string/>
                  </ns2:Value>
               </ns2:Field>
            </ns2:WorkItems>
            <ns2:WorkItems>
               <ns2:Id>Pass Count</ns2:Id>
               <ns2:ModelType>im.Field</ns2:ModelType>
               <ns2:DisplayId>Pass Count</ns2:DisplayId>
               <ns2:Field>
                  <ns2:Name>name</ns2:Name>
                  <ns2:Value>
                     <ns2:string>Pass Count</ns2:string>
                  </ns2:Value>
               </ns2:Field>
               <ns2:Field>
                  <ns2:Name>type</ns2:Name>
                  <ns2:Value>
                     <ns2:string>integer</ns2:string>
                  </ns2:Value>
               </ns2:Field>
               <ns2:Field>
                  <ns2:Name>max</ns2:Name>
                  <ns2:Value/>
               </ns2:Field>
               <ns2:Field>
                  <ns2:Name>min</ns2:Name>
                  <ns2:Value/>
               </ns2:Field>
               <ns2:Field>
                  <ns2:Name>relevanceRule</ns2:Name>
                  <ns2:Value>
                     <ns2:string/>
                  </ns2:Value>
               </ns2:Field>
               <ns2:Field>
                  <ns2:Name>editabilityRule</ns2:Name>
                  <ns2:Value>
                     <ns2:string>(false)</ns2:string>
                  </ns2:Value>
               </ns2:Field>
            </ns2:WorkItems>
         </return>
      </ns3:commandResponse>
   </env:Body>
</env:Envelope>

 

TTEngineering
4-Participant
(To:awalsh)

Thank you very much. Using the 'im fields' command works great for us. 

Announcements


Top Tags