Code Monkey home page Code Monkey logo

Comments (9)

dfaure-kdab avatar dfaure-kdab commented on September 4, 2024

The API to use is rather something along the lines of

  KDSoapMessageAddressingProperties addressing;
  addressing.setDestination("http://example.com/onvif/event_service?idx=4");
  message.setMessageAddressingProperties(addressing);

but the question is indeed why kdwsdl2cpp doesn't generate that.

Maybe bindingService.clientInterface()->setSendSoapActionInWsAddressingHeader(true); is enough to fix it?

It sounds like WS/Addressing support isn't fully integrated with kdwsdl2cpp indeed, please let me know if this helps, then we can take a look at improving this integration. The first step will be to extend unittests/ws_addressing_support ...

from kdsoap.

Javierd avatar Javierd commented on September 4, 2024

Hi,
sorry for the delay on the answer, but I lost access to the service and couldn't test your suggestions.
I just tested adding bindingService.clientInterface()->setSendSoapActionInWsAddressingHeader(true); but it is not working yet.
By checking the message sent using wireshark I can see that this adds a new evement to the header:

<wsa:Action>
    http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesRequest
    </wsa:Action>

However, that's not the element I needed to add.

So, maybe I need to implement a manual call using the API directly instead of using the automatically generated files? Or is there any other solution?

Thanks a lot

from kdsoap.

dfaure-kdab avatar dfaure-kdab commented on September 4, 2024

Please update to latest master, and do

  KDSoapMessageAddressingProperties addressing;
  addressing.setDestination("http://example.com/onvif/event_service?idx=4");
  bindingService.clientInterface()->setMessageAddressingProperties(addressing);

I suppose that the WSDL files contain all the information necessary for kdwsdl2cpp to generate the message addressing properties automatically, but I don't know enough about ws-addressing to implement that (someone else implemented the current support for WS-addressing). Meanwhile, this new method at least allows to set WS-addressing properties manually on WSDL-generated messages.

Please let me know how this works for you.

from kdsoap.

Javierd avatar Javierd commented on September 4, 2024

I've been trying to use the method you propose, but although I've updated to master and build new headers and sources files which contains that method, it does nothing. The sent soap header is empty, there is no addressing information added to it

from kdsoap.

dfaure-kdab avatar dfaure-kdab commented on September 4, 2024

That is surprising, given that the unittest I wrote as part of that commit, shows that the addressing information is sent correctly. There must be a difference somewhere.

Ah, I found it, after writing a testcase based on the onvif WSDL. The code required a SOAP action to be set in order to write addressing properties. I removed that check now, I hope that's correct (no time to read the WS-Addressing spec).

Please git pull and try again.

from kdsoap.

Javierd avatar Javierd commented on September 4, 2024

It's working now! Thanks a lot!
By the way, this service may return an error when some of the request's parameters are not right. When using gsoap, a class with the error information was available by calling response.GetFaultObject().
Is there any way of getting that same information using KDSoap? Even if I have to parse it myself from the XML. As far as I know, the only way of getting some information is by calling the lastError and lastFault methods of the service, but there is no way of getting the complete fault error, am i wrong?

from kdsoap.

dfaure-kdab avatar dfaure-kdab commented on September 4, 2024

If you use the blocking API (bindingService.pullMessages(...)), then indeed you're limited to lastError/lastFault.
If you use the job API instead -- which is recommended anyhow in the GUI thread, then you can get the full response message.

Something like:

  TEV__PullMessages in;
  // ...
  auto job = new PullMessagesJob(&bindingService);
  job->setParameters(in);
  QObject::connect(job, &KDSoapJob::finished, nullptr, [job]() {
    if (job->reply().isFault()) {
      qDebug() << job->reply().arguments();
    } else {
      qDebug() << "success";
      // use job->resultParameters();
    }
  });
  job->start();

from kdsoap.

dfaure-kdab avatar dfaure-kdab commented on September 4, 2024

I suppose we could add a method KDSoapMessage lastReply(); to KDSoapClientInterface though, much like lastResponseHeaders(), for the case of blocking calls.

from kdsoap.

Javierd avatar Javierd commented on September 4, 2024

Ok, so I'll use jobs for now, but u think it would be useful to have the lastReply() method you mentioned
Thanks a lot for all your help!

from kdsoap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.