How to Add an new SOAP header envelop to a SOAP header?

P

Peter van der veen

Hi

I have a problem in VB.net 2.0

We are using a third party webservice.
I have loaded the wsdl file and can access the functions the service
has.

Now this party wants that we add a SOAP header element named 'Vendor'
so that they can distinguis which vendor called the webservice.

How do i do that in VB?

I now just use the functions as they are exposed by the wsdl file
(added as a web reference).

The vendor only added some JAVA code as an example.

// 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("Can Not Add SOAP header
'Vendor'", se);
}

But how do i do this is VB so i can add the this to the SOAP messages
when calling tghe webservice?

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top