title: WebService Send SOAP request and received response using visual Basic
body: <p>My customer give me a WebService url = <a href="https://public-ws-stage.dpd.com/services/LoginService/V2_0" rel="nofollow noreferrer">https://public-ws-stage.dpd.com/services/LoginService/V2_0</a> , he told me that, if I send this xml text:</p>
  
  <p><a href="https://i.stack.imgur.com/PasuV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PasuV.png" alt="enter image description here"></a></p>
  
  <p>but, this is not right if I use this code :</p>
  
  <pre><code>Dim Request As WebRequest
  Dim Response As WebResponse
  Dim DataStream As Stream
  Dim Reader As StreamReader
  Dim SoapByte() As Byte
  Dim SoapStr As String
  Dim pSuccess As Boolean = True
  
  SoapStr = "&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;"
  SoapStr = SoapStr &amp; "&lt;soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/""&gt;"
  SoapStr = SoapStr &amp; "&lt;soapenv:Header/&gt;"
  SoapStr = SoapStr &amp; "&lt;soapenv:Body&gt;"
  SoapStr = SoapStr &amp; "&lt;ns:getAuth&gt; &lt;delisId&gt;id&lt;/delisId&gt; &lt;password&gt;pass&lt;/password&gt; &lt;messageLanguage&gt;de_DE&lt;/messageLanguage&gt; &lt;/ns:getAuth&gt;"
  SoapStr = SoapStr &amp; "&lt;/soapenv:Body&gt;"
  SoapStr = SoapStr &amp; "&lt;/soapenv:Envelope&gt;"
  
  Try
    SoapByte = System.Text.Encoding.UTF8.GetBytes(SoapStr)
  
    Request = WebRequest.Create("https://public-ws-stage.dpd.com/services/LoginService/V2_0/?wsdl")
    Request.Headers.Add("SOAPAction", "https://public-ws-stage.dpd.com/services/LoginService/V2_0/getAuth")
  
    Request.ContentType = "text/xml; charset=utf-8"
    Request.ContentLength = SoapByte.Length
    Request.Method = "POST"
  
    DataStream = Request.GetRequestStream()
    DataStream.Write(SoapByte, 0, SoapByte.Length)
    DataStream.Close()
  
    Response = Request.GetResponse()
    DataStream = Response.GetResponseStream()
    Reader = New StreamReader(DataStream)
    Dim SD2Request As String = Reader.ReadToEnd()
  
    DataStream.Close()
    Reader.Close()
    Response.Close()
  
  Catch ex As WebException
    MsgBox(ex.ToString())
  End Try
  </code></pre>
  
  <p>don't return what my customer told, I don't understant the url is not true, oder I write a wrong code, Please help me.</p>