WinHTTP in Stored Proc

  • parse you @post and replace the double quotes with "

    e.g.

    DECLARE @var VARCHAR(50)

    SET

    @var = 'My "Test"'

    SELECT

    @var = REPLACE(@var,'"','"')

    SELECT

    @var


    Everything you can imagine is real.

  • Thank you for the reply!

    I did try this, along with several other special character encoding.  It does not seem to send the data as expected since the POST returns 0 results.  Seems like it does not translate once it has been sent, so the POST itself does not see any double-quote, just '"' for instance.

    I've run into several articles referencing bugs within WinHTTP, though this process seems straight forward.  I'm not doing anything special, just trying to send the double-quote.

    The double-quote is necessary since the POST serves as a stepping-stone process for communicating with our mainframe which requires double-quotes as delimiters.

    Here is the exact error if I send the double-quote:

    Error [-2147211445], While [Send('str1"str2"str3"str4"num1"num2"num3')], Source [ODSOLE Extended Procedure], Description [Traversal string: The '"' delimiter is allowed only in a parameter list.]

     

    EDITED:

    When I encode with " " ", I receive the following error.  It looks like it is encoding it properly, but I don't understand why it's finding an unclosed "(" delimiter.

    Error [-2147211431], While [Send('str1"str2"str3"str4"num1"num2"num3')], Source [ODSOLE Extended Procedure], Description [Traversal string: A '(' delimiter was found with no matching ')'.]

  • what happens if you don't include the double qoutes on your send thingy i.e.

    SET  @proc = 'Send(' + @post + ')'

    with an encoded @post as per my earlier example


    Everything you can imagine is real.

  • It does not appear to send the data out.  I am going to run through a different approach to see what happens.  I appreciate the help!

  • If you are still watching this - did you ever solve it, and if so, what did you do?

  • FYI - for anyone else coming across this - do not try to replace the " as mentioned above - the object does all xml parsing and that causes other issues.

    Instead - replace any double quotes with single quotes - and the data will be parsed just fine in the object.

    Thank you - that is all - have a great day.

Viewing 6 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply