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
LosintikfosLosintikfos 

Callbacks

hi experts,

Do anyone know how i can ultilize call back inside below code to return success from my web services: I am getting error Remote server did not return any
content: System.CallbackException



global class APiNorthstar {

WebService static boolean addAccount(string AccA, String name){

comNorthstarApi.NorthstarServiceHttpSoap11Endpoint stub = new
comNorthstarApi.NorthstarServiceHttpSoap11Endpoint();

String createAcc = stub.createAcc(name, AccA);

return true;
}
}

JAVASCRIPT

{!REQUIRESCRIPT("/soap/ajax/10.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/10.0/apex.js")} 
{!REQUIRESCRIPT("/soap/ajax/10.0/functions")} 
sforce.debug.trace = true; 
try 
{ 
var con = confirm("Are you sure you want to create Northstar account for this Client?") 
if (con) 
var name = "{!Account.Account_Alias__c}"; 
var AccA = "{!Account.Name}"; 
var action = sforce.apex.execute("APiNorthstar","addAccount", {AccA: AccA, name: name}); 
alert(action); 
} 
catch (ex) 
{ 
alert ("Failed : " + ex); 
}



Message Edited by Losintikfos on 08-04-2008 05:55 AM
SuperfellSuperfell
This is an error from the apex callout attempt. Have you looked at your servers logs? did it get the request, what response do you think it sent? etc.
LosintikfosLosintikfos
I am getting trace:


20080804164242.579:Class.comNorthstarApi.NorthstarServiceHttpSoap11Endpoint.createAcc: line 165, column 13:     Created Web Service callout to endpoint: http://XXXXXXXXXXXXXXXXX/axis2/services/NorthstarService.NorthstarServiceHttpSoap11Endpoint
20080804164242.579:Class.comNorthstarApi.NorthstarServiceHttpSoap11Endpoint.createAcc: line 165, column 13: Sending callout request
20080804164242.579:Class.comNorthstarApi.NorthstarServiceHttpSoap11Endpoint.createAcc: line 165, column 13: Reading callout response
System.CalloutException: Web service callout failed: Unexpected element. Parser was expecting element 'http://com.northstar.api:createAccResponse' but found 'http://org.apache.axis2/xsd:createAccResponse'

Class.comNorthstarApi.NorthstarServiceHttpSoap11Endpoint.createAcc: line 165, column 13
Class.APiNorthstar.addAccount: line 21, column 36


Cumulative resource usage:

Resource usage for namespace: (default)
Number of SOQL queries: 0 out of 100
Number of query rows: 0 out of 10000
Number of SOSL queries: 0 out of 20
Number of DML statements: 0 out of 100
Number of DML rows: 0 out of 10000
Number of script statements: 26 out of 200000
Maximum heap size: 0 out of 1000000
Number of callouts: 1 out of 10
Number of Email Invocations: 0 out of 10
Number of fields describes: 0 out of 10
Number of record type describes: 0 out of 10
Number of child relationships describes: 0 out of 10
Number of picklist describes: 0 out of 10
Number of future calls: 0 out of 10

Total email recipients queued to be sent : 0
Stack frame variables and sizes:
Frame0




Message Edited by Losintikfos on 08-04-2008 10:07 AM
SuperfellSuperfell
Well, there you go

"System.CalloutException: Web service callout failed: Unexpected element. Parser was expecting element 'http://com.northstar.api:createAccResponse' but found 'http://org.apache.axis2/xsd:createAccResponse'"

The Web Service you're calling is returning a response that doesn't match the WSDL.

Cheers
Simon
LosintikfosLosintikfos
Cheers Simon!


I have been able to trace the issue base on your advice!
kvinkvin

How did u resolve this ... Can you please explain the solution.. thank you