Has anyone implemented Reporting Service (Execution) Web Service from within Powerbuilder 10.5?
I am trying to pass NULL value to the second argument of LoadReport function (to not get the History Snapshot) and the SOAP call gives an error message "String was not recognized as a valid DateTime". I could not pass Powerbuilder NULL (SetNull(StringColl) and StringCol passed as the snapshotID) value as the second argument to LoadReport as for some reason the Web Service could not be invoked. If I pass empty string (or 'NULL' string) I get the following error message. If I pass 'or '1900-01-01T00:00:00', then Reporting Service looks for a snapshot with this date and fails.
Is there a way to send a string from PowerBuilder, which would mean 'NULL Datetime' to the SOAP call so that Reporting Service just loads the passed Report without looking for a snapshot?
Thanks in advance.
--
System.Web.Services.Protocols.SoapException: The parameter value provided for 'snapshotID' does not match the parameter type. > Microsoft.ReportingServices.Diagnostics.Utilities.ParameterTypeMismatchException: The parameter value provided for 'snapshotID' does not match the parameter type. > System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.ParseExact(String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style)
at System.DateTime.ParseExact(String s, String format, IFormatProvider provider)
at Microsoft.ReportingServices.Diagnostics.Globals.ParseSnapshotDateParameter(String snapshotDate, Boolean nullIsValid)
End of inner exception stack trace
at Microsoft.ReportingServices.Diagnostics.Globals.ParseSnapshotDateParameter(String snapshotDate, Boolean nullIsValid)
at Microsoft.ReportingServices.WebServer.HttpClientRequest.Init(CatalogItemContext context, String userName)
at Microsoft.ReportingServices.WebServer.SessionStarterAction.CreateNew()
at Microsoft.ReportingServices.WebServer.ReportExecutionService.LoadReport(String Report, String HistoryID, ExecutionInfo& executionInfo)
End of inner exception stack trace
at Microsoft.ReportingServices.WebServer.ReportExecutionService.LoadReport(String Report, String HistoryID, ExecutionInfo& executionInfo)
Hello,
Without pretending to know what powerbuilder is I want to let you know that I came across a similar exception in VS 2005 today.
{System.Web.Services.Protocols.SoapException: The parameter value provided for 'snapshotID' does not match the parameter type. > The parameter value provided for 'snapshotID' does not match the parameter type. > String was not recognized as a valid DateTime.
I resolved this by changing by changing this code (once again, not familiar with your problem - I'm not sure if you can actually change code in powerbuilder...):
byte[] fileData = rs.Render(_reportPath, formatStr, "", deviceInfo, renderParameters, null, "", out ignoreString, out ignoreString, out ignoreValue, out ignoreWarning, out ignoreArrayString);
to this:
byte[] fileData = rs.Render(_reportPath, formatStr, null, deviceInfo, renderParameters, null, "", out ignoreString, out ignoreString, out ignoreValue, out ignoreWarning, out ignoreArrayString);
Regards,
Luc Pettett
|||Thanks for your reply. However, when NULL is passed the web service call fails with 'Cannot invoke web service' error. The same call works if a valid datetime is passed. It seems to be something specific to PowerBuilder as I could call these methods successfully in VS 2005.
Thanks
|||Hrrm... I am checking out powerbuilder now, but it looks like it is doing "the wrong thing" when sending the null string, which is causing us to try to interpret the empty string as a history id.|||Have you tried using the .NET SOAP bindings for Powerbuilder? I just installed PowerBuilder and tried it out, and it seems to send different XML than what the Visual Studio generated proxy sends. Specifically, the History element is marked w/xs:nil=true whereas the elements is ignored completely in the Visual Studio proxy. Maybe the XML will be closer to what VS generates if you use the .NET binding?|||Thanks for your response. In fact, I have been trying this only with .NET SOAP engine.
If I call LoadReport with a proper HistoryID, the call succeeds. However, when NULL is passed as HistoryID, a SOAP exception is generated ('Cannot invoke the Web Service') and I do not see any entries in Trace. Are you able to see some entries in Trace when NULL is passed (from your reply - "... and it seems to send different XML than what the Visual Studio generated proxy sends.") from PowerBuilder?
I could not find a way to pass NULL string values as arguments to PB Web Service calls.
The function is defined as below in the PowerBuilder 10.5 generated proxy (using .NET SOAP engine) :
loadreport ( string report, string historyid ) returns
s25executioninfo
In the WSDL for this web service, the function argument
in question is defined as
- <s:element name="LoadReport">
- <s:complexType>
- <s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Report" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="HistoryID" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
However, I do not see the attribute nillable="true" or xs:nil=true set for HistoryID. Is this what causing the problem with NULL argument in PowerBuilder? If I try the same call from within VS 2005 (using C#) using NULL argument, it works fine.
Please let me know if I can try anything different to make this work from within PowerBuilder 10.5 (Build 5079).
|||I am not 100% certain about this, but I believe the issue is in how PowerBuilder is constructing the SOAP to send to the reporting server. Setting xsi:nil=true is not semantically equivalent to ignoring the element altogether. Since the XSD doesn't define the element as being nillable, I don't think ASP.Net honors the xsi:nil attribute on the incoming SOAP envelope.
I'm not really certain what to tell you at this point, other than you might want to consider using an alternative SOAP implementation for PowerBuilder. I am not aware of any though (I am new to PowerBuilder as of last night).
If using an alternative implementation is not an option, then you might want to consider having the SOAP object in PowerBuilder communicate to a proxy which sends a conformant SOAP envelope to the Report Server.
|||Ok, I just double checked the XML Schema spec (http://www.w3.org/TR/xmlschema-1/) and it looks like for element declarations the default value of nillable is false. So in this case, PowerBuilder is doing the wrong thing. When it tries to send null value, and the schema component is optional (in this case it is, since minOccurs=0), then it should simply omit the element altogether.|||Thanks again for your response. As you have suggested, I will try the other options that you have mentioned and let you know if I succeed. Can you please answer the other question I had in the earlier mail?
Are you able to see some entries in Trace when NULL is passed (from your reply - "... and it seems to send different XML than what the Visual Studio generated proxy sends.") from PowerBuilder? I am curious to know as I do not see any SOAP request passed to the trace when NULL is passed and only a SOAP exception ('Cannot invoke the Web Service') is generated.
Thanks a lot.
|||I did not get the "Cannot invoke the Web Service" error message. I was using the EasySOAP stack, and the XML it generated for the null historyId parameter was <HistoryId xsi:nil="true"></History>. The code I was using (I don't have it in front of me right now) basically looked like this:
string historyId
SetNull(historyId)
rsproxy.LoadReport("/myreport", historyid)
|||Thanks. I will get back to you after I try the alternatives you mentioned earlier.|||I am actually trying this to use a wrapper web service to workaround a problem with using Reporting Service Web Service from PowerBuilder 10.5. But, I get the following exception when 'LoadReport' (execInfo = rs.LoadReport(reportPath, historyID); with historyID being NULL ) is executed (VS 2005 - Debug -> Start Without Debugging) from a ASP .NET Web Service (created using VS 2005 / C#). However, the same thing works when running it as a Visual Studio Console application created using C#.The credentials are set as
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
The local website ReportSever$SQL2005's 'Directory Security' has 'Anonymous access' unchecked, the User Name is 'IUSR_USER1' and 'Integrated Windows Authenticaiton' is checked.
Please let me know what kind of additional permissions are needed USER1\ASPNET. The user 'USER1' is under 'ActiveDirectory' domain.
Thanks in advance.
System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException:
The permissions granted to user 'USER1\ASPNET' are insufficient for performing this operation. > Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException: The permissions granted to user 'USER1\ASPNET' are insufficient for performing this operation.|||I just found out that the Report itself did not have permissions for ASPNET. Now, the workaround that I am trying for PB 10.5 also seems to work for
LoadReport through a wraparound ASPNET Web Service (of course, I haven't tried many things yet).
Thanks Mr. Gallardo for all your help.
No comments:
Post a Comment