Highlighted
Contributor.. Contributor..
Contributor..
667 views

Add Record using HPSM Web Service "No (more) records found"

Hi,

We are using HPSM 9.32 webservice for a custom dbdict table, the update function works fine but adding records results in error

 

Our Request looks like this: 


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://schemas.hp.com/SM/7" xmlns:com="http://schemas.hp.com/SM/7/Common" xmlns:xm="http://www.w3.org/2005/05/xmlmime">
<soapenv:Header/>
<soapenv:Body>
<ns:AddCompanySparePartIntegrationRequest attachmentInfo="?" attachmentData="?" ignoreEmptyElements="true" updateconstraint="-1">
<ns:model query="?">
<ns:keys query="" updatecounter="?">
<!--Optional:-->
<ns:assettag type="String" mandatory="?" readonly="?"></ns:assettag>
</ns:keys>
<ns:instance query="?" uniquequery="?" recordid="?" updatecounter="?">
<!--Optional:-->
<ns:id type="String" mandatory="?" readonly="?"></ns:id>
<!--Optional:-->
<ns:assettag type="String" mandatory="?" readonly="?">12335</ns:assettag>
<!--Optional:-->
<ns:exportstatus type="String" mandatory="?" readonly="?">TESTSTATUS</ns:exportstatus>
<!--Optional:-->
<ns:faultdesc type="String" mandatory="?" readonly="?">FAULTTEST</ns:faultdesc>
<!--Optional:-->
<ns:productcode type="String" mandatory="?" readonly="?">TESTPC</ns:productcode>
<!--Optional:-->
<ns:serialnumber type="String" mandatory="?" readonly="?">testsn</ns:serialnumber>
<!--Optional:-->
<ns:site type="String" mandatory="?" readonly="?">CAI2010</ns:site>
<!--Optional:-->
<ns:smuser type="String" mandatory="?" readonly="?">wfm0</ns:smuser>
<!--Optional:-->
<ns:state type="String" mandatory="?" readonly="?">testState</ns:state>
<!--Optional:-->
<ns:vendor type="String" mandatory="?" readonly="?">VENDOR</ns:vendor>
<!--Optional:-->
<ns:wodate type="String" mandatory="?" readonly="?"></ns:wodate>
<!--Optional:-->
<ns:wonumber type="String" mandatory="?" readonly="?">WOTEST</ns:wonumber>
<!--Optional:-->
<!-- <ns:exportdate type="DateTime" mandatory="?" readonly="?">?</ns:exportdate>
-->
<!--Optional:-->
<ns:attachments>
<!--Zero or more repetitions:-->
<com:attachment xm:contentType="application/?" href="?" contentId="?" action="?" name="?" type="?" len="?" charset="?" attachmentType="?">cid:1231674811181</com:attachment>
</ns:attachments>
</ns:instance>
<!--Optional:-->
<ns:messages>
<!--Zero or more repetitions:-->
<com:message type="String" mandatory="?" readonly="?" severity="?" module="?"></com:message>
</ns:messages>
</ns:model>
</ns:AddCompanySparePartIntegrationRequest>
</soapenv:Body>
</soapenv:Envelope>

And We get this response:

 

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<AddCompanySparePartIntegrationResponse message="No (more) records found" returnCode="9" schemaRevisionDate="2017-07-26" schemaRevisionLevel="1" status="FAILURE" xsi:schemaLocation="http://schemas.hp.com/SM/7 http://smsvr:13080/SM/7/CompanySparePartIntegration.xsd" xmlns="http://schemas.hp.com/SM/7" xmlns:cmn="http://schemas.hp.com/SM/7/Common" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<model>
<keys>
<assettag type="String">12335</assettag>
</keys>
<instance recordid="12335" uniquequery="assettag=&quot;12335&quot;">
<assettag type="String">12335</assettag>
<exportstatus type="String">TESTSTATUS</exportstatus>
<faultdesc type="String">FAULTTEST</faultdesc>
<productcode type="String">TESTPC</productcode>
<serialnumber type="String">testsn</serialnumber>
<site type="String">CAI2010</site>
<smuser type="String">wfm0</smuser>
<state type="String">testState</state>
<vendor type="String">VENDOR</vendor>
<wonumber type="String">WOTEST</wonumber>
</instance>
</model>
</AddCompanySparePartIntegrationResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Your help is much appreciated 

0 Likes
7 Replies
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: Add Record using HPSM Web Service "No (more) records found"

Have you added options for adding records to that table as well. No more records found sounds like it tries not to add but to query a record from a table.

0 Likes
Highlighted
Contributor.. Contributor..
Contributor..

Re: Add Record using HPSM Web Service "No (more) records found"

Hello Vadim,

The webservice configuration has "add" allowed action with "Create Only" action type, yet it does produce this error.

0 Likes
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

Re: Add Record using HPSM Web Service "No (more) records found"

Hi,

i think the problem is the SOAP request itself.

I assume that you're simulating it via SOAPUI.

Can you try the following request:

<soapenv:Envelope 
	xmlns:com="http://schemas.hp.com/SM/7/Common" 
	xmlns:ns="http://schemas.hp.com/SM/7" 
	xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
	xmlns:xm="http://www.w3.org/2005/05/xmlmime">
	<soapenv:Header/>
	<soapenv:Body>
		<ns:AddCompanySparePartIntegrationRequest>
			<ns:model>
				<ns:keys/>
				<ns:instance>
					<ns:assettag>12335</ns:assettag>
					<ns:exportstatus>TESTSTATUS</ns:exportstatus>
					<ns:faultdesc>FAULTTEST</ns:faultdesc>
					<ns:productcode>TESTPC</ns:productcode>
					<ns:serialnumber>testsn</ns:serialnumber>
					<ns:site>CAI2010</ns:site>
					<ns:smuser>wfm0</ns:smuser>
					<ns:state>testState</ns:state>
					<ns:vendor>VENDOR</ns:vendor>
					<ns:wonumber>WOTEST</ns:wonumber>
				</ns:instance>
			</ns:model>
		</ns:AddCompanySparePartIntegrationRequest>
	</soapenv:Body>
</soapenv:Envelope>

I removed all the stuff which is not needed for the create.

I think the problem is/was that you have some attributes (e.g. query or recordid) in the request which are not needed in the Create Request.

0 Likes
Highlighted
Contributor.. Contributor..
Contributor..

Re: Add Record using HPSM Web Service "No (more) records found"

I think the issue is with the request too, and I also think it is related to the recordid yet I have tried the request you shared but the issue still persists.

I have also noticed that in the response the recordid is set to the same value of the assettag field. is there a way to forcfully set it to null?

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Body>
      <AddCompanySparePartIntegrationResponse message="No (more) records found" returnCode="9" schemaRevisionDate="2017-09-17" schemaRevisionLevel="0" status="FAILURE" xsi:schemaLocation="http://schemas.hp.com/SM/7 http://smsvr:13080/SM/7/CompanySparePartIntegration.xsd" xmlns="http://schemas.hp.com/SM/7" xmlns:cmn="http://schemas.hp.com/SM/7/Common" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <model>
            <keys>
               <assettag type="String">12335</assettag>
            </keys>
            <instance recordid="12335" uniquequery="assettag=&quot;12335&quot;">
               <assettag type="String">12335</assettag>
               <exportstatus type="String">TESTSTATUS</exportstatus>
               <faultdesc type="String">FAULTTEST</faultdesc>
               <productcode type="String">TESTPC</productcode>
               <serialnumber type="String">testsn</serialnumber>
               <site type="String">CAI2010</site>
               <smuser type="String">wfm0</smuser>
               <state type="String">testState</state>
               <vendor type="String">VENDOR</vendor>
               <wonumber type="String">WOTEST</wonumber>
            </instance>
         </model>
      </AddCompanySparePartIntegrationResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
0 Likes
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

Re: Add Record using HPSM Web Service "No (more) records found"

Hi @BluePuma,

did you tried it with my request example?

 

 

0 Likes
Highlighted
Contributor.. Contributor..
Contributor..

Re: Add Record using HPSM Web Service "No (more) records found"

Hello @MarcusReinhardt,

Yes,  the response I have put in the reply is of your request.

0 Likes
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

Re: Add Record using HPSM Web Service "No (more) records found"

Hi,

hmmm tricky... can you share a screenshot from your SOAP UI with the current configuration?
Maybe it's just the wrong METHOD or something else 😉 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.