1

我需要从我的 c# asp.net Web 应用程序调用 Java Web 服务。我有一个方法的以下 wsdl 信息并生成了代理类

<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions targetNamespace="http://myapp.mycompany.com/elo/services/ApplicationService" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://myapp.mycompany.com/elo/services/ApplicationService" xmlns:intf="http://myapp.mycompany.com/elo/services/ApplicationService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="urn:com:mycompany:elo:Trinity:classes" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  - <!-- 
WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)

  -->
  - <wsdl:types>
    - <schema targetNamespace="http://myapp.mycompany.com/elo/services/ApplicationService" xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="urn:com:mycompany:elo:Trinity:classes" />
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
      -
      - <complexType name="SubmitPreApprovalApplicationRequest">
        - <complexContent>
          - <extension base="impl:ApplicationServiceRequest">
            - <sequence>
              <element name="AfpPreApprovalRequestId" type="xsd:int" />
              <element maxOccurs="1" minOccurs="0" name="CoBorrower" nillable="true" type="tns1:CoBorrower" />
              <element name="PrimaryApplicant" nillable="true" type="tns1:PrimaryApplicant" />
              <element name="RequestedAmount" nillable="true" type="xsd:decimal" />
              <element name="RequestedTermInMonths" type="xsd:int" />
              <element name="numberofCoborrowers" type="xsd:int" />
            </sequence>
          </extension>
        </complexContent>
      </complexType>
      - <complexType name="SubmitPreApprovalApplicationResponse">
        - <sequence>
          <element name="ResponseStatus" nillable="true" type="tns1:ResponseStatus" />
        </sequence>
      </complexType>
    </schema>
    - 
  </wsdl:types>
  - 
  - <wsdl:message name="submitPreApprovalApplicationResponse">
    <wsdl:part name="submitPreApprovalApplicationReturn" type="impl:SubmitPreApprovalApplicationResponse" />
  </wsdl:message>
  - <wsdl:message name="submitPreApprovalApplicationRequest">
    <wsdl:part name="request" type="impl:SubmitPreApprovalApplicationRequest" />
  </wsdl:message>
  - <wsdl:portType name="ApplicationService">
    - <wsdl:operation name="submitPreApprovalApplication" parameterOrder="request">
      <wsdl:input message="impl:submitPreApprovalApplicationRequest" name="submitPreApprovalApplicationRequest" />
      <wsdl:output message="impl:submitPreApprovalApplicationResponse" name="submitPreApprovalApplicationResponse" />
    </wsdl:operation>
    - 
  </wsdl:portType>
  - <wsdl:binding name="ApplicationServiceSoapBinding" type="impl:ApplicationService">
    <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
    - <wsdl:operation name="submitPreApprovalApplication">
      <wsdlsoap:operation soapAction="" />
      - <wsdl:input name="submitPreApprovalApplicationRequest">
        <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://classes.Trinity.elo.mycompany.com" use="encoded" />
      </wsdl:input>
      - <wsdl:output name="submitPreApprovalApplicationResponse">
        <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://myapp.mycompany.com/elo/services/ApplicationService" use="encoded" />
      </wsdl:output>
    </wsdl:operation>
    - 
  </wsdl:binding>
  - <wsdl:service name="ApplicationServiceService">
    - <wsdl:port binding="impl:ApplicationServiceSoapBinding" name="ApplicationService">
      <wsdlsoap:address location="http://myapp.mycompany.com/elo/services/ApplicationService" />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

C# Web 服务调用

       ApplicationServiceService service = new ApplicationServiceService();

       string version=  service.getVersion(); // This call works and fetches version

       service.Credentials = System.Net.CredentialCache.DefaultCredentials;
       SubmitPreApprovalApplicationRequest req = new SubmitPreApprovalApplicationRequest();
           req.prop=value// preparing all the properties

       res = service.submitPreApprovalApplication(req); //HERE IS THAT ERROR

可能是什么问题呢?任何1可以帮助我解决吗?

PS:我从 wsdl 中删除了一些对象,以通过必要的细节来最小化页面大小。

4

0 回答 0