Question Consuming WebService

frutuopa

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

I try with add a service reference from wsdl... https://iop.sime-usy-cloud.com/usy-s...000100/ws.wsdl (You need to build a WSDL file on the local PC and then call it when adding the servicereference)
afther this, with my object WSRENRIME1, i have an error in the last line :
'System.ServiceModel.FaultException: 'WebService Request is missing user certificate.'

I have no reason to distrust the certificate I provide in the code...

Can you help?

Thanks

Dim certificate As X509Certificate2 = New X509Certificate2("D:\PF\Funfrap\REN_SIME\FUNFRAP.cer", "", X509KeyStorageFlags.Exportable)


Dim wsRequest As New WSRENRIME1.requestRequest




Dim wsSopRimeRequestMessageType As New WSRENRIME1.RequestMessageType
Dim wsSopRimeHeaderType As New WSRENRIME1.HeaderType
Dim wsSopRimeRequestType As New WSRENRIME1.RequestType
Dim wsSopRimePayloadType As New WSRENRIME1.PayloadType


'Certificate
Dim myClient As New WSRENRIME1.port_TFEDI_typeClient
Dim myRequest As New WSRENRIME1.RequestMessageType
Dim myResponse As New WSRENRIME1.requestResponse

Dim mypayload As New WSRENRIME1.PayloadTypeID
'mypayload.Value = "teste"
'wsSopRimePayloadType.Items(1) = mypayload

Dim binding As New WSHttpBinding
binding.Security.Message.ClientCredentialType = MessageCredentialType.Certificate
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate
myClient.ClientCredentials.ClientCertificate.Certificate = certificate

'Header
wsSopRimeHeaderType.Verb = 1 ' "create"
wsSopRimeHeaderType.Noun = "ReserveBid_MarketDocument"
wsSopRimeHeaderType.Context = "PRODUCTION"
wsSopRimeHeaderType.AckRequired = True

'Payload ???????????????????



myRequest.Request = wsSopRimeRequestType
myRequest.Header = wsSopRimeHeaderType
myRequest.Payload = wsSopRimePayloadType


'Finally call the request
myResponse.ResponseMessage = myClient.request(myRequest)
 
Back
Top