• Flair Liu
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies

Hi,

 

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="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <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="http://schemas.xmlsoap.org/soap/envelope/" xmlns:qdd="http://qddynamicqandaservice/" xmlns:ccl="http://www.cdecisions.com/cclaimsrulesservice"> <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 (= http://www.cdecisions.com/cclaimsrulesservice).

 

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: http://community.salesforce.com/sforce/board/message?board.id=apex&message.id=4679

 

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,

 

Demi 

Message Edited by Demint on 12-16-2009 02:13 AM
  • December 15, 2009
  • Like
  • 0