You need to sign in to do that
Don't have an account?
laxmi
laxmi
Writing webservice for generated wsdl2apex code
Hi all,Thanks
This is the code which is generated from the wsdl2apex, how to write webservice for
this code, please help me out.
public class dbappsMywebservice1WsdlTypes {
public class placeOrderElement_element {
public Integer pProductId;
public Integer pCustomerId;
public Integer pQuantity;
private String[] pProductId_type_info = new String[]{'pProductId','http://www.w3.org/2001/XMLSchema','int','1','1','true'};
private String[] pCustomerId_type_info = new String[]{'pCustomerId','http://www.w3.org/2001/XMLSchema','int','1','1','true'};
private String[] pQuantity_type_info = new String[]{'pQuantity','http://www.w3.org/2001/XMLSchema','int','1','1','true'};
private String[] apex_schema_type_info = new String[]{'http://dbapps/MyWebService1.wsdl/types/','true'};
private String[] field_order_type_info = new String[]{'pProductId','pCustomerId','pQuantity'};
public String endpoint_x = 'http://www.example.com/webservice.asmx';
}
public class placeOrderResponseElement_element {
public String result;
private String[] result_type_info = new String[]{'result','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
private String[] apex_schema_type_info = new String[]{'http://dbapps/MyWebService1.wsdl/types/','true'};
private String[] field_order_type_info = new String[]{'result'};
}
}
public class dbappsMywebservice1Wsdl {
public class MyWebService1SoapHttpPort {
public String endpoint_x = 'http://192.168.200.78:8888/PLSQLWEB-AppsWS-context-root/MyWebService1SoapHttpPort';
private String[] ns_map_type_info = new String[]{'http://dbapps/MyWebService1.wsdl/types/', 'dbappsMywebservice1WsdlTypes', 'http://dbapps/MyWebService1.wsdl', 'dbappsMywebservice1Wsdl'};
public String placeOrder(Integer pProductId,Integer pCustomerId,Integer pQuantity) {
dbappsMywebservice1WsdlTypes.placeOrderElement_element request_x = new dbappsMywebservice1WsdlTypes.placeOrderElement_element();
dbappsMywebservice1WsdlTypes.placeOrderResponseElement_element response_x;
request_x.pProductId = pProductId;
request_x.pCustomerId = pCustomerId;
request_x.pQuantity = pQuantity;
Map<String, dbappsMywebservice1WsdlTypes.placeOrderResponseElement_element> response_map_x = new Map<String, dbappsMywebservice1WsdlTypes.placeOrderResponseElement_element>();
response_map_x.put('response_x', response_x);
WebServiceCallout.invoke(
this,
request_x,
response_map_x,
new String[]{endpoint_x,
'http://dbapps/MyWebService1.wsdl/placeOrder',
'http://dbapps/MyWebService1.wsdl/types/',
'placeOrderElement',
'http://dbapps/MyWebService1.wsdl/types/',
'placeOrderResponseElement',
'dbappsMywebservice1WsdlTypes.placeOrderResponseElement_element'}
);
response_x = response_map_x.get('response_x');
return response_x.result;
}
}
}
laxmi
cheenath
Code to invoke the external service looks like: