cancel
Showing results for 
Search instead for 
Did you mean: 

Issue related to webservice

Former Member
0 Kudos

Hi,

I have two issues, please help me on this.

1> I have created a webservice..In this webservice i have created a function and with in the function i am trying to call another webservice by using a webservice datawinodow. The webservicedatatwindow  is not retriving any data and retun -1 .But the same webservice is return data while i am trying toretrive through powerbuilder classic.I dont know why this.

2> In the webservice i have created a function in the NON VISUAL userobject.I am passing datetime parameter,long and integer. Webservice is created.But while trying to access the webservice through powerbuilder o invalid input parameter.And in the soap UI also its showing error.

Should we have to pass only string variables as input while creating a webservice in powerbuilder 12.5.1.

Waiting for your positive response.

Regards

Subrat

Accepted Solutions (1)

Accepted Solutions (1)

former_member190719
Active Contributor
0 Kudos
The webservicedatatwindow  is not retriving any data and retun -1

This could mean that the datawindow object never got set on the datastore you are using to host it, potentially because the datawindow object is missing from the compiled program.  You'll need to do so debugging.  Check the return code from SetTransObject, trace the database connection, etc.

Should we have to pass only string variables as input while creating a webservice in powerbuilder 12.5.1.

No.  Try using Fiddler to monitor the call that PowerBuilder is making to see what it's request looks like.  Compare that with a working call using SOAPUI.

Former Member
0 Kudos

Hi Bruce,

This is the response in the SOAPUI.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">

   <s:Body>

      <s:Fault>

         <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:Deserializatio...>

         <faultstring xml:lang="en-US">The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempurl.org:adt_dob. The InnerException message was 'There was an error deserializing the object of type System.DateTime. The value '' cannot be parsed as the type 'DateTime'.'.  Please see InnerException for more details.</faultstring>

      </s:Fault>

   </s:Body>

</s:Envelope>


For the point number -1 , i have checked the data window is properly set.

Regards

Subrat

former_member190719
Active Contributor
0 Kudos

I'm confused now.  You mean the response that PB got shown in Fiddler?

An error response in SOAPUI would just indicate that you sent the wrong data in SOAPUI.

Former Member
0 Kudos

HI Bruce,

The webservice which i have created using PB 12.5.1,When i am trying to acess that webservice through powerbuilder ( means by creating  a webservice datawindow), it showing invalid input parameter.

I am checking the same wsdl file using SOAPUI and manually providing input parameters, at that time it is showing the error.

Regards

Subrat

former_member190719
Active Contributor
0 Kudos

Right now what it means is that what you're providing as a date to SOAPUI isn't in the format that the service is expecting.

Web services expect dates to be formatted as yyyy-mm-ddThh:mm:ssZ where T is the delimiter and Z is the Timezone offset.

Former Member
0 Kudos

Hi Bruce,

i am trying to acess the webservice in powerbuilder, its showing as invalid input parameter.

Steps- Select the grid datawindow -> select webservice datasource-> provided the wsdl and dll name , select the function to access, and select the [RET] parameter,Now the issue is coming as 'An invalid input parameter type was detected"

Regards

Subrat

former_member190719
Active Contributor
0 Kudos

Whose service are you trying to access with the web service datawindow?  There are only certain result types that it can handle.

Note too that the web service datawindow is still using ASP.Net web services with the old XMLSerializer.  WCF web services use the DataContractSerializer by default, and the two are not compatible.

http://msdn.microsoft.com/en-us/library/ms733901(v=vs.110).aspx

Former Member
0 Kudos

Hi Bruce;

  I don't think that is the problem as Subrat answered my question as follows:

6) Does the WS DW test OK in the DW painter? Yes

So that seems to me that the WS DW is OK - just not incorporated within his PB application code properly.

Regards ... Chris

Former Member
0 Kudos

HI Bruce and Chris,

I think i am not able to explain the issue properly.I am trying to again expalin the issue.

1> I have created a webservice data window using pb.net. In the webservice i have created a function nvo_membersearch.In the said function i have declared 11 input parameter. From this 11 input parameter,

6  is of string type, 1 is of datetime parameter and another 4 is of integer parameter.This function returns a Structure array. ( More than 1 rows). Webservice is created successfully.

Now  i am accessing the newly created webservice in powerbuilder to build a webservice datawindow.

The steps i am following to create the webservice datawindow.

Select the grid datawindow -> select webservice datasource-> provided the wsdl and dll name , select the function to access, and select the [RET] parameter,Now the issue is coming as 'An invalid input parameter type was detected".

Again i came back to my webservice function and changed the datetime parameter to string and integer parameter to String.Now i have delpoyed the webservice and trying to create a webservice datawindow using the same Wsdl file,It created successfully.

Thatswhy i dont understand why it is not taking datetime and integer datatype as input parameter.

2> Above i have mentioned that my webservice is returing a Structure array.While i am calling this webservice, no data is returning ( i have checked more than 500 row is there). But in the datawindow all the columns are displayed and one blank row is coming.

I am using the same webservice in the WPF application and able to see that a structure array is returning from the webservice.But i am not able to understand why the webservice is not showing the data while i am trying to access through it pb and SOAPUI.

I am using powerbuilder 12.5.1 build no-4953.

Hope you will get my point.

Regards

Subrat

Former Member
0 Kudos

Hi Subrat;

  I will defer to Bruce here to answer your question in more depth. While I build and run all the elements that you are working on - I do not use PB.Net but instead PB Classic and Appeon to accomplish all my Web Service needs.

  While I do dabble in PB.Net for my own curiosity, I only use PB Classic for production Web Services and WS based applications. So that is where my in-depth WS expertise lies.

Good luck!

Regards ... Chris

Former Member
0 Kudos

Hi Bruce,

I am able to overcome the first list issue by using XmlSerializerFormat.Now the service attribute of my  webservice is as below.

[XmlSerializerFormat]

[ServiceBehavior]

[ServiceContract(Name="n_customnonvisual",Namespace="http://tempurl.org")]

Now i am able to use datetime and integer parameter as input parameter.

But now new issue is coming , while checking this webservice in sopa UI , after passing the parameter

it is showing the error

s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">

   <s:Body>

      <s:Fault>

         <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode>

         <faultstring xml:lang="en-US">The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the &lt;serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs.</faultstring>

      </s:Fault>

   </s:Body>

</s:Envelope>

I have changed the IncludeExceptionDetailInFaults value to true.But still also got the error. Please help.From last 4 days i am stuck here

Otherwise if you have some solid example /video how to create a webservice using pb.net which is returing more than 1 row , please send me on the below id.So that i can go through and try to resolve the issue.

Thanks for your help!!!

Regards

Subrat

former_member190719
Active Contributor
0 Kudos

I am able to overcome the first list issue by using XmlSerializerFormat.Now the service attribute of my  webservice is as below.

[XmlSerializerFormat]

[ServiceBehavior]

[ServiceContract(Name="n_customnonvisual",Namespace="http://tempurl.org")]

Now i am able to use datetime and integer parameter as input parameter.

Using XMLSerializerFormat doesn't address the input parameters.  It ensures that the result set that is being returned can be handled by the ASP.Net web service client.


But now new issue is coming , while checking this webservice in sopa UI , after passing the parameter

it is showing the error

s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">

   <s:Body>

      <s:Fault>

         <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode>

         <faultstring xml:lang="en-US">The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the &lt;serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs.</faultstring>

      </s:Fault>

   </s:Body>

</s:Envelope>

I have changed the IncludeExceptionDetailInFaults value to true.But still also got the error. Please help.From last 4 days i am stuck here

Changing IncludeExceptionDetailInFaults won't prevent the error.  It just makes sure that the root reason for the exception is passed down to the client.


Otherwise if you have some solid example /video how to create a webservice using pb.net which is returing more than 1 row , please send me on the below id.So that i can go through and try to resolve the issue.

There is an example here:

Creation and Consumption of Web Services with PowerBuilder

I did a PB.TV session on the topic as well, which is referenced here:

Most likely the reason you are having a problem with the input parameter in SOAPUI is that you're not providing the date in the format that the service expects for a datetime value.  It would help to see what you are passing.

What you might consider doing is changing the argument to a string and then parse it within the service.  If that works, then you know the datetime parameter is the issue.  Then you can work specifically on that to try to get it working as a datetime parameter.

Former Member
0 Kudos

Hi Bruce,

Thanks for sharing the video.I have learnt lots of thing from this.

Now i am getting new issue,may be i am following wrong step.

1> how to create a grid datawindow with retrival argument in powerbuilder.net 12.5.2 ?

Because i have imported a datawindowobject  from another application and assigning this datawindow to the datastore,While debugging i am getting this error' that 'datawindow  doesnot exist on the current context'

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Subrat;

   Can you tell us ...

1) Is this PB Classic or PB.Net?

2) Are the web services all from PB?

3) What version & build of PB are you using?

4) What version of IIs are the WS components being hosted by?

5) Are you using WCF, SOAP or the .Net WS engine?

6) Does the WS DW test OK in the DW painter?

7) Have you tried to trace (debug) the WS during the DW WD call?

😎 Do you have something like Fiddler2 to chack the WS interaction between the client & the end point WS?

etc

Regards ... Chris

Former Member
0 Kudos

Hi Chris,

Please find the details.

1) Is this PB Classic or PB.Net?-      pb.net

2) Are the web services all from PB? - i am creating a webservice in pb but with in th webservice i am trying to acess another webservice written on another language ( May be JAVA)

3) What version & build of PB are you using?- Pb 12.5.1 buld no 4953)

4) What version of IIs are the WS components being hosted by? IIS7

5) Are you using WCF, SOAP or the .Net WS engine? using WCF

6) Does the WS DW test OK in the DW painter? Yes

7) Have you tried to trace (debug) the WS during the DW WD call? No

😎 Do you have something like Fiddler2 to chack the WS interaction between the client & the end point WS?

Yes, i am checking on fiddler .Its not showing on the fiddler

Please let me know if any thing extra you need

Thanks

Subrat

Former Member
0 Kudos

Thanks Subrat for the more detailed information.

Q1: For the WS DW - have you coded the WSError event of the DS or DC container to trap more information on the DW's -1 failure?

FWIW: I would also put a TRY..CATCH around the WS DW code and see if an exception is thrown. If so, the Exception object may contain more information as to the reason for the WS failure.