Hello,
I am a complete newbie to SUSHI developing thus please forgive me if this is a silly question. One of our vendors developed a SUSHI Counter report wsdl for us and I am supposed to use the wsdl to create report. I knew nothing about the service and they did not provide much detail either. All they told me is that the service is “working” and I am left on my own.
I am using .Net developing the report thus I add the web service through visual studio and I can see all class and objects and methods. I declared the ReportRequest, ReportResponse and Sushi Service and filled in the information I got from the vendor. Then I called GetReport(ReportRequest) method and it threw a “System.Web.Services.Protocols.SoapHeaderException was unhandled by user code” error. I don’t know what I missed and since there’s very few information I can find online, I am completely in the dark. Can someone help me? Below is my code.
Thanks.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CounterReport;
namespace CounterReport
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
CounterReport.ReportRequest rr = new CounterReport.ReportRequest();
rr.ID = Guid.NewGuid().ToString();
rr.Created = DateTime.Now;
rr.CreatedSpecified=true;
CounterReport.CustomerReference cr = new CounterReport.CustomerReference();
cr.ID = "000001047715";
CounterReport.ReportDefinition rd = new CounterReport.ReportDefinition();
CounterReport.ReportDefinitionFilters filter = new CounterReport.ReportDefinitionFilters();
CounterReport.Range range = new CounterReport.Range();
range.Begin = Convert.ToDateTime("2013-04-01");
range.End= Convert.ToDateTime("2013-09-30");
filter.UsageDateRange = range;
rd.Filters = filter;
rd.Name = "JR1";
rd.Release = "4";
CounterReport.Requestor reqor = new CounterReport.Requestor();
reqor.ID = "demo";
reqor.Name = "peggy";
reqor.Email = "pmeng@xxxxxxxxxxxxxx";
rr.Requestor = reqor;
rr.CustomerReference = cr;
rr.ReportDefinition = rd;
CounterReport.SushiService ss = new CounterReport.SushiService();
//site security certification expired, this is the way to bypass the security check
System.Net.ServicePointManager.ServerCertificateValidationCallback = (Sender, cert, chain, error) =>
{
return true;
};
CounterReport.ReportResponse rre = new CounterReport.ReportResponse();
rre= ss.GetReport(rr);
}
}
Peggy Meng