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
laxmilaxmi 

is this correct?

hi all,

is this correct? to call the external webservice

global class testSalesforce{
WebService static string test1(string arg)
{

dbappsMywebservice1Wsdl.MyWebService1SoapHttpPort stub =
new dbappsMywebservice1Wsdl.MyWebService1SoapHttpPort();

string result = stub.placeOrder(1, 2, 3);
return result;

}}


thanks
laxmi
DevAngelDevAngel
Hi laxmi,

So, you are trying to create a custom webservice that does a callout to a thirdparty web service, right?

Assuming that you have generated a "stub" called dbappsMywebservice1Wsdl.MyWebService1SoapHttpPort that has a method called placeOrder, then yes, it looks right.

If you are using the Force.com API, I would suggest using the Execute Anonymous view to do this kind of testing. It just complicates things to add another web service and client to the process.

In the IDE go to the Window menu and select Show View/Other and find the Execute Anonymous view in the Force.com section. You can then select the project that you want active and basically script the stuff that you have inside your custom webservice:

dbappsMywebservice1Wsdl.MyWebService1SoapHttpPort stub =
new dbappsMywebservice1Wsdl.MyWebService1SoapHttpPort();

string result = stub.placeOrder(1, 2, 3);
System.debug(result);


Cheers