Access to add and change pages is restricted. See:

This page documents how to export a service using SOAP. This is relevant only since revision 892712

Note: I have been able to make successful calls using client code generated from the WSDL in java, but not from C# nor flex 3/actionscript 3 so far (see

As I have not been able to make a call using generated client code, I have gone for the dynamically generated client using AXIOM. To find out about AXIOM, I read Chapter 3 and Chapter 9 from, however, there are probably free tutorials available online.

UPDATE: since r896347, I am now able to use jax-ws (in Netbeans) to generate the client code to connect to ofbiz. See for example code.

Step 1: export service

In the service definition, set the flag export="true", for example the findPartiesById service:

<service name="findPartiesById" engine="java" auth="true"
 location="" invoke="findPartyById" export="true">
 <description>Find the partyId corresponding to a reference and a reference type</description>
 <attribute type="String" mode="IN" name="idToFind" optional="false"/>
 <attribute type="String" mode="IN" name="partyIdentificationTypeId" optional="true"/>
 <attribute type="String" mode="IN" name="searchPartyFirst" optional="true"/>
 <attribute type="String" mode="IN" name="searchAllId" optional="true"/>
 <attribute type="org.ofbiz.entity.GenericValue" mode="OUT" name="party" optional="true"/>
 <attribute type="List" mode="OUT" name="partiesFound" optional="true"/>

Step 2: view the WSDL

To see all the exported services:
To see SOAP services (credentials: flexadmin/ofbiz)
To view the WSDL for the findPartiesById service:

I would recommend studying the WSDL for the service, as it documents the AXIOM model you need to later create.

Step 3: Create eclipse project

1) Create an eclipse java project.
2) Download axis2, e.g.
3) Unzip axis2
4) In your new eclipse project, set build path to include all the jar files in the axis distribution lib directory. (you don't need all the jars, but this is a quick howto)

Step 4: Create your axis client

import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;

public class Main {

   private static OMFactory fac;
   private static OMNamespace omNs;

   static {
      fac = OMAbstractFactory.getOMFactory();
      omNs = fac.createOMNamespace("", "ns1");

   public static void main(String[] args) throws AxisFault {

      ServiceClient sc = new ServiceClient();
      Options opts = new Options();
      opts.setTo(new EndpointReference(
      OMElement res = sc.sendReceive(createPayLoad());

   private static OMElement createPayLoad() {

      OMElement findPartiesById = fac.createOMElement("findPartiesById", omNs);
      OMElement mapMap = fac.createOMElement("map-Map", omNs);


      mapMap.addChild(createMapEntry("idToFind", "admin"));
      mapMap.addChild(createMapEntry("login.username", "admin"));
      mapMap.addChild(createMapEntry("login.password", "ofbiz"));

      return findPartiesById;

   private static OMElement createMapEntry(String key, String val) {

      OMElement mapEntry = fac.createOMElement("map-Entry", omNs);

      // create the key
      OMElement mapKey = fac.createOMElement("map-Key", omNs);
      OMElement keyElement = fac.createOMElement("std-String", omNs);
      OMAttribute keyAttribute = fac.createOMAttribute("value", null, key);


      // create the value
      OMElement mapValue = fac.createOMElement("map-Value", omNs);
      OMElement valElement = fac.createOMElement("std-String", omNs);
      OMAttribute valAttribute = fac.createOMAttribute("value", null, val);


      // attach to map-Entry

      return mapEntry;

The output was:

<axis2ns17:findPartiesByIdResponse xmlns:axis2ns17=""><map-Map>
                <std-String value="responseMessage" />
                <std-String value="success" />
                <std-String value="party" />
                <eeval-Party createdStamp="2009-12-24 16:13:30.949" createdTxStamp="2009-12-24 16:13:30.946" lastUpdatedStamp="2009-12-24 16:13:31.892" lastUpdatedTxStamp="2009-12-24 16:13:31.553" partyId="admin" partyTypeId="PERSON" />
                <std-String value="partiesFound" />
                <col-Collection />
  • No labels