Web Service SOAP Error using FSCManagement

Error: 

A CXmlApiException was raised in native code : error 4 : scxmlapi(4) - Missing or invalid XML document

 

 

I have a web reference configured that does resolve and points to:

ourhpserver:13080/.../FSCManagement.wsdl

 

.Net Function  making call:

 

public HPServiceManagerFSCManagement.RetrieveOperatorResponse GetAccountInfo(HPServiceManagerFSCManagement.FSCManagement service)
{
HPServiceManagerFSCManagement.OperatorModelType model = new HPServiceManagerFSCManagement.OperatorModelType();
HPServiceManagerFSCManagement.OperatorKeysType keys = new HPServiceManagerFSCManagement.OperatorKeysType();
HPServiceManagerFSCManagement.RetrieveOperatorRequest request = new HPServiceManagerFSCManagement.RetrieveOperatorRequest();
HPServiceManagerFSCManagement.RetrieveOperatorResponse response = new HPServiceManagerFSCManagement.RetrieveOperatorResponse();

String sValue = null;
HPServiceManagerFSCManagement.StringType stringType = null;

sValue = "falcon";
stringType = new HPServiceManagerFSCManagement.StringType();
stringType.Value = sValue;
keys.Name = stringType;
keys.updatecounter = 0;
keys.updatecounterSpecified = false;

model.keys = keys;
request.model = model;
response = service.RetrieveOperator(request);
return response;

}

 

The porject pulled in the objects just fine and I am setting the key to "falcon" just to test the call. I dont see what I am missing. This .Net C# prototype works great when interacting with the IncidentManagement wsdl.

 

Any ideas or opinions?

 

Ben

  • Hi,

     

    this issue seems to be  caused by invalid XML for the request object

  • Here is the log catching the exception.

     

    1776( 2320) 05/18/2014 20:36:36 RTE I API=SQLConnect
    1776( 2320) 05/18/2014 20:36:36 RTE I Connection established to dbtype 'sqlserver' database 'SMDEMO' user 'sa'
    1776( 2320) 05/18/2014 20:36:36 RTE I Connected to Data source 'SMDEMO' SQL server 'CLEANHPDB01' version: 10.50.1600 through SQL driver version: 10.50.1600 using database 'SMDEMO' as user 'dbo'
    1776( 2320) 05/18/2014 20:36:36 RTE I MS SQL Server collation 'SQL_Latin1_General_CP1_CI_AS', varchar codepage 1252, comparison 196609: case insensitive, accent sensitive
    1776( 2320) 05/18/2014 20:36:36 RTE I Thread 9D4EFE6A3EA44F05F873860F479BE757 initialization done.
    1776( 2668) 05/18/2014 20:36:36 JRTE I Webservice API session - Thread ID: 9D4EFE6A3EA44F05F873860F479BE757; session timeout: 1800 seconds
    1776( 2320) 05/18/2014 20:36:36 RTE I User falcon logged in. Already licensed
    1776( 2320) 05/18/2014 20:36:36 RTE I User falcon has logged in and is using a Named license ( 1 out of a maximum 25 )
    1776( 2320) 05/18/2014 20:36:36 RTE W Exception occurred for method Retrieve and XML request <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><RetrieveOperatorRequest xmlns="http://schemas.hp.com/SM/7"><model><keys><Name type="String">falcon</Name></keys></model></RetrieveOperatorRequest></soap:Body></soap:Envelope>
    1776( 2320) 05/18/2014 20:36:36 RTE E Caught XML API exception scxmlapi(4) - Missing or invalid XML document
    1776( 2668) 05/18/2014 20:36:36 JRTE W Send error response: A CXmlApiException was raised in native code : error 4 : scxmlapi(4) - Missing or invalid XML document
    1776( 2320) 05/18/2014 20:36:36 JRTE I Termination signal: 0

     

     

    As one can see the XML subbmited looked like this:

     

    <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soap:Body><RetrieveOperatorRequest xmlns="http://schemas.hp.com/SM/7"><model><keys><Name type="String">falcon</Name></keys></model></RetrieveOperatorRequest></soap:Body></soap:Envelope>

     

    This was generated by the .NET Web Service Reference objects when called as mention above. 

     

    Any ideas would be helpful.

     

    Ben

  • Here in another attempt using SOAP UI. This log is the sm log from the logs folder for the HP Service Manager Server.

     

    1776( 2828) 05/19/2014 08:15:24 RTE I User falcon logged in. Already licensed
    1776( 2828) 05/19/2014 08:15:24 RTE I User falcon has logged in and is using a Named license ( 1 out of a maximum 25 )
    1776( 2828) 05/19/2014 08:15:24 RTE W Exception occurred for method Retrieve and XML request <?xml version="1.0" encoding="utf-8"?><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:RetrieveOperatorRequest attachmentData="false" attachmentInfo="false" count="" handle="" ignoreEmptyElements="true" start="" updatecounter="">
    <ns:keys query="" updatecounter="">
    <!--Optional:-->
    <ns:Name mandatory="" readonly="" type="String">Aaron.Caffrey</ns:Name>
    </ns:keys>
    </ns:RetrieveOperatorRequest>
    </soapenv:Body>
    </soapenv:Envelope>
    1776( 2828) 05/19/2014 08:15:24 RTE E Caught XML API exception scxmlapi(4) - Missing or invalid XML document
    1776( 2668) 05/19/2014 08:15:24 JRTE W Send error response: A CXmlApiException was raised in native code : error 4 : scxmlapi(4) - Missing or invalid XML document
    1776( 2828) 05/19/2014 08:15:24 JRTE I Termination signal: 0
    1776( 2828) 05/19/2014 08:15:24 RTE I -Memory : S(2543264) O(746044) MAX(3756924) - MALLOC's Total(184325)
    1776( 2828) 05/19/2014 08:15:24 RTE I Thread termination in progress
    1776( 2828) 05/19/2014 08:15:24 RTE I User falcon has logged out. Still licensed ( 1 session remaining )

     

     

    Still looking.

     

    Ben

  • Here in another attempt using SOAP UI. This log is the sm log from the logs folder for the HP Service Manager Server.

     

    1776( 2828) 05/19/2014 08:15:24 RTE I User falcon logged in. Already licensed
    1776( 2828) 05/19/2014 08:15:24 RTE I User falcon has logged in and is using a Named license ( 1 out of a maximum 25 )
    1776( 2828) 05/19/2014 08:15:24 RTE W Exception occurred for method Retrieve and XML request <?xml version="1.0" encoding="utf-8"?><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:RetrieveOperatorRequest attachmentData="false" attachmentInfo="false" count="" handle="" ignoreEmptyElements="true" start="" updatecounter="">
    <ns:keys query="" updatecounter="">
    <!--Optional:-->
    <ns:Name mandatory="" readonly="" type="String">Aaron.Caffrey</ns:Name>
    </ns:keys>
    </ns:RetrieveOperatorRequest>
    </soapenv:Body>
    </soapenv:Envelope>
    1776( 2828) 05/19/2014 08:15:24 RTE E Caught XML API exception scxmlapi(4) - Missing or invalid XML document
    1776( 2668) 05/19/2014 08:15:24 JRTE W Send error response: A CXmlApiException was raised in native code : error 4 : scxmlapi(4) - Missing or invalid XML document
    1776( 2828) 05/19/2014 08:15:24 JRTE I Termination signal: 0
    1776( 2828) 05/19/2014 08:15:24 RTE I -Memory : S(2543264) O(746044) MAX(3756924) - MALLOC's Total(184325)
    1776( 2828) 05/19/2014 08:15:24 RTE I Thread termination in progress
    1776( 2828) 05/19/2014 08:15:24 RTE I User falcon has logged out. Still licensed ( 1 session remaining )

     

     

    Still looking.

     

    Ben

  • Verified Answer

    Solved the issue using SOAP UI. 

     

    The issue is that when sending a request to HP Service Manager 9.3, the instance for the model CAN NOT be absent. Even if you are not using it. The following XML worked.

     

    <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:RetrieveOperatorRequest attachmentInfo="false" attachmentData="false" ignoreEmptyElements="true" updatecounter="" handle="" count="" start="">
    <ns:model query="">
    <ns:keys query="" updatecounter="">
    <!--Optional:-->
    <ns:Name type="string" mandatory="true" readonly="false">Aaron.Caffrey</ns:Name>
    </ns:keys>
    <ns:instance query="" uniquequery="" recordid="" updatecounter="">
    </ns:instance>
    <!--Optional:-->
    </ns:model>
    </ns:RetrieveOperatorRequest>
    </soapenv:Body>
    </soapenv:Envelope>

     

    Thus .. adding a blank instance to the .NET code resolved the bad XML error.

     

    The following is the modified .NET function:

     

    public HPServiceManagerFSCManagement.RetrieveOperatorResponse GetAccountInfo(HPServiceManagerFSCManagement.FSCManagement service)
    {
    HPServiceManagerFSCManagement.OperatorModelType model = new HPServiceManagerFSCManagement.OperatorModelType();
    HPServiceManagerFSCManagement.OperatorKeysType keys = new HPServiceManagerFSCManagement.OperatorKeysType();
    HPServiceManagerFSCManagement.RetrieveOperatorRequest request = new HPServiceManagerFSCManagement.RetrieveOperatorRequest();
    HPServiceManagerFSCManagement.RetrieveOperatorResponse response = new HPServiceManagerFSCManagement.RetrieveOperatorResponse();
    HPServiceManagerFSCManagement.OperatorInstanceType instance = new HPServiceManagerFSCManagement.OperatorInstanceType();

    String sValue = null;
    HPServiceManagerFSCManagement.StringType stringType = null;


    sValue = "falcon";
    stringType = new HPServiceManagerFSCManagement.StringType();
    stringType.Value = sValue;


    keys.Name = stringType;
    keys.updatecounter = 0;
    keys.updatecounterSpecified = false;

     

    model.keys = keys;
    model.instance = instance;


    request.model = model;
    response = service.RetrieveOperator(request);
    return response;

    }

     

     

  • [string]$UserID = "sherpa"
    [string]$Password = "sherpa"

    $securePasssword = ConvertTo-SecureString $Password -AsPlainText -Force;
    $credentials = Get-Credential
    $webclient = New-Object System.Net.WebCli$webclient.Credentials = $credentials;
    $service = New-WebServiceProxy -Credential $credentials -uri http://130.29.29.241:13080/SM/7/Sherpa.wsdl
    $types = $service.GetType().Namespace

     

    seems mine is also similar type of problem but i have added an empty instance , still getting the error any solution?

    $retrive_inc_datatype = ($types '.RetrieveSherpaRequest')
    $inc_id_datatype = ($types '.Stringtype')
    $sherpa_key_type = ($types '.SherpaKeysType')
    $sherpa_model_type = ($types '.SherpaModelType')
    $sherpa_inc_type = ($types '.SherpaInstanceType')

    $retrive_inc = New-Object $retrive_inc_datatype
    $inc_id = New-Object $inc_id_datatype
    $sherpa_key = New-Object $sherpa_key_type
    $sherpa_model = New-Object $sherpa_model_type
    $sherpa_inc = New-Object $sherpa_inc_type


    $retrive_inc.attachmentInfo = $false
    $retrive_inc.AttachmentData = $false
    $retrive_inc.IgnoreEmptyElements = ""
    $retrive_inc.Updatecounter = ""
    $retrive_inc.Handle = ""
    $retrive_inc.Count = ""
    $retrive_inc.Start = ""
    $inc_id.Value = "IM66609836"

    $sherpa_key.IncidentID = $inc_id
    $sherpa_key.query = ""
    $sherpa_key.updatecounter = ""
    $sherpa_model.query = ""
    $sherpa_model.keys = $sherpa_key
    $sherpa_model.instance = $sherpa_inc
    $service.RetrieveSherpa($retrive_inc )

     

     

     

     

    Exception calling "RetrieveSherpa" with "1" argument(s): "A CXmlApiException was raised in native code : error 4 : scxmlapi(4) -
    Missing or invalid XML document"
    At line:1 char:1
    $service.RetrieveSherpa($retrive_inc )
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    FullyQualifiedErrorId : SoapHeaderException