Java 为什么SOAP请求在EclipseWSE中正确返回响应,而在使用Postman时却不正确?

Java 为什么SOAP请求在EclipseWSE中正确返回响应,而在使用Postman时却不正确?,java,eclipse,soap,wsdl,wsdl2java,Java,Eclipse,Soap,Wsdl,Wsdl2java,我有一个WSDL应用程序生成的框架,我使用Web Service Explorer测试一个调用,它在Eclipse WSE中运行良好,但是当我使用POSTMAN时,我得到一个响应错误,说: <faultcode xmlns:ns1="http://xml.apache.org/axis/">ns1:Client.NoSOAPAction</faultcode> <faultstring>no SOAPAction header!<

我有一个WSDL应用程序生成的框架,我使用Web Service Explorer测试一个调用,它在Eclipse WSE中运行良好,但是当我使用POSTMAN时,我得到一个响应错误,说:

<faultcode xmlns:ns1="http://xml.apache.org/axis/">ns1:Client.NoSOAPAction</faultcode>
            <faultstring>no SOAPAction header!</faultstring>
ns1:Client.nosopacation
没有SOAPAction标题!
这是请求代码:

SOAP请求:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:q0="http://biller.com/onlinebilling" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
    <q0:sendPmtNotification>
      <PmtNotificationRequest>
        <RequestId>3454</RequestId>
        <InqDate>2018-11-08T20:35:44.626Z</InqDate>
        <PaidInvoices>
          <InvoiceId>123</InvoiceId>
          <PaidValue>2333</PaidValue>
          <BankSrc>wqewqe</BankSrc>
          <BankAuthCŪode>123</BankAuthCode>
          <ValuesDetail>
            <Description>wqeweqweqwe</Description>
            <Value>123</Value>
          </ValuesDetail>
        </PaidInvoices>
      </PmtNotificationRequest>
    </q0:sendPmtNotification>
  </soapenv:Body>
</soapenv:Envelope>

3454
2018-11-08T20:35:44.626Z
123
2333
wqewqe
123
wqeweqweqwe
123
SOAP响应

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
    <sendPmtNotificationResponse xmlns="http://biller.com/onlinebilling">
      <PmtNotificationResponse xmlns="">
        <Status>OK</Status>
        <RequestId>1002</RequestId>
        <Message>MESSAGE_RESPONSE</Message>
        <PartnerAuthCode>partnerAUTH_CODE</PartnerAuthCode>
      </PmtNotificationResponse>
    </sendPmtNotificationResponse>
  </soapenv:Body>
</soapenv:Envelope>

好啊
1002
讯息及回应
partnerAUTH_代码
《邮递员》中的SOAP响应

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <soapenv:Fault>
            <faultcode xmlns:ns1="http://xml.apache.org/axis/">ns1:Client.NoSOAPAction</faultcode>
            <faultstring>no SOAPAction header!</faultstring>
            <detail>
                <ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">BATTLES_WINNER</ns2:hostname>
            </detail>
        </soapenv:Fault>
    </soapenv:Body>
</soapenv:Envelope>

ns1:Client.nosopacation
没有SOAPAction标题!
你是赢家吗
邮递员截图


在Soap 1.1中,客户端需要发送SOAPAction HTTP头。这允许防火墙和服务器识别SOAP请求,而无需询问请求的全部内容。它可以用于智能路由,也可以用于更好地管理web服务请求

该值可以是任意的,如果需要一个特定的值,它将在WSDL中;通常,它是一个URI。轻描淡写地描述行为

在Postman中,您可以通过点击请求部分上的Headers添加标题。如果操作需要特定的值,请检查WSDL。根据您的意见,您可以使用空白标题


由于WSE是一个专用的web服务测试工具,我猜它是一种自动增加价值的工具。Postman是一个更通用的HTTP测试工具,因此它可能不太友好,这可能解释了行为差异。

您在Postman中设置了SOAPAction HTTP头吗?我猜是我们给你定的,邮递员没有。可能的值应该在WSDL中可用。您只需要在Postman中请求的Headers选项卡上添加适当的值作为HTTP头。您好,感谢您的评论,我将soapAction添加到头中,并且知道它是有效的,但是soapAction没有任何值,这非常混乱。它似乎需要参数的存在,但实际上并不重要。您对此有什么解释吗?当它为空时,它向服务器指示确定SOAP操作所需的一切都在http URI本身中。在某些情况下仍然需要标头,因为防火墙或服务器可能会过滤掉“盲”请求。这个规格可能会有帮助。没问题!很乐意帮忙!