1. Harun Cetin
  2. PowerBuilder
  3. Tuesday, 1 September 2020 23:41 PM UTC

Hi, im usingpb 12.5 and i am trying to get data from the web service but the method return value is null.

I already searched all internet but i didnt find any reason. 

I choosed "any" as return value it returned to null again.

I downloaded the latest version ofpb (pb19) but the result is same (null)

When i looked via fiddler, i can see the return values

I didt get any error from the web service.

 

What can i do else?

  

Harun Cetin Accepted Answer Pending Moderation
  1. Wednesday, 2 September 2020 18:38 PM UTC
  2. PowerBuilder
  3. # 1

Test web service link.

http://efatura-test.uyumsoft.com.tr/Services/BasicDespatchIntegration?wsdl

Test Web page

https://portal-test.uyumsoft.com.tr/GelenIrsaliye

My code:

Int i,ll_rc
String li_ret, despatchid

soapconnection conn;conn =create soapconnection
usbasicdespatchIntegration ln_integration;
usdespatchresponse li_r
ll_rc=conn.createinstance( ln_integration, "usbasicdespatchIntegration")
IF ll_rc<>0 THEN ;messagebox("Error","Service connection problem");return -1 ;END IF

ususerinformation l_ui; l_ui=create ususerinformation
l_ui.username ="Uyumsoft";
l_ui.password="Uyumsoft";

despatchid ="ecbcea08-0e96-4b26-ad81-450a136d6d1d"
UsDespatchResponse l_dresponse;l_dresponse=Create UsDespatchResponse
TRY
    l_dresponse= ln_integration.getinboxdespatch( l_ui , despatchid )
    // l_dresponse value is coming null
    IF l_dresponse.issucceded=FALSE THEN
        messagebox("Ok",l_dresponse.ws_message );
        return -1;
    END IF
CATCH (runtimeerror runerr1 )
    li_ret=runerr1.text
    messagebox("Error",""+li_ret );return -1
FINALLY
END TRY

Thanks for your attention.

Comment
  1. Chris Pollach @Appeon
  2. Wednesday, 2 September 2020 19:38 PM UTC
Is your "SoapConnection" class the .NET version?
  1. Helpful
  1. Harun Cetin
  2. Thursday, 3 September 2020 21:23 PM UTC
yes, my soapconnection class is .net version.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 2 September 2020 19:37 PM UTC
  2. PowerBuilder
  3. # 2

Hi Harun;

  In order to help you further, we would probably need to see either your code set - OR - a small test case PB App that behaves the same way.

Regards .... Chris

Comment
  1. Harun Cetin
  2. Thursday, 3 September 2020 21:22 PM UTC
i will be very happy if you connect my computer. I can show you the "null" problem.
  1. Helpful
There are no comments made yet.
Harun Cetin Accepted Answer Pending Moderation
  1. Wednesday, 2 September 2020 22:38 PM UTC
  2. PowerBuilder
  3. # 3

Yes, my soap connection class is .net version. using.net version

Comment
There are no comments made yet.
Mark Lee @Appeon Accepted Answer Pending Moderation
  1. Thursday, 3 September 2020 07:40 AM UTC
  2. PowerBuilder
  3. # 4

Hi Harun,

 

I have tested your code but couldn’t dive deeper since your code never works in PB 12.5 or PB 2019 with Soap Client.

And currently creating Web service proxy for connecting to SOAP server will no longer be eligible for technical support.

https://www.appeon.com/developers/obsolete-features-in-powerbuilder-2017R3.html 

 

So I suggest you use a third-party tool like Postman / SoapUI to verify what protocol and arguments you need to use to successfully call the Web service API.

And then use HTTPClient to rewrite the code to call SOAP Web service. You can refer to the following link for the details:

https://www.appeon.com/developers/get-help/knowledgebase/call-soap-web-service-using-httpclient-object.html

 

Regards,

Comment
  1. Harun Cetin
  2. Thursday, 3 September 2020 21:30 PM UTC
I tested with soapUI. web service successfully returns data.

When i run my code with pb 12.5 or pb 19 and checked which data is coming from web service (via fiddler program),

i saw that the results of fiddler and the results of SOAPUI are same.
  1. Helpful
  1. Mark Lee @Appeon
  2. Friday, 4 September 2020 01:40 AM UTC
Hi Harun,

As you said, it seems that this is a bug or nonsupport for Soap Client.

If you use a string as the Web Service Return value instead of the Structure value, will it work?

I still recommend you use HTTPClient to rewrite the code to call SOAP Web service and you can use the json or xml format as return value.

https://community.appeon.com/index.php/articles-blogs/tutorials-articles/2-powerbuilder/296-how-to-use-httpclient-or-restclient-to-call-an-api-with-basic-authentication

https://community.appeon.com/index.php/articles-blogs/tutorials-articles/2-powerbuilder/295-call-wcf-services-using-httpclient-or-restclient-objects-2

https://www.appeon.com/developers/get-help/knowledgebase/how-use-pbdom-object-build-xml-content-required-soap-webservice-and-parse-xml-document.html
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 3 September 2020 14:14 PM UTC
  2. PowerBuilder
  3. # 5

Hi Harun;

  If the WebService is one that you built from PB, returning an ANY data value would not be valid. A Web Service that returns a value must be of the standard XML simple data types. From your code snippet, it looks like your expecting a "Structure" as the return value ...

    l_dresponse= ln_integration.getinboxdespatch( l_ui , despatchid )

  If so, please have the WS return a structure and NOT use an ANY data type. This might be confusing the .NET WS  generation of the "proxy" helper DLL when it intropects the WSDL. Just a thought.

Regards ... Chris

Comment
  1. Harun Cetin
  2. Thursday, 3 September 2020 21:44 PM UTC
ım calling the web service.

ws Return value is structure and im using structure as return value.

When i run the code, my structure value turning to null.

If I use "any" value as return value, the results is same. (NULL)
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.