在SAP中使用肥皂服务时遇到问题

时间:2019-05-23 12:45:54

标签: spring soap wsdl sap jax-ws

我已经使用java spring jax-ws创建了soap Web服务,该服务运行良好并且已通过soap ui进行了测试。但是当我在sap中使用wsdl文件时,它会产生以下错误:

  

SoapFault代码3:一个或多个强制性Soap标头不被理解。

我是肥皂新手,无法理解问题。

我已经在soap ui中测试了我的Java代码,并且工作正常。

这是我的wsdl代码:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:wsdl="schemas.xmlsoap.org/wsdl/" xmlns:sch="example.com/soap" xmlns:soap="schemas.xmlsoap.org/wsdl/soap/" xmlns:tns=" example.com/soap" targetNamespace="example.com/soap">
  <wsdl:types>
    <xs:schema xmlns:xs="www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="example.com/soap">

    <xs:element name="getInvoiceRequest">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="purchaseOrderNumber" type="xs:int"/>
                <xs:element name="poType" type="xs:string"/>
                <xs:element name="vendorCode" type="xs:int"/>
                <xs:element name="vendorName" type="xs:string"/>
                <xs:element name="plantStorageLocation" type="xs:string"/>
                <xs:element maxOccurs="unbounded" minOccurs="0" name="lineItem" type="tns:lineItem"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:complexType name="lineItem">
        <xs:sequence>
            <xs:element name="Order_Line_No" type="xs:int"/>
            <xs:element name="Material_Code" type="xs:int"/>
            <xs:element name="Material_Description" type="xs:string"/>
            <xs:element name="UOM" type="xs:string"/>
            <xs:element name="PO_Net_Value" type="xs:int"/>
            <xs:element name="Tax_Code" type="xs:int"/>
            <xs:element name="Tax_Description" type="xs:string"/>
            <xs:element name="PO_Tax_Item_wise" type="xs:int"/>
            <xs:element name="GRN_No" type="xs:int"/>
            <xs:element name="GRN_Year" type="xs:int"/>
            <xs:element name="GRN_Line_No" type="xs:int"/>
            <xs:element name="Miro_No" type="xs:int"/>
            <xs:element name="Miro_Year" type="xs:int"/>
            <xs:element name="Miro_Line_No" type="xs:int"/>
            <xs:element name="Storage_Location" type="xs:string"/>
        </xs:sequence>
    </xs:complexType>
    <xs:element name="getInvoiceResponse">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="message" type="xs:string"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>


</xs:schema>
  </wsdl:types>
  <wsdl:message name="getInvoiceRequest">
    <wsdl:part element="tns:getInvoiceRequest" name="getInvoiceRequest">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="getInvoiceResponse">
    <wsdl:part element="tns:getInvoiceResponse" name="getInvoiceResponse">
    </wsdl:part>
  </wsdl:message>
  <wsdl:portType name="invoiceService">
    <wsdl:operation name="getInvoice">
      <wsdl:input message="tns:getInvoiceRequest" name="getInvoiceRequest">
    </wsdl:input>
      <wsdl:output message="tns:getInvoiceResponse" name="getInvoiceResponse">
    </wsdl:output>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="invoiceServiceSoap11" type="tns:invoiceService">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="getInvoice">
      <soap:operation soapAction=""/>
      <wsdl:input name="getInvoiceRequest">
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output name="getInvoiceResponse">
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="invoiceServiceService">
    <wsdl:port binding="tns:invoiceServiceSoap11" name="invoiceServiceSoap11">
      <soap:address location="http://localhost:8089/ProcureSoap/app/invoiceService"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

输出应为:Invoice number 123 created sucessfully.,但是我在SAP中收到错误soapfault代码3。

0 个答案:

没有答案
相关问题