Please could comeone tell me how to programatically read the input
message parts for a web service operation.
I have a web service that has many operations. One of these operations
(for example "operation1") has 2 input parameters, but I want to be
able to retrieve these dynamically without the need to hard-code each
parameter into my code.
In VB6, I use the following extract of code (SOAP Toolkit 3):
Dim WSDLReader As New WSDLReader30
Dim ServiceEnumerator As IEnumWSDLService, Service As IWSDLService
Dim PortEnumerator As IEnumWSDLPorts, Port As IWSDLPort
Dim OperationEnumerator As IEnumWSDLOperations, Operation As
IWSDLOperation
Dim MapperEnumerator As IEnumSoapMappers, Mapper As ISoapMapper
WSDLReader.Load wsdlFile, ""
WSDLReader.GetSoapServices ServiceEnumerator
... ...
Service.GetSoapPorts PortEnumerator
... ...
OperationEnumerator.Find aOperation(1), Operation
... ...
If Not Operation Is Nothing Then
' prepare request
Set MapperEnumerator = Operation.InputMessage.MessageParts
'read the required inputs for the operation from the wsdl (i.e. see
soap service params)
MapperEnumerator.Next 1, Mapper, Fetched 'set mapper object to
hold each line of the XML
Do While Fetched = 1
... ...
Loop
End If
The line: Set MapperEnumerator = Operation.InputMessage.MessageParts
allocates the input message parts for the operations to the
MapperEnumerator object. Is there an equivalent way of doing this in
VB.NET. I cannot use SOAP Tioolkit 3 as the solution is for Wndows
2003 (not recommended on this O/S).
I have had a look at the Operation class in .NET but cannot determine
or find a sample using this that demonstrates my need. Many thanks.
Jimmy
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/migrsoapwebserv.asp
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
<jimmyf...@yahoo.co.uk> wrote in message
news:1138722747....@z14g2000cwz.googlegroups.com...