Search code examples
c#httpsoaphttpsprotocols

OcppV1.5 over Soap Error: Action does not exist


i am currently building a Client to communicate with a Gateway of a Charge Point.
The communication is build with OcppV1.5 over Soap & Http.
The Server doesn't accept my request. I get a Http Response 500 with the Error Reason:

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

I looked into the wsdl files but I just don't understand why it doesn't accept my action.

My Request looks something like this:

<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>

Update:

As Bogdan suggested I tried to send the same message using SoapUi and it worked. The generated Request from SoapUi looks like this:

<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>

Solution

  • It's hard to tell from what you posted why you are getting an error, so I can only add some information that can hopefully allow you to troubleshoot the issue.

    Your message has 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 on the HTTP Content-Type header. Based on the http://www.w3.org/2003/05/soap-envelope namespace, you have a SOAP 1.2 message.

    With these explanations layed out, I suggest you take the WSDL and feed it to 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 and help you fill in the values you need. If not, look again through the WSDL for Action elements (make sure you differentiate between the SOAP Action and the WS-Addressing Action using their XML namespaces) or through the service documentation.

    Once you get a succesfull call using SoapUI, then try to duplicate it with your code. At that point you can again use SoapUI to troubleshoot things and inspect your code built message to see it resembles the one you can successfully send with SoapUI.

    Hope this helps get you closer to a resolution.