Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code> Dim content As blah.Content = New blah.Content Dim inputguid As String = Guid.NewGuid.ToString Dim service As blah.WebService = New blah.WebService Dim str As New System.Xml.XmlDocument Dim payload As blah.Payload = New blah.Payload 'payload str.LoadXml(xmlstr) 'manifest service.payloadManifest = New blah.PayloadManifest service.payloadManifest.manifest = New blah.Manifest() {New blah.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" payload.content = New blah.Content() {content} ReDim Preserve payload.content(0) payload.content(0).Any = str.DocumentElement payload.content(0).id = "Content0" service.ProcessMessage(payload) </code></pre> <p>noticed i've removed the WSE coding:-</p> <p>within the web reference reference.vb i've added the following code in the pcublic sub new - </p> <pre><code> Dim policy As New Policy() policy.Assertions.Add(New MyAssertion()) Me.SetPolicy(policy) </code></pre> <p>and then</p> <pre><code>Public Class MyPolicy Inherits SoapFilter Public Overrides Function ProcessMessage(ByVal envelope As SoapEnvelope) As SoapFilterResult 'creating the &lt;wsse:Security&gt; element in the outgoing message Dim securityNode As XmlNode = envelope.CreateNode(XmlNodeType.Element, "wsse:Security", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd") Dim securityAttr As XmlAttribute = envelope.CreateAttribute("soap:mustunderstand") securityAttr.Value = "1" 'creating the &lt;wsse:usernameToken&gt; element Dim usernameTokenNode As XmlNode = envelope.CreateNode(XmlNodeType.Element, "wsse:UsernameToken", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd") Dim userElement As XmlElement = usernameTokenNode userElement.SetAttribute("xmlns:wsu", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd") 'creating the &lt;wsse:Username&gt; element Dim userNameNode As XmlNode = envelope.CreateNode(XmlNodeType.Element, "wsse:Username", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd") userNameNode.InnerXml = "username" 'creating the &lt;wsse:password&gt; element Dim pwdNode As XmlNode = envelope.CreateNode(XmlNodeType.Element, "wsse:Password", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd") Dim pwdElement As XmlElement = pwdNode pwdElement.SetAttribute("Type", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText") pwdNode.InnerXml = "password" usernameTokenNode.AppendChild(userNameNode) usernameTokenNode.AppendChild(pwdNode) securityNode.AppendChild(usernameTokenNode) envelope.ImportNode(securityNode, True) Dim node As XmlNode = envelope.Header node.AppendChild(securityNode) Dim actionnode As XmlNode = envelope.Header("wsa:Action") envelope.Header.RemoveChild(actionnode) Dim messageNode As XmlNode = envelope.Header("wsa:MessageID") envelope.Header.RemoveChild(messageNode) Dim replyToNode As XmlNode = envelope.Header("wsa:ReplyTo") envelope.Header.RemoveChild(replyToNode) Dim toNode As XmlNode = envelope.Header("wsa:To") envelope.Header.RemoveChild(toNode) Return SoapFilterResult.[Continue] End Function End Class Public Class MyAssertion Inherits PolicyAssertion Public Overrides Function CreateClientInputFilter(ByVal context As FilterCreationContext) As SoapFilter Return Nothing End Function Public Overrides Function CreateClientOutputFilter(ByVal context As FilterCreationContext) As SoapFilter Return New MyPolicy() End Function Public Overrides Function CreateServiceInputFilter(ByVal context As FilterCreationContext) As SoapFilter Return Nothing End Function Public Overrides Function CreateServiceOutputFilter(ByVal context As FilterCreationContext) As SoapFilter Return Nothing End Function End Class </code></pre> <p>Public Overrides Function ProcessMessage - overwrites the processmessage and lets me manually edit the envelope</p> <p>i needed to manually remove the elements i did not need and manually insert the elements Idid need:</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload