Forum

This content is now out of date.

Visit Our Community

CommunicationException using Asp.Net with Jax webservices

Hi,

I have an ASP.Net MVC application that I'm trying to integrate with YellowFin 7.1. Following advice from other posts I'm attempting to use the "JAX ;)" web services. I've enabled them on my YellowFin installation, and created C# Stubs[1].

When I try and run my code I receive a CommunicationException:

[code]
System.ServiceModel.CommunicationException was unhandled by user code
HResult=-2146233087
Message=There was an error in serializing body of message remoteReportCallRequest: 'Unable to generate a temporary class (result=1).
error CS0030: Cannot convert type 'string[]' to 'string'
error CS0029: Cannot implicitly convert type 'string' to 'string[]'
'. Please see InnerException for more details.
Source=mscorlib
[/code]

(I've cut out the stack trace as it didn't appear to reveal anything interesting)

My Code looks like:
[code]
var request = new reportServiceRequest();
request.loginId = "XXXXX@YYYYY.com";
request.password = "XXXXXX";
request.orgId = 1;

request.reportRequest = "XLS";
request.reportId = reportId;

var service = new LegacyReportServiceClient();
var response = service.remoteReportCall(request); // <-- exception occurs here

[/code]

Where reportId is a parameter value.

* Any ideas?

Rik
[1] >svcutil http://locvalhost:8080/webservices/LegacyReportService?wsdl

I might have solved this one. It looks like the generated stub for reportServiceResponse may not be quite right. I changed the Serialisation attributes for the "results" property to be:

[code]
[System.Xml.Serialization.XmlArrayAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable = true, Order = 46)]
[System.Xml.Serialization.XmlArrayItemAttribute("dataValue", typeof(string[]), Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string[][] results
{
get { return this.resultsField;}
set { this.resultsField = value; }
}

[/code]

Note the change is to the typeof() declaration in the XmlArrayItemAttribute. It was previously typeof(string)
I am new to Yellowfin,where do I put the References stub in my project.I have it under references but the stub does not et automatically updated when I make changes to my xsd

Tshepiso
I use Visual Studio 2012.

Tshepiso
Hi Tshepiso,

Unfortunately we don't actually know how Visual Studio is reading the stub.
You will need to refer to Visual Studio documentation or help for further assistance.

Really sorry we could not answer this for you.

Regards,
David

Thanks for trying Yellowfin

Please complete the form below to request your copy of Yellowfin today.