Highlighted
Absent Member.
Absent Member.
2207 views

Web Service SOAP Error using FSCManagement

Jump to solution

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:

http://ourhpserver:13080/SM/7/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

0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.
Absent Member.

Re: Web Service SOAP Error using FSCManagement

Jump to solution

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;

}

 

 

View solution in original post

0 Likes
5 Replies
Highlighted
Absent Member.
Absent Member.

Re: Web Service SOAP Error using FSCManagement

Jump to solution

Hi,

 

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

HP Support
If you find that this or any post resolved your issue, please be sure
to mark it as an accepted solution.
Please also give kudo if you find it interesting 🙂
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Web Service SOAP Error using FSCManagement

Jump to solution

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

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Web Service SOAP Error using FSCManagement

Jump to solution

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

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Web Service SOAP Error using FSCManagement

Jump to solution

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;

}

 

 

View solution in original post

0 Likes
Highlighted
Frequent Contributor.
Frequent Contributor.

Re: Web Service SOAP Error using FSCManagement

Jump to solution

[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

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.