Question Consuming WEBSERVICE

frutuopa

Member
Joined
Apr 4, 2022
Messages
6
Programming Experience
10+
Hello

Hello
A try consuming the ws

I add a service reference and i use the following code

Dim ws As New WSEGAR.GuiaAcompanhamentoWsClient


Dim wsArgOutput As New WSEGAR.consultarGuiaDetalheOutput
Dim wsArgInput As New WSEGAR.consultarGuiaInput
Dim identGuia As New WSEGAR.identificadorGuia

wsArgInput.tokenCertificacao = "88PfKOQmA7CdjBXj"
identGuia.numeroGuia = "PT20220324621342"
identGuia.codigoVerificacao = "62ca77d59d140430"
wsArgInput.idGuia = identGuia


wsArgOutput = ws.consultarGuiaDetalhe(wsArgInput)


1 - On app.config i add a header on endpoint tag

<endpoint address="http://qualsiliamb.apambiente.pt/services/egar/GuiaAcompanhamentoWs/v2" binding="basicHttpBinding" bindingConfiguration="GuiaAcompanhamentoImplServiceSoapBinding" contract="WSEGAR.GuiaAcompanhamentoWs" name="GuiaAcompanhamentoWsPort">
<headers>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-6CB8DA3F8A8B95CABD16486289621351">
<wsse:Username>MYUSERNAME</wsse:Username>
<wsse:password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">MYPWD</wsse:password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">sbc6emxNkMrdjI01XC/vAA==</wsse:Nonce>
<wsu:Created>2022-03-30T08:29:22.133Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</headers>
</endpoint>

2 - I installed Fiddler and I can intercept the XML, which is sent by the previous code .... If I put it in a Soap client (Soap UI), I can get the answer perfectly.
3 - I Create a SSL certificate

i have always the error "FAult Ocurring While processing"
I think it's an authentication problem.

Can you help me
Thanks
 
Back
Top