UCMDB and UD Practitioners Forum (Previously CMS)
Showing results for 
Search instead for 
Do you mean 

getCIsById SOAP

SOLVED
Go to Solution
Occasional Visitor

getCIsById SOAP

I am trying to use SOAP (via Postman) to getCIsById

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:upd="http://schemas.hp.com/ucmdb/1/params/update" xmlns:types="http://schemas.hp.com/ucmdb/1/types" xmlns:queryparams="http://schemas.hp.com/ucmdb/1/params/query" xmlns:upd1="http://schemas.hp.com/ucmdb/1/types/update">
<soap:Header/>
<soap:Body>
<queryparams:getCIsById>
<types:cmdbContext>
<types:callerApplication>Test</types:callerApplication>
</types:cmdbContext>

<types:IDs>
<types:ID temp="false">442e1e5f48186991bf04cd7bfd4990be</types:ID>
</types:IDs>

</queryparams:getCIsById>

</soap:Body>
</soap:Envelope>

 

The response indicates I have the wrong namespace for the cmdbContext element:

<faultstring>Expected "{http://schemas.hp.com/ucmdb/1/params/query}cmdbContext" start tag, found "{http://schemas.hp.com/ucmdb/1/types}cmdbContext" start tag (line -1, col -1, in SOAP-message)</faultstring>
<detail/>

 

But the schema seems to indicate I should use types:

http://cmshelpcenter.saas.hp.com/CMS/10.31/ucmdb-docs/docs/eng/APIs/CMDB_Schema/QueryServic-getCIsBy045f.html

Any ideas?

 

 

 

1 REPLY
Occasional Visitor

Re: getCIsById SOAP

To answer my  own question,  it is because the target namespace is different:

<xs:schema ...  elementFormDefault="qualified" targetNamespace="http://schemas.hp.com/ucmdb/1/params/query">
...

<xs:complexType name="getCIsById">

<xs:sequence>
<xs:element name="cmdbContext" type="types:CmdbContext"/>
<xs:element minOccurs="0" name="CIsTypedProperties" type="props:TypedPropertiesCollection"/>
<xs:element name="IDs" type="types:IDs"/>
</xs:sequence>
</xs:complexType>
<xs:element name="getCIsById" type="queryparams:getCIsById"/>

 

<xs:schema ..... elementFormDefault="qualified" targetNamespace="http://schemas.hp.com/ucmdb/1/types">

<xs:complexType name="IDs">
<xs:sequence>
<xs:element maxOccurs="unbounded" name="ID" type="types:ID"/>
</xs:sequence>
</xs:complexType>

 

So the following works:

 

<queryparams:getCIsById>


<queryparams:cmdbContext>
<types:callerApplication>Test</types:callerApplication>
</queryparams:cmdbContext>

<queryparams:IDs>
<types:ID temp="false">4ae72d6c7de1536492db235be50766ad</types:ID>
</queryparams:IDs>

</queryparams:getCIsById>

 

 

 

//Add this to "OnDomLoad" event