Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Warning about "WS-I Basic Profile compliant" WDSLs


Alert
titleOFBiz does not generate "WS-I Basic Profile compliant" WDSLs
typeWarning

OFBiz does not generate "WS-I Basic Profile compliant" WDSLs. If using Apache CXF at the consumer endpoint is an option for you have a look at

Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyOFBIZ-4245

1. About OFBiz and Liferay

...

Now you can view the wsdl file of the servie servicee by navigating to the service engine tools application again and now click on the service name and you can see “Export wsdl” next to the service name . Click on it will display the wsdl definition.

Also you need to get the SOAP link as it is given as end point to the java client to call the web service from outside application.

So the link is usualy available under:

http://your_hostname/webtools/control/SOAPService

...

Now create the service java file and add the webservice content to it.

Code Block

public String ServiceCall (String OrderId) {
	String output=null;
	String endpoint,inputParam, username, password;
	inputParam= OrderId;
	try{
		endpoint = "http://hostname:8080/webtools/control/SOAPService";
		username="admin";
		password="ofbiz";
		Call call = (Call) new Service().createCall();
		call.setTargetEndpointAddress(new URL (endpoint));
		call.setOperationName(new javax.xml.namespace.QName("getOrderStatus"));
		call.addParameter ("orderId", org.apache.axis.Constants.XSD_STRING,javax.xml.rpc.ParameterMode.IN);
		call.addParameter("login.username", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
		call.addParameter("login.password", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
		call.setReturnType(org.apache.axis.Constants.SOAP_STRING);
		Object response = call.invoke(new Object[]{inputParam,username,password});
		output = (String) response;
		try{
			System.out.println(output);
		}
		catch(Exception e){
			e.printStackTrace();
		}
	}catch(Exception e){
		e.printStackTrace();
	}
	return output;
}

...