开发者

SOAP failing to serialize xsd:int and soapenc:string?

开发者 https://www.devze.com 2023-04-04 04:30 出处:网络
I\'ve just been assigned to help maintain a massive Java project that communicates with my company\'s primary C++ codebase via SOAP, and have no idea what I\'m doing.(Java, netbeans, networking, SOAP.

I've just been assigned to help maintain a massive Java project that communicates with my company's primary C++ codebase via SOAP, and have no idea what I'm doing. (Java, netbeans, networking, SOAP... all new to me.)

There exists an PromptPlayable class which worked fine, and I'm attempting to add an optional "Parameters" class that hold three arrays (one of ints, two of strings.) The code is summarized here.

In PromptPlayable.java:

public class PromptPlayable {
    // older working parameters stripped
    private PromptPlayableCallParams parameters = null;

    public PromptPlayableCallParams getParameters() {
        return parameters;
    }
    public void setParameters(PromptPlayableCallParams parameters) {
        this.parameters = parameters;
    }
}

PromptPlayableCallParams.java:

public class PromptPlayableCallParams {
    private int[] intParams;
    private java.lang.String[] stringParams;
    private java.lang.String[] fileParams;

    public int[] getIntParams() {
        return intParams;
    }
    public void setIntParams(int[] intParams) {
        this.intParams = intParams;
    }
    public java.lang.String[] getStringParams() {
        return stringParams;
    }
    public void setStringParams(java.lang.String[] stringParams) {
        this.stringParams = stringParams;
    }
    public java.lang.String[] getFileParams() {
        return fileParams;
    }
    public void setFileParams(java.lang.String[] fileParams) {
        this.fileParams = fileParams;
    }
}

And the WSDL:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:channel" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="urn:channel" xmlns:intf="urn:channel" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <wsdl:types>
  <schema targetNamespace="urn:channel" xmlns="http://www.w3.org/2001/XMLSchema">
    <complexType name="ArrayOfString">
      <complexContent>
        <restriction base="soapenc:Array">
          <attribute ref="soapenc:arrayType" wsdl:arrayType="soapenc:string[]"/>
        </restriction>
      </complexContent>
    </complexType>
    <complexType name="ArrayOfInt">
      <complexContent>
        <restriction base="soapenc:Array">
          <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:int[]"/>
        </restriction>
      </complexContent>
    </complexType>
    <complexType name="PromptPlayableCallParams">
      <sequence>
        <element name="intParams" type="impl:ArrayOfInt"/>
        <element name="stringParams" type="impl:ArrayOfString"/>
        <element name="fileParams" type="impl:ArrayOfString"/>
      </sequence>
    </complexType>
    <complexType name="PromptPlayable">
    <sequence>
      <!-- older working parameters stripped -->
      <element name="parameters" nillable="true" type="impl:PromptPlayableCallParams"/>
    </sequence>
   </complexType>
 </wsdl:types>
 <!-- wsdl::messages and other stuff I don't understand yet -->
</wsdl:definitions>

In some actual java code somewhere:

public void doPromptAndCollect(com.company.reuse.context.PromptAndCollectParameters in0)    
    org.apache.axis.client.Call _call = createCall();
        _call.setOperation(_operations[18]);
        _call.setUseSOAPAction(true);
        _call.setSOAPActionURI("");
        _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
        _call.setOperationName(new javax.xml.namespace.QName("urn:channel", "doPromptAndCollect"));


        s开发者_运维问答etRequestHeaders(_call);
        setAttachments(_call);
 try { 
        java.lang.Object _resp = _call.invoke(new java.lang.Object[] {in0});
        if (_resp instanceof java.rmi.RemoteException) {
            throw (java.rmi.RemoteException)_resp;
        }
        extractAttachments(_call);
  } catch (org.apache.axis.AxisFault axisFaultException) {
  //more code
throws java.rmi.RemoteException, com.company.reuse.context.ChannelException {

When the new parameters are unused (null), everything works as it always has. However, when the parameters are used (not null), the call to org.apache.axis.client.Call.invoke(...) never returns (I can't seem to step into it), the C++ side freezes permanently listening for the SOAP message, and my co-worker who knows this stuff says the problem is in the Java serialization of the arrays.

My question is: Can anyone see what is wrong with my SOAP/Java here (doubtful) or does anyone have any ideas as to how I can find out (also doubtful)?

0

精彩评论

暂无评论...
验证码 换一张
取 消