I would like OrgA to consume the Partner WSDL and connect to OrgB. OrgA should then be able to create a list of records (i.e. Cases) in OrgB. I read some of the related posts including this one but the proposed solution of using REST is problematic because OrgB doesn't have the REST Composite Tree Pilot enabled so I'd have to make multiple callouts to build my list of cases. I also read a suggestion the FuseIT WSDL2Apex Tool might be helpful, in resolving the Salesforce.com AnyType DataType issue during the class generation process, and I was wondering if anyone might have seen instructions for its usage.
Having generated the stubs in OrgA (using the FuseIT Apex generator service) I attempted to do a describeGlobal() call after successful Login() and got the following error message:
System.CalloutException: Web service callout failed: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found 'http://www.w3.org/1999/xhtml:html'
The code snip for performing the DescribeGlobal call is listed below (the above error is thrown on the last line of code below:)
sp.endpoint_x = instance_url;
partnerSessionHeader.sessionId = loginResult.sessionId;
// The Web services have a maximum timeout of 2 minutes. The timeout value
// is in milliseconds.
sp.timeout_x = 120000;
sp.SessionHeader = partnerSessionHeader;
// Get the DescribeGlobal mapping.
describeGlobalResult = sp.DescribeGlobal();