P
Peter van der veen
Hi
I have the following problem.
I'm calling a webservice from within a VB.net 2005 Windows program.
For this i got a WSDL file and loaded that in VB.
Until now i just call the webservice and everything works OK.
Now i need to add an extra attribute/header element to the SOAP header
before i contact the webservice.
The webservice needs this to be in the SOAP header.
Where and how do i do this? I have no clue at all.
From the company that runs the webservice i got an example code in
Java, but i have no idea where this had to be placed.
Hope that soemone can help me or can direct me in a direction to find
a solution
JAVA Code:
// Construct the header
QName headerName = new QName(" http://ech.client.nl/vendor",
"Vendor");
SOAPHeaderElement headerElement = new SOAPHeaderElement(headerName);
headerElement.setValue("ECH Gui");
headerElement.setMustUnderstand(true);
try {
Message message = arg0.getCurrentMessage();
message.getSOAPHeader().addChildElement(headerElement);
} catch (SOAPException se) {
logger.error("Kan niet SOAP header 'Vendor' toevoegen", se);
}
I have the following problem.
I'm calling a webservice from within a VB.net 2005 Windows program.
For this i got a WSDL file and loaded that in VB.
Until now i just call the webservice and everything works OK.
Now i need to add an extra attribute/header element to the SOAP header
before i contact the webservice.
The webservice needs this to be in the SOAP header.
Where and how do i do this? I have no clue at all.
From the company that runs the webservice i got an example code in
Java, but i have no idea where this had to be placed.
Hope that soemone can help me or can direct me in a direction to find
a solution
JAVA Code:
// Construct the header
QName headerName = new QName(" http://ech.client.nl/vendor",
"Vendor");
SOAPHeaderElement headerElement = new SOAPHeaderElement(headerName);
headerElement.setValue("ECH Gui");
headerElement.setMustUnderstand(true);
try {
Message message = arg0.getCurrentMessage();
message.getSOAPHeader().addChildElement(headerElement);
} catch (SOAPException se) {
logger.error("Kan niet SOAP header 'Vendor' toevoegen", se);
}