1. Andres Slachevsky
  2. PowerBuilder
  3. Wednesday, 5 December 2018 14:26 PM UTC

Hello All,
Need help calling a Webservice 

I have this endpoint 

http://efxpywsdev.informconf.com.py/Services/PDFServicePriv.svc?wsdl

i can create the proxy object with no problem

when i call any method in the WS it fails with the message:


no se puede reflejar el método reporteempresatipob 

this is the method definition 

reporteempresatipob ( long xitipopassword, boolean xitipopasswordspecified, longlong xlafiliado, boolean xlafiliadospecified, longlong xlpersona, boolean xlpersonaspecified, string xscontrasenia, string xsip, string xsruc, string xsusuario, ref byte lopdf[] )  returns string

 

i added the line to generate the log file and it is empty 

any way i can trace the root of the problem

Can it be cause bye the ref byte lopdf[] 

 

 

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 5 December 2018 15:41 PM UTC
  2. PowerBuilder
  3. # 1

Hi Andres;

  FWIW:  Your WSDL seems OK when I test it in the SOAPUI product ...

 

  You might need to contact the Web Service supplier on this issue to get more clarification on their error message.

 

Regards ... Chris

 

Comment
  1. Andres Slachevsky
  2. Thursday, 6 December 2018 11:20 AM UTC
Yes

there are many .NET and Java application calling it with no problems.,

i´m checking the WS development team if they use reflexión and overloading.

  1. Helpful
There are no comments made yet.
David Peace (Powersoft) Accepted Answer Pending Moderation
  1. Wednesday, 5 December 2018 16:11 PM UTC
  2. PowerBuilder
  3. # 2

Looking at thw WSDL file the relevant part contains:



or this:



or this:

My gut is telling me that this is the reflection, i.e. the function is overloaded which I believe PB cannot deal with.

Your choices are:

Edit the wsdl and remove the overloaded entries leaving only the one you want to use and PB might work.

OR

Abandon the PB proxy route and use the new http object to format and make the call manually.

 

Hopefully someone will confirm my suspicions.

Regards

David

Comment
  1. David Peace (Powersoft)
  2. Wednesday, 5 December 2018 16:14 PM UTC
Don't know why the viewer is losing the posted XML from the WSDL.
  1. Helpful
  1. Andres Slachevsky
  2. Wednesday, 5 December 2018 17:47 PM UTC
Thanks David

I will try the new HTTP object to call the WS

my only issue will be how the get the ref byte lopdf[]



  1. Helpful
There are no comments made yet.
Andres Slachevsky Accepted Answer Pending Moderation
  1. Thursday, 6 December 2018 14:04 PM UTC
  2. PowerBuilder
  3. # 3

i am now trying to use the HTTPCLIENT

something i am not doing right 

 

lo_xml_request = '' + &
   '' + &
   '' + &
      '' + &
         '' + &
         '0' + &
         '' + &
         '5053' + &
         '' + &
         '0' + &
         '' + &
         '[Aquí Psw]' + &
         '' + &
         '20.000.000A' + &
         '' + &
         '1' + &
         '' + &
        ' MARCELO_CLEMOTTE2_5053' + &
      '
' + &
   '
' + &
'
'

lo_client = Create httpClient
lo_client.SecureProtocol = SECURE_PROTOCOL_TLS12
lo_client.SetRequestHeader("Content-Type", "text/xml; charset=utf-8")
lo_client.SetRequestHeader("SOAPAction", ls_soap_action)
lo_client.SetRequestHeader("Content-Length", string(len(lo_xml_request)))
li_ret = lo_client.PostDataStart(ls_url)
if li_ret = 1 then
 li_ret = lo_client.PostData(string(lo_xml_request), 1024)
else
 messagebox("RET1",li_ret)
end if
messagebox("RET",li_ret)
Comment
  1. David Peace (Powersoft)
  2. Friday, 7 December 2018 10:39 AM UTC
Hi

Your XML request is not XML data. This should be a formatted XML message with opening and closing tags.



Regards

David
  1. Helpful
  1. Andres Slachevsky
  2. Friday, 7 December 2018 11:00 AM UTC
I receive this example from the WS developer











0



5053



0



[Aquí Psw]



20.000.000A



1



MARCELO_CLEMOTTE2_5053









they say it is working in other plataform but if i put is as the request i have the -1

Any way to have more information on the error?
  1. Helpful
  1. David Peace (Powersoft)
  2. Friday, 7 December 2018 15:50 PM UTC
This site does not show XML tags, cannot see what you have posted....

Sorry
  1. Helpful
There are no comments made yet.
Andres Slachevsky Accepted Answer Pending Moderation
  1. Friday, 7 December 2018 11:53 AM UTC
  2. PowerBuilder
  3. # 4
I am trying this now.
but the same error
is any place i can find a example
the examples in the documentation are all calling REST 
 
lo_xml_request =        '' + &
         '0' + &
         '5053' + &
         '0' + &
         '[Aquí Psw]' + &
         '20.000.000A' + &
         '1' + &
        ' MARCELO_CLEMOTTE2_5053' + &
      '
' //+ &
lo_client = Create httpClient
lo_client.SetRequestHeader("Content-Type", "text/xml; charset=utf-8")
lo_client.SetRequestHeader("SOAPAction", ls_soap_action)
lo_client.SetRequestHeader("Content-Length", string(len(lo_xml_request)))
lo_client.setrequestheader( "xmlns:soapenv", "http://schemas.xmlsoap.org/soap/envelope/")
lo_client.setrequestheader( "xmlns:tem", "http://tempuri.org/")
li_ret = lo_client.PostDataStart(ls_url)
if li_ret = 1 then
 li_ret = lo_client.PostData(string(lo_xml_request), 1024)
else
 messagebox("RET1",li_ret)
end if
messagebox("RET",li_ret)
Comment
There are no comments made yet.
Kevin Ridley Accepted Answer Pending Moderation
  1. Friday, 7 December 2018 12:43 PM UTC
  2. PowerBuilder
  3. # 5

For starters, your URL is wrong.  You don't ever want to call the service with "?wsdl" at the end.  That's just the location of the wsdl.  I'd also suggest using Fiddler to trap the actual request that gets sent and the full response.  Sometimes you get a better error message from Fiddler.  You said you were in touch with the ws developer, right?  Ask him to send you a request that works so you can compare it to yours.  you may also want to try SoapUI, as Chris did to at least get a good request (using Fiddler) and compare it to yours.

Comment
  1. Kevin Ridley
  2. Friday, 7 December 2018 12:48 PM UTC
Also ask the ws developer if they have a REST version of the service. You may have more luck with that.
  1. Helpful
  1. Andres Slachevsky
  2. Friday, 7 December 2018 13:43 PM UTC
Hello Kevin

Thanks for the tips

i used the same request they use in other tools and remove the ?wsdl

but it remains i will request to install Fiddler on my machine in order to verify

  1. Helpful
There are no comments made yet.
Juan Alejandro Lam López Accepted Answer Pending Moderation
  1. Friday, 7 December 2018 15:37 PM UTC
  2. PowerBuilder
  3. # 6
Hello,

Please check the source code that I am sending you, it would be very helpful if you could help with more data to test the wsdl.

Regards

Juan Alejandro Lam
Attachments (1)
Comment
  1. Andres Slachevsky
  2. Monday, 10 December 2018 11:53 AM UTC
Hola Juan,

Puede ser algún problema con la version del .NET framework?

veo que cuando compilas el proxy el return te sale como blob y en mi caso sale como byte[]

  1. Helpful
  1. Juan Alejandro Lam López
  2. Monday, 10 December 2018 23:10 PM UTC
Eso es porque hice el export y he realizado el cambio de forma manual después hice el import nuevamente, pero prueba si te funciona, porque podría ser esa la solución, en todo caso si tienes parámetros de prueba que ayuden a probar el WebService podría ser mas útil para ayudarte.
  1. Helpful
There are no comments made yet.
Andres Slachevsky Accepted Answer Pending Moderation
  1. Tuesday, 11 December 2018 11:32 AM UTC
  2. PowerBuilder
  3. # 7

Thanks to all,

this code seems to be working 

Constant Integer SECURE_PROTOCOL_TLS12 = 5
integer li_ret , i
String lo_xml_request
string ls_url
string ls_soap_action
string arguments[]
string ls_body
string ls_ret

arguments[1] = "0"
arguments[2] = "false"
arguments[3] = "5053"
arguments[4] = "true"
arguments[5] = "0"
arguments[6] = "false"
arguments[7] = "'pass'"
arguments[8] = "20.000.000A"
arguments[9] = "1"
arguments[10] = "MARCELO_CLEMOTTE2_5053"
ls_url ="http://efxpywsdev.informconf.com.py/Services/PDFServicePriv.svc"
ls_soap_action ="http://tempuri.org/IPDFServicePriv/ReportePersona"
lo_xml_request = '' + &
'' + &
'0' + &
'5053' + &
'0' + &
'[Aquí Psw]' + &
'20.000.000A' + &
'1' + &
' MARCELO_CLEMOTTE2_5053' + &
'
' + &
'
'

lo_client = Create httpClient
lo_client.SetRequestHeader("Content-Type", "text/xml; charset=utf-8")
lo_client.SetRequestHeader("SOAPAction", ls_soap_action)
lo_client.SetRequestHeader("Content-Length",string(len(lo_xml_request)*2))
li_ret = lo_client.PostDataStart(ls_url)
messagebox("RET - Start",li_ret)
if li_ret <0 then return
if li_ret = 1 then
messagebox("DATA",lo_xml_request)
li_ret = lo_client.PostData(lo_xml_request,len(lo_xml_request)* 2 )
messagebox("RET - PostData",li_ret)
end if
if li_ret <0 then return
li_ret = lo_client.postdataend()
 
now i need to get the response data 
correct me if i am wrong i must use:

GetResponseBody

or 

ReadData?

Comment
  1. David Peace (Powersoft)
  2. Wednesday, 12 December 2018 17:00 PM UTC
Remind me what you are expecting to get back? Is it a PDF file?



Technically you can use either depending on the response size. If you use Read Data in a loop you can get 1024 byte chunks and write them to disk to reconstruct your PDF file.



Glad I was able to help point you in the right direction and well done for getting the request working.



Cheers

David
  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.