OcppV1.5 over Soap Error: Action does not exist

OcppV1.5 over Soap Error: Action does not exist

我目前正在构建一个客户端来与充电点的网关进行通信。
通信是通过 Soap & Http 使用 OcppV1.5 构建的。
服务器不接受我的请求。我收到带有错误原因的 Http 响应 500:

"XML Request is not well formed, Action does not exist."

我查看了 wsdl 文件,但我不明白为什么它不接受我的操作。

我的请求看起来像这样:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="https://www.w3.org/2005/08/addressing" xmlns:cs="urn://Ocpp/Cp/2012/06/">
  <SOAP-ENV:Header>
    <cs:chargeBoxIdentity>0000.0000</cs:chargeBoxIdentity>
    <wsa:From>
      <wsa:Address>http://000.000.000.000:0000</wsa:Address>
    </wsa:From>
    <wsa:To>http://000.000.000.001:0001</wsa:To>
    <wsa:Action>/ChangeConfiguration</wsa:Action>
    <wsa:MessageID>00000.000000000000</wsa:MessageID>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <cs:changeConfigurationRequest>
      <cs:key>MeterValueSampleInterval</cs:key>
      <cs:value>60</cs:value>
    </cs:changeConfigurationRequest>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

更新:

正如 Bogdan 所建议的那样,我尝试使用 SoapUi 发送相同的消息并且成功了。 SoapUi 生成的请求如下所示:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ns="urn://Ocpp/Cp/2012/06/">
   <soap:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
      <ns:chargeBoxIdentity>000000.00000</ns:chargeBoxIdentity>
      <wsa:Action>/ChangeConfiguration</wsa:Action>
      <wsa:ReplyTo>
         <wsa:Address>http://000.000.000.000:0000</wsa:Address>
      </wsa:ReplyTo>
      <wsa:MessageID>uuid:00000000-0000-0000-0000-000000000000</wsa:MessageID>
      <wsa:To>http://000.000.000.000:00000/</wsa:To>
   </soap:Header>
   <soap:Body>
      <ns:changeConfigurationRequest>
         <ns:key>MeterValueSampleInterval</ns:key>
         <ns:value>300</ns:value>
      </ns:changeConfigurationRequest>
   </soap:Body>
</soap:Envelope>

很难从您发布的内容中判断您收到错误的原因,因此我只能添加一些信息,希望能帮助您解决问题。

您的消息在 HTTP Content-Type header 上有 WS-Addressing headers, <wsa:Action> being one of them. The value of this field should be specified in the WSDL if your WSDL also includes WS-Addressing Metadata information, or should be specified in the documentation of the web service you are invoking. Your error message "XML Request is not well formed, Action does not exist" seems to indicate that there might be an issue with this field, but there is another action that SOAP services have which is a SOAP action. I asked about it in the comment above to make sure it's eliminated as a source of problems. In SOAP 1.1 it's called SOAPAction and is a separate HTTP header, while in SOAP 1.2 it's an action parameter。基于 http://www.w3.org/2003/05/soap-envelope 命名空间,您有一条 SOAP 1.2 消息。

有了这些解释,我建议您使用 WSDL 并将其提供给 SoapUI who can generate sample requests that you can use to invoke the web service. If the WSDL also contains WS-Addressing Metadata, SoapUI should be able to pick it up 并帮助您填写所需的值。如果没有,请再次查看 WSDL 中的 Action 元素(确保使用它们的 XML 名称空间区分 SOAP 操作和 WS-Addressing 操作)或查看服务文档。

使用 SoapUI 获得成功调用后,请尝试用您的代码复制它。到那时,您可以再次使用 SoapUI 来解决问题,inspect your code built message 看看它是否类似于您可以使用 SoapUI 成功发送的那个。

希望这可以帮助您更接近解决方案。