You need to sign in to do that
Don't have an account?

Communicating with an Apex webservice
Hi,
I am trying to communicate with a webservice hosted in one of the sandbox Org.s using SOAPUI(desktop tool). This tool gives me the below request structure
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sl="http://soap.sforce.com/schemas/class/XXXXXXXXXXXXXXXX"> <soapenv:Header> <sl:AllowFieldTruncationHeader> <sl:allowFieldTruncation></sl:allowFieldTruncation> </sl:AllowFieldTruncationHeader> <sl:DebuggingHeader> <!--Zero or more repetitions:--> <sl:categories> <sl:category></sl:category> <sl:level></sl:level> </sl:categories> <sl:debugLevel></sl:debugLevel> </sl:DebuggingHeader> <sl:CallOptions> <sl:client></sl:client> </sl:CallOptions> <sl:SessionHeader> <sl:sessionId>XXXXXXXXXXX!AQgAQDClDsbFptrQ5zWifnhNyIf2WI4HwvF49kZbOUr7Y59MTSPnUZCuHUULR7T8gbIs239c9Df0yXg5PYsUl.ixIuRqA4ji</sl:sessionId> </sl:SessionHeader> </soapenv:Header> <soapenv:Body> <sl:updateAssetRecords> <!--Zero or more repetitions:--> <sl:Asset_Utilization> <!--Optional:--> <sl:Fusion_Id>12345</sl:Fusion_Id> <!--Optional:--> <sl:Product_SKU>12345</sl:Product_SKU> <!--Optional:--> <sl:UtilizationBucket1>12345</sl:UtilizationBucket1> <!--Optional:--> <sl:UtilizationBucket2>12345</sl:UtilizationBucket2> <!--Optional:--> <sl:UtilizationBucket3>12345</sl:UtilizationBucket3> <!--Optional:--> <sl:UtilizationBucket4>12345</sl:UtilizationBucket4> <!--Optional:--> <sl:UtilizationBucket5>12345</sl:UtilizationBucket5> <!--Optional:--> <sl:UtilizationBucket6>12345</sl:UtilizationBucket6> <!--Optional:--> <sl:UtilizationDescription>12345</sl:UtilizationDescription> </sl:Asset_Utilization> </sl:updateAssetRecords> </soapenv:Body> </soapenv:Envelope>
When I am submitting the above request it returns me the below response with Error message in it.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Client</faultcode>
<faultstring>'' is not valid for type xsd:boolean, should be '0', '1', 'true' or 'false'</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
Can someone please help me to resolve the error?
All Answers
Hi,
Looks like one of field from below code snippet is of Boolean data type in salesforce. Could you please cross check your salesforce org for this.
Let me know if you need detail information around this.
Regards,
Digamber Prasad
Hi,
Could you please share wsdl with me?
Regards,
Digamber Prasad
Thanks Simon. that worked. Also I was able to remove the unnecessary parameters from Request and it became successful. Thanks so much for pointing it out. So the actual requst that worked is below. This presses on the importance of checking the SOAP header before sending request.
As simon also indicated that we can remove unnecessary or optional :) tags from soap header. I removed all of them except sessionId and it worked... :)
If any one wants to why some parts of the XML above are masked with XXXXXXX, the first masking in xmlns:sl url is my webservice class name and the second masking with XXXXXXXXXXXX is my Org.Id.