2

I know this has been asked before but I cannot seem to find my exact issue, or a solution that works for me.

I have a SOAP server that can accept documents pushed from one client to another. This works just fine with smaller documents, but when you get to around the 10MB range the following fault is received:

Fault: Array
(
    [faultcode] => SOAP-ENV:Client
    [faultactor] => 
    [faultstring] => error in msg parsing:
XML error parsing SOAP payload on line 1: No memory
    [detail] => 
)

The XML is exactly the same for both the successful SOAP call and the one that results in the above fault, other than the base64 of the documents.

I have a 512MB size limit on the server, and a 1200 second time limit.

I have full access to the server and code. Any suggestions are appreciated.

James
  • 3,765
  • 4
  • 48
  • 79

2 Answers2

1

Such an error-message you get from the NuSoap library:

XML error parsing SOAP payload on line 1: No memory

Are actually from the XML Parser Functions in PHP (as NuSOAP uses this PHP library for XML parsing).

That means if you increase the PHP memory limit you should have a good chance to improve here.

hakre
  • 193,403
  • 52
  • 435
  • 836
  • As my memory limit is 256MB, should it be that this should be an issue for a 10MB file? As in, could that still be an issue? I'm wondering if there is an issue with the amount of RAM in the server itself at this point. I'm using an Amazon server with only 512MB or so RAM. I'm using the same server to place the request to the SOAP server that the SOAP server is running on. Could this possibly be an actual issue where the server itself does not have enough RAM? I was going to set up another Amazon server with more RAM to test this theory... – James Mar 26 '15 at 17:26
  • All I can say to you is that for the document you want to parse via *that* XML parser, the parser gives you a no memory error. You would have to try with the memory limit. Set it to the maximum possible and try again. Just do it for a test. It must not mean the memory limit in PHP alone can solve this. It might be also an issue with the overall memory of the server as the extension probably isn't even programmed that it respects the PHP memory limit setting. – hakre Mar 26 '15 at 17:31
  • You could also consider to provide the XML document in question. – hakre Mar 26 '15 at 17:31
  • Thanks, I'll test this and provide the XML if it still doesn't work. – James Mar 26 '15 at 18:12
  • I ended up setting this up on a server with 2GB of ram from Amazon as apposed to the 512MB of ram that the original demo server had. I set the memory limit to 1024MB but still get the exact same error. I'll post the XML. – James Mar 31 '15 at 08:48
  • My tip: Refactor your code so that you can replace the SOAP layer with a different one. Then try with a different SOAP implementation. – hakre Mar 31 '15 at 09:53
0

For anyone who arrives here later, the problem is indeed from the xml parser library, but increasing the memory won't help.

The stackoverflow post at xml_parse No memory error PHP has details on how to resolve it, I had to edit nusoap.php and change the line that had if (!xml_parse($this->parser,$xml,true)) { ... as per the linked post to make it work

Ben Holness
  • 2,457
  • 3
  • 28
  • 49