function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Web service callout seems to have missing namespace



I am stuck trying to integrate to an external web service using an Apex callout.


I have generated the classes using WSDL2Apex and am trapping the SOAP callout in Eclipse.  When I run it from Salesforce (via execute anonymous in Eclipse) it gives me this SOAP message (which returns an error along the line of 'Expression produces unexpected value: null.' from the web service provider):


<env:Envelope xmlns:env="" xmlns:xsd="" xmlns:xsi=""> <env:Header /> <env:Body> <m:dynamicQandA xmlns:m="http://qddynamicqandaservice/"> <arg0> <PolicyData policyExpiryDate="?" noClaimsDiscountStatus="?" lastRenewalDate="?" premiumPaidTodateStatus="?" levelOfCoverCode="?" nextRenewalDate="?" productCode="?" policyEffectiveDate="?" policyType="?" policyInceptionDate="?" terminationCode="?" reinsurerIndicator="?" /> <ManagementInformation executeFinish="?" lastRuleID="?" message="?" executeTime="?" executeStart="?" /> <Outcome nextQuestion="?" ruleState="?" outcomeMessage="?" rulesComplete="true" outcomeName="?" /> <Question> <QuestionName>Service Request Type</QuestionName> <AnswerDataType>String</AnswerDataType> <AnswerValue>Insurance Claim</AnswerValue> </Question> </arg0> </m:dynamicQandA> </env:Body> </env:Envelope>


HOWEVER when I run it from SOAP UI (a non-Salesforce tool that generates Webservice calls outs from WSDL) I get the following SOAP message (which works fine, no error msg):



<soapenv:Envelope xmlns:soapenv="" xmlns:qdd="http://qddynamicqandaservice/" xmlns:ccl=""> <soapenv:Header/> <soapenv:Body> <qdd:dynamicQandA> <!--Optional:--> <arg0> <ccl:PolicyData productCode="?" lastRenewalDate="?" levelOfCoverCode="?" nextRenewalDate="?" noClaimsDiscountStatus="?" policyEffectiveDate="?" policyExpiryDate="?" policyInceptionDate="?" policyType="?" premiumPaidTodateStatus="?" reinsurerIndicator="?" terminationCode="?"/> <ccl:ManagementInformation lastRuleID="?" executeTime="?" message="?" executeStart="?" executeFinish="?"/> <Outcome outcomeName="?" outcomeMessage="?" rulesComplete="?" ruleState="?" nextQuestion="?">?</Outcome> <!--Zero or more repetitions:--> <ccl:Question> <QuestionName>Service Request Type</QuestionName> <AnswerDataType>String</AnswerDataType> <AnswerValue>Insurance Claim</AnswerValue> </ccl:Question> </arg0> </qdd:dynamicQandA> </soapenv:Body> </soapenv:Envelope>


So it appears that Salesforce is not forming the SOAP message well - specifically it appears to be dropping the second namespace (=


I have tried hacking the generated classes from WSDL2Apex without much luck (although to be honest it has been mainly trial and error!).


My issue seems very similar to that discribed here:


However the answer to that one was that it is a SF bug that is now allegedly fixed??....  So I am at a loss!


Can anyone help?  Any advice on how I might fix (is it possible to fix by tweaking the generated WSDL2Apex Classes?)


Thanks in advance,



Message Edited by Demint on 12-16-2009 02:13 AM

Hi Has anyone had a chance to look at this?


Happy to post more info if required - just let me know what.


Really appreciate any help or ideas anyone has


 Thanks Demi


I'm seeing the same issue.  Were you able to get this resolved?





I am having this problem too.  Is there a work-around (short of using HTTPRequest)?


I think we finally figured this out...


In the WSDL generated by our web service, we had this snippet in the schema element:

<xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" ...>


Changing 'unqualified' to 'qualified' took care of things:

<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" ...>


Hope this helps,


Flair LiuFlair Liu
@rnavarette, I've done the same way as yours in my wsdl file. But I still have no namespace in the children elements...
Flair LiuFlair Liu
Does anyone have a solution about this?