Highlighted
Trusted Contributor.. zonki Trusted Contributor..
Trusted Contributor..
517 views

Issues using ESM API QueryViewerService wsdl

I am developing some .NET C# code to load some ArcSight ESM QueryViewer data into a database.  I encountered some issues when trying to use the ESM (6.8.0.2) SOAP API with Visual Studio.  This post details the issues I faced and how I resolved them.  If you have other "gotcha" experiences using ESM's API with non-Java languages, please share them.

When I used Visual Studio's built-in tool for generating SOAP client code (via "Add a Service Reference") on the QueryViewerService wsdl, there were several errors.  When I examined the wsdl I noticed several errors in the Type declarations that make the wsdl invalid.  I also noticed some discrepancies between the specified types in the wsdl and what was being returned by the Web service.  In order to use the Visual Studio Web Service client tool I downloaded the QueryViewerService wsdl file, made several corrections, and generated my SOAP client code from the local corrected version.  I am detailing the corrections I made below and attaching a copy of the original wsdl and my corrected wsdl.

1.   If you call a SOAP method that returns a QueryViewer object, the child elements of "return" are unqualified, but the schema types specify that all elements and attributes are qualified (i.e. they are supposed to have namespace prefixes).  The following namespace schema declarations where modified to have unqualified attributes and elements: dashboard.model.v1.service.resource.manager.product.arcsight.com/xsd,

util.java/xsd,

client.model.coma.arcsight.com/xsd,

bridge.coma.arcsight.com/xsd,

model.v1.service.resource.manager.product.arcsight.com/xsd,

service.coma.tools.arcsight.com/xsd,

drilldown.model.v1.service.resource.manager.product.arcsight.com/xsd

2. complexType name="ViewableResource" (ln 7) and complexType name="QueryViewer" - QueryViewer is an extension of ViewAbleResource and there is a duplicate declaration of the "enabled" element.  This makes the schema ambiguous and invalid.  I commented out the declaration in the ViewableResource.

3.  complexType name="Resource$SubType" - There are two big problems with this type

a.  "$" symbols are not allowed in XSD complexType names.  I renamed this type to "ResourceSubType" and updated all references to this type

b.  This type, as it is declared, extends the xsd type "Enum."  There is no such xsd type and this is an invalid reference.  It looks like what they were trying to do is to declare an enumeration.  This is achieved via a simpleType with enum restrictions on xs:string - see line 1415 in the fixed version.

4.  complexType name="DrilldownType" (line 1468).  Same issue as 3.b

There may have been a few other little things that I'm forgetting, but those are the major issues.  I wonder how many of the other wsdl files have problems like this.

Labels (2)
4 Replies
spencerln Frequent Contributor.
Frequent Contributor.

Re: Issues using ESM API QueryViewerService wsdl

I am having the same issues as you with Visual Studio and .NET applications of SOAP. I ended up using REST calls to do most of what I wanted, but it's a big pain point that the JavaDoc doesn't even cover many of the available services, such as ActionList. So it becomes a bit of game of guess and check. Did you have any success with being able to use the generated code after correcting the WSDL in order to interface with Arcsight? Or did you fixing the WSDL break the connection?

Trusted Contributor.. zonki Trusted Contributor..
Trusted Contributor..

Re: Issues using ESM API QueryViewerService wsdl

I've been able to use the .NET generated classes after I fixed the WSDL.  What a pain though.  Still, it is less of a pain than using the REST interface.  REST is a great choice if I were building a Web Application with lots of Javascript, but for back-end code, SOAP makes much more sense.  Maybe they'll fix their WSDL files.  I haven't submitted a ticket yet, but I do plan to do so.

spencerln Frequent Contributor.
Frequent Contributor.

Re: Issues using ESM API QueryViewerService wsdl

I went through pretty much all of the WSDL for manager services and nearly every one has an issue. There were 2012 errors in total, mostly for having the $ symbol in names, but also for invalid namespaces, undeclared types and other miscellaneous errors.

Micro Focus Expert
Micro Focus Expert

Re: Issues using ESM API QueryViewerService wsdl

Thank you folks for your work here. It is appreciated.

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.