none
request.getrequeststream () call giving me Timeout error RRS feed

  • Question

  • This my code for call SOAP message  but this code is giving me Timeout error . but I can see the result using soapUI of this SOAP .

    Please advise me

    How can I solve this or please tell me what ‘am doing wrong in this.

    I have attached the Screenshot image also

    Thanks in advance…

    Dimrequest AsWebRequest = WebRequest.Create("https://xxx.xxx.com/yyyyy/zzz.php")

       

    ' Set the Method property of the request to POST.


            request.Method = "POST"

       

    Dimencoder AsEncoding= NewUTF8Encoding(True, True)

       

    DimDRequest AsString= "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:cas='http://www.xxxxxxx.com/'>"_

                                     &

    "<soapenv:Header/>"& "<soapenv:Body>"& "<cas:DDirect>"& "<message>"& "<header>"_

                                     &

    "<msgType>GET_INFO</msgType><msgDate>2012-09-17T10:10:10</msgDate> </header>"_

                                     &

    "<GET_INFO>"& "<vendorID>XXXX</vendorID><userID>02761000000517</userID> <amount>20</amount>"_

                                     &

    "<currency>KWD</currency>"& "</GET_INFO><signature>"& "<sigType>MD5</sigType>"_

                                     &

    "<sigPath>/message/GET_INFO</sigPath><MD5>2e95dce3d0715297805507a59731665</MD5>"_

                                     &

    "</signature>"& "</message></cas:DDirect></soapenv:Body>"& "</soapenv:Envelope>"


       

    DimliveBytes AsByte() = System.Text.Encoding.UTF8.GetBytes(DRequest)

            request.ContentType = "text/xml;charset=UTF-8"

       

    ' Set the ContentLength property of the WebRequest.


            request.ContentLength = liveBytes.Length

       

    'request.TransferEncoding = "UTF8";


       

    ' Get the request stream.


           

    UsingdataStream AsStream = request.GetRequestStream()

                dataStream.Write(liveBytes, 0, liveBytes.Length)

                dataStream.Flush()

                dataStream.Close()

           

    EndUsing


       

    ' Get the response.


           

    Usingresponse AsWebResponse = request.GetResponse()

                Console.WriteLine(DirectCast(response, HttpWebResponse).StatusDescription)

       

    ' Get the stream containing content returned by the server.


               

    UsingresponseStream AsStream = response.GetResponseStream()

                   

    Usingreader AsNewStreamReader(responseStream)

       

    DimresponseFromServer AsString= reader.ReadToEnd()

       

    ' Display the content.


                        Console.WriteLine(responseFromServer)

                   

    EndUsing


              

    EndUsing

         

    EndUsing


    • Edited by Abhi Vikram Wednesday, April 17, 2013 9:46 PM
    • Moved by Youen Zen Friday, April 19, 2013 3:15 AM From Visual Basic
    Wednesday, April 17, 2013 12:40 PM

Answers

  • Can you press the copy to clipboard shortcut on the exception and paste into Notepad.  You can then post the results.  You also may want to use wireshark (or similar sniffer) to capture the internet datagrams to give futher details of the problem.

    jdweng

    Friday, April 19, 2013 11:01 AM

All replies

  • Hi Abhi,

    I'll move this thread to WCF forum which discuss System.Net issue.

    Thanks,


    Shanks Zen
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, April 19, 2013 3:14 AM
  • Can you press the copy to clipboard shortcut on the exception and paste into Notepad.  You can then post the results.  You also may want to use wireshark (or similar sniffer) to capture the internet datagrams to give futher details of the problem.

    jdweng

    Friday, April 19, 2013 11:01 AM