1. Moshe Tangi
  2. PowerBuilder
  3. Wednesday, 25 March 2020 12:26 PM UTC

Hello all ,

I am trying to consume a WCF ws  in pb 2017 r3 with .NET proxy object .

*  I know I should use Httpclient but I don't know how to use it if I don't have any example of xml describes the functions calls , setting the fields and all … from the vendor

Any how :

All the  objects were created with its functions .

when I am calling the ws function I get the exception error : "  bad request : 400 "

My questions :

1. I noticed that in the ws proxy  wizard  I can use svc file and not just  wsdl file , is it matters ?

2. I tried to set log file .. it creates a txt file but its empty ? why ?

3. My code is  with Try & Catch ...and  the ws function  result between it … the code  jumps right to the exception message in the catch statement  .. why ? it's like the function's call  does not happen at all ?

4. I have installed Fiddler .  If I open the IE with the wsdl file I can see fiddler captures it .. but  calling the ws with  my app ..nothing appears in  Fiddler ..why ?

5. what should I check / configure ? the vendor told me no user id or password needed

6. How can I test a wcf ws on the remote machine as a consumer ?

I have created some ws which works on that machine , with same user , OS , pb version …

one more thing :

the vendor sent me how he defines the endpoint :

<endpoint address="https://jergviaservicesws-test16.muni.jerusalem.muni.il/OpenAndUpdateAccount/Service.svc"

        behaviorConfiguration="ImpersonationBehavior" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService11"

        contract="OpenAndUpdateAccountTest.IService" name="WSHttpBinding_IService10">       

      </endpoint>

I tried to define the same , but nothing helps

 

Thanks a lot

 

Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Friday, 27 March 2020 01:25 AM UTC
  2. PowerBuilder
  3. # 1
Comment
There are no comments made yet.
Kevin Ridley Accepted Answer Pending Moderation
  1. Wednesday, 25 March 2020 20:33 PM UTC
  2. PowerBuilder
  3. # 2

Is the WCF service exposed as SOAP, REST or both?  Here's a link that explains how to do both:
https://www.dotnetcurry.com/wcf/728/expose-wcf-service-soap-rest

 

If it's SOAP, did you consume the WSDL and generate all of the proxy objects?  You didn't show any code inside the try/catch so it's hard to diagnose.  Also are you trying to run it from the IDE or compiled EXE?  You're not seeing anything in FIDDLER because it's not making it past the DLL that's generated when you consume the WSDL.  I'm assuming you have either imported the pbwsclient170.pbx or the same name PBD so you have the 3 objects - soapconnection, soapexception and soappbcookie?  Also assuming you have created the soapconnection and successful CreateInstance of the proxy?  Really need to see that code.

 

If it's exposed as REST, you need to use either the RESTClient (if it's a simple/flat result) or HTTPClient, but again, we need to know how the service is exposed SOAP/REST/both?

 

KR

Comment
  1. Moshe Tangi
  2. Thursday, 26 March 2020 06:31 AM UTC
Hi Kevin

Thanks for answer .

1. I did consume the wsdl file successfully and see all the objects & functions .

2. I am using pbwsclient170.pbd with the pbl list .

3. Trying from IDE .

4. About the WCF - I really don't know ..I am going to find out to know more .

5. The code inside the Try & Catch is the ws function call and checking its result .



I am going now to read and ask more about the wcf ws



Thanks

  1. Helpful
  1. Kevin Ridley
  2. Thursday, 26 March 2020 11:58 AM UTC
Well it's failing between the try and the catch, lol. What is the return code from the CreateInstance? Also if the ws produced the WSDL that you consumed, then it's exposed as SOAP for sure, so I wouldn't worry about that.
  1. Helpful
There are no comments made yet.
Ricardo Jasso Accepted Answer Pending Moderation
  1. Wednesday, 25 March 2020 17:36 PM UTC
  2. PowerBuilder
  3. # 3

Moshe,

Could you provide the WSDL file and any related XSD files so I can test it on my side?

Regards,

Ricardo

Comment
  1. Moshe Tangi
  2. Thursday, 26 March 2020 06:25 AM UTC
Hi Ricardo ,



Thanks for answer but the wsdl can't help here because the ws exposed only in the internal net of the city I work with

I actually have a pc there just for that

Thanks
  1. Helpful
There are no comments made yet.
Armeen Mazda @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 25 March 2020 15:13 PM UTC
  2. PowerBuilder
  3. # 4

The old .NET client is for SOAP web services.  For WCF you can use the new REST Client, which is easier to use than the general HTTP Client because we specialized it for calling REST based services.  However, the WCF service must return JSON not XML.  If it returns XML you need to use the HTTP Client to call the WCF service.

Comment
  1. Moshe Tangi
  2. Thursday, 26 March 2020 06:37 AM UTC
Hi Armeen ,

Thanks for answering

I am going to find out how this wcf ws exposed , SOAP or REST and then to decide how to consume it .

I have never used REST Client before , but there is always the first time ..right ?

Thanks
  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.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.