sanshelly / wsdl2objc

Automatically exported from code.google.com/p/wsdl2objc
MIT License
0 stars 0 forks source link

SoapFault check is hardcoded to the namespace "soap" #40

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.  Return a soap fault with a namespace other that soap - like soapenv 
2.
3.

What is the expected output?
Expect to have a soap fault found.
What do you see instead?
The bodyParts of the response are empty.

What version of the product are you using? On what operating system?
.6 on the iPhone

Please provide any additional information below.
This is the same as Issue 27.  It was marked as fixed, but the code that 
detects the faults as it 
parses the response is still hardcoded to check that the namespace equals 
"soap" before it 
checks if the element name is "Fault".  We don't have control over the WSDL 
that is generated.  In 
the original issue that was closed, I had the following:

It checks the hardcoded value of "soap". For example:  in Binding_M.template

else if (   xmlStrEqual(bodyNode->ns->prefix, (const xmlChar *) "soap") &&      

                xmlStrEqual(bodyNode->name, (const xmlChar *) "Fault")) 
{
    SOAPFault *bodyObject = [SOAPFault deserializeNode:bodyNode]; ....
}

Could change
   (const xmlChar*)"soap"    
        to 
   cur->ns->prefix to get

else if (   xmlStrEqual(bodyNode->ns->prefix, cur->ns->prefix) &&               

                xmlStrEqual(bodyNode->name, (const xmlChar *) "Fault")) 
{
    SOAPFault *bodyObject = [SOAPFault deserializeNode:bodyNode]; ....
}

My Soap response with fault message and namespace of sopaenv:
 <?xml version='1.0' encoding='UTF-8'?> 
     <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">         
     <soapenv:Header/> 
     <soapenv:Body> 
         <soapenv:Fault>
             <faultcode>soapenv:Receiver</faultcode>
             <faultstring>Err fault occurred</faultstring> 
             <detail/> 
         </soapenv:Fault>
     </soapenv:Body> 
</soapenv:Envelope>

Original issue reported on code.google.com by mr.coo...@gmail.com on 8 Oct 2009 at 3:06

GoogleCodeExporter commented 8 years ago
Issue 27 was fixed awaiting QA. Now that QA failed, we can try again.
I committed a new fix as you suggested to r144.
Please let me know if r144 solves this problem (the earlier fix added support 
for SOAP 1.2 Faults).

Original comment by hasse...@gmail.com on 8 Oct 2009 at 3:29

GoogleCodeExporter commented 8 years ago
That worked great.  I apologize for not updating the previous issue that was 
already created.  I saw that the 
Issue was closed and that only I had it starred to get updates - so I didn't 
know if anyone would see the update.  
For some reason, I thought the original fix that you submitted fixed my issue, 
but I guess I was wrong.  Thanks 
for all your help - not only on this issue, but on the project as whole.

Original comment by mr.coo...@gmail.com on 8 Oct 2009 at 4:31

GoogleCodeExporter commented 8 years ago

Original comment by hasse...@gmail.com on 8 Oct 2009 at 5:09