0

I have a problem with the response I get from the soap service.

  1. I set the "SetSslClientCertPfx" with invoke method:

     certificate name
     password
    
  2. I set the "SetRequestHeader" with invoke method:

     Content-Type
     text/xml; charset=UTF-8
    
  3. I set the "SetRequestHeader" with invoke method:

     SOAPAction
     urloftheaction
    
  4. Invoke method "PostXml":

     Server link
     blob with file content
     utf-8
    
  5. I check for errors with "get.LastErrorText"

  6. I get the response with "get.bodyStr"

For the result, I have a char(32000) field. I tried increasing this to 64000 characters but that way I get an empty result. I also tried to replace the char field with the blob. That also didn't work. It's like the method itself is limited to 32000 chars.

I read that for large results I should use "LastStringResult" but it only works for MySQL. Is there a solution to my problem?

MrShakila
  • 874
  • 1
  • 4
  • 19
HEki
  • 43
  • 6

1 Answers1

0

I'm assuming the content returned in the body of the HTTP response is XML? (or perhaps JSON?) In either case, the best thing to do is to avoid getting the returned content as a string. Let me explain...

For example, instead of calling response.GetBodyStr(), call response.GetBodyXml(xmlObj) (see https://www.chilkatsoft.com/refdoc/xChilkatHttpResponseRef.html#method4 )

The GetBodyXml method loads the response body into the XML object passed in the argument. Then your application can work with the contents of the XML via the Chilkat XML API, i.e parsing out the various parts as needed.

Chilkat Software
  • 1,405
  • 1
  • 9
  • 8
  • In general, it's good to avoid passing huge strings in/out of the COM boundary between the application and Chilkat. In most cases, if a method GetXyz exists to return a string which can be potentially huge, there are also GetXyzSb and GetXyzBd methods to return the string in a StringBuilder or BinData, and likewise there are methods to load a Chilkat object from a StringBuilder or BinData. Thus, you can keep the huge data on the Chilkat (native) side and never need to have it cross the COM boundary to the ActiveX.. – Chilkat Software Oct 20 '22 at 12:08
  • I will try and use response.GetBodyXml to see if it can accept more data and report back. Thank you. As far as it goes with the 2nd answer. I am not completely sure to what you are referring. I need to communicate with a web saop service. And that service can return xyz number of chars. It depends. I hope the GetBodyXml will solve my problem. – HEki Oct 22 '22 at 16:27
  • Hm, i have no BodyXML option. I got: Body, BodyQP, BodyStr – HEki Dec 20 '22 at 08:56