I'm new to using Web Services and I've been struggling a bit with the following problem.
I was given a WSDL from an external provider for the use of their webservice. I´m using VB.NET and have already added the web reference to the project. With this I can now access the proxy class providing the method and structure in the WSDL. The problem is that the webservice requires a header, but it's not declared within the WSDL so I can't access any attributes of the header needed.
I've been reading quite a bit and it seems I must add manually the header data, but I don´t know how to do this using the proxy objects.
The header needs the following data
POST https://ipGoesHere:7070/ HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "urn:TimbradoCFD"
CUSTOMERKEY: 00000000000000
User-Agent: Jakarta Commons-HttpClient/3.1
Host: ipGoesHere:7070
Content-Length: 22165
The SOAP envelope needed must look something like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:new="http://new.webservice.namespace">
<soapenv:Header/>
<soapenv:Body>
<cfdi:Document xmlns:cfdi="http://something" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<cfdi:Concepts>
<cfdi:Concept quantity="1" Identifier="001" description="article"/>
</cfdi:Concepts>
</cfdi:Document>
</soapenv:Body>
</soapenv:Envelope>
I don't know if I'm going about this correctly or if someone knows how I can implement this header in combination with the proxy objects.