I am working with a wsdl which is automatically adding extra elements into the xml. In order for it to comply with an external web service that do not use these elements. See the following image: http://img406.imageshack.us/img406/1307/differencese.png Left = Red elements need removed - Right = What i need it to output
i have attached the code that is creating my envelope and payload.
Dim content As myProxy.Content = New myProxy.Content
Dim inputguid As String = Guid.NewGuid.ToString
Dim service As myProxy.WebService = New myProxy.WebService
Dim str As New System.Xml.XmlDocument
Dim payload As myProxy.Payload = New myProxy.Payload
'payload
str.LoadXml(xmlstr)
'manifest
service.payloadManifest = New myProxy.PayloadManifest
service.payloadManifest.manifest = New myProxy.Manifest() {New myProxy.Manifest}
service.payloadManifest.manifest(0).element = "GetVehicleServiceHistory"
service.payloadManifest.manifest(0).namespaceURI = ""
service.payloadManifest.manifest(0).contentID = "Content0"
service.payloadManifest.manifest(0).version = "2.01"
service.SoapVersion = SoapProtocolVersion.Soap11
service.UserAgent = "Jakarta Commons-HttpClient/3.1"
Dim usertoken As New Microsoft.Web.Services3.Security.Tokens.UsernameToken("userid", "password", Microsoft.Web.Services3.Security.Tokens.PasswordOption.SendPlainText)
service.RequestSoapContext.Security.Tokens.Add(usertoken)
service.RequestSoapContext.Security.MustUnderstand = False
payload.content = New myProxy.Content() {content}
ReDim Preserve payload.content(0)
payload.content(0).Any = str.DocumentElement
payload.content(0).id = "Content0"
service.Url = "http://localhost:8080"
service.ProcessMessage(payload)
Any help would be much appreciated.
Michael
noticed i've removed the WSE coding:-
within the web reference reference.vb i've added the following code in the pcublic sub new -
and then
Public Overrides Function ProcessMessage - overwrites the processmessage and lets me manually edit the envelope
i needed to manually remove the elements i did not need and manually insert the elements Idid need: