Good day. Can someone help me what I am doing wrong or what I am missing to consume a SOAP webservice. This is my code in PowerBuilder 2022.
string ls_url
string token_empresa
string token_password
ls_url ='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
token_empresa='yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'
token_password ='zzzzzzzzzzzzzzzzzzzzzzzzzzzz'
HttpClient lo_client
integer li_ret , i , li_StatusCode
String lo_xml_request
string ls_data
string ls_body
string ls_ret
ls_body='<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"> '+&
' <soapenv:Header/>'+&
' <soapenv:Body>'+&
' <tem:FoliosRestantes>'+&
' <!--Optional:-->'+&
' <tem:tokenEmpresa>'+token_empresa+'</tem:tokenEmpresa>'+&
' <!--Optional:-->'+&
' <tem:tokenPassword>'+token_password+'</tem:tokenPassword>'+&
' </tem:FoliosRestantes>'+&
' </soapenv:Body>'+&
'</soapenv:Envelope>'
lo_client = Create httpClient
lo_client.SetRequestHeader("Content-Type", "text/xml")
lo_client.sendrequest('POST',ls_url,ls_body)
li_StatusCode = lo_client.GetResponseStatusCode()
ls_ret = lo_client.GetResponseStatusText( )
li_ret = lo_client.getresponsebody( ls_data)
destroy lo_client
Lo ejecuto pero me da el siguiente error:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode xmlns:a="http://schemas.microsoft.com/ws/2005/05/addressing/none">a:ActionNotSupported</faultcode><faultstring xml:lang="en-US">The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).</faultstring></s:Fault></s:Body></s:Envelope>
What am I doing wrong? This is applying the examples and guide of appeon.
If I run a SOAP test in SOAPUI the Response is correct, but in Powerbuilder it doesn't work for me
Thanks for the help
Thank you. But the same code of the page in reference, is the same that I have in this post. But it doesn't work for me, it generates that error, but the webservice is correct because I try it in SOAPUI and it's fine.