0
Votes
Undo
  1. Moshe Tangi
  2. PowerBuilder
  3. Wednesday, 25 March 2020

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

 

Who is viewing this page
Armeen Mazda @Appeon Accepted Answer Pending Moderation
Comment
There are no comments made yet.
  1. Friday, 27 March 2020
  2. PowerBuilder
  3. # 1
Kevin Ridley Accepted Answer Pending Moderation
1
Votes
Undo

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
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. Moshe Tangi
  2. Thursday, 26 March 2020
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. Kevin Ridley
  2. Thursday, 26 March 2020
There are no comments made yet.
  1. Wednesday, 25 March 2020
  2. PowerBuilder
  3. # 2
Ricardo Jasso Accepted Answer Pending Moderation
0
Votes
Undo

Moshe,

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

Regards,

Ricardo

Comment
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. Moshe Tangi
  2. Thursday, 26 March 2020
There are no comments made yet.
  1. Wednesday, 25 March 2020
  2. PowerBuilder
  3. # 3
Armeen Mazda @Appeon Accepted Answer Pending Moderation
1
Votes
Undo

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
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. Moshe Tangi
  2. Thursday, 26 March 2020
There are no comments made yet.
  1. Wednesday, 25 March 2020
  2. PowerBuilder
  3. # 4
  • Page :
  • 1


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