Hi all,

I have a problem when calling an Apache CXF Web service (CXF version is 2.0.4) running under Apache Tomcat 6 from a Delphi client program. The third parameter "JobParamBean" that I receive in my Web service on Tomcat is always null but there is no exception or any other hint in the Tomcat logs. The parameter is a simple JavaBean class (uses getters and setters for all properties and implements serializable). Moreover, the problem does not appear when calling the same Web service from a Java client. This is my Web service:

@WebService(name="JobService", targetNamespace="http://annuaire.ciss.lu";)
@SOAPBinding(style=Style.RPC)
public interface JobService {
  @WebMethod(operationName="ExecuteJob")
  @WebResult(name="JobParamsOut")
  public String[] executeJob(@WebParam(name="JobName") String jobName,
      @WebParam(name="JobParamsIn") String[] input,
@WebParam(name="JobParamBean") JobServiceParam param) throws ServiceException;
}

When calling this web service from the Delphi application (using the latest available HTTPRIO component and WSDL importer), the corresponding generated SOAP request produces "null" as JobParamBean parameter:

<?xml version="1.0"?>
<SOAP-ENV:Envelope
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
  xmlns:xsd="http://www.w3.org/2001/XMLSchema";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";>
  <SOAP-ENV:Body
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
      xmlns:NS2="http://annuaire.ciss.lu";>
      <NS1:ExecuteJob xmlns:NS1="http://annuaire.ciss.lu";>
          <JobName xsi:type="xsd:string">TestFromDelphi</JobName>
          <JobParamsIn xsi:type="SOAP-ENC:Array"
              SOAP-ENC:arrayType="xsd:string[2]">
              <item>valueDelphi1</item>
              <item>valueDelphi2</item>
          </JobParamsIn>
          <JobParamBean href="#1" />
      </NS1:ExecuteJob>
      <NS2:JobServiceParamType id="1"
          xsi:type="NS2:JobServiceParamType">
          <key xsi:type="xsd:string">paramkey</key>
          <value xsi:type="xsd:string">paramval</value>
      </NS2:JobServiceParamType>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

I tried to call the same web service from Java (also using Apache CXF 2.0.4) and the generated SOAP request correctly creates a JobParamBean instance:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
  <soap:Body>
      <ns1:ExecuteJob xmlns:ns1="http://annuaire.ciss.lu";>
          <JobName>TestFromJava</JobName>
          <JobParamsIn>
              <item>valueJava1</item>
              <item>valueJava2</item>
          </JobParamsIn>
          <JobParamBean>
              <key>keyJava</key>
              <value
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:ns3="http://www.w3.org/2001/XMLSchema"; xsi:type="ns3:int">
                  1
              </value>
          </JobParamBean>
      </ns1:ExecuteJob>
  </soap:Body>
</soap:Envelope>

I noticed that the Delphi SOAP request uses a reference for the third parameter (href="#1") but the Java SOAP request does not. Is it possible that CXF doesn't support this kind of references? Is there a workaround in CXF to support the request or perhaps in Delphi to suppress the use of the reference?

Thanks in advance for any comments on this issue.

Best regards,
Pierre Post






Reply via email to