Comments (9)
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.
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.
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.
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.
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.
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.
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.
I suppose we could add a method KDSoapMessage lastReply();
to KDSoapClientInterface
though, much like lastResponseHeaders(), for the case of blocking calls.
from kdsoap.
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)
- Port away from QXmlSimpleReader HOT 1
- Creating XML Signature HOT 3
- No rule to make target 'kdwsdl2cpp', needed by wsdl .h HOT 3
- Code generation issue with enumeration encapsulated in restriction type HOT 4
- autogen.py: Still using Python 2? HOT 4
- Error when generating headers files from ws-discovery.wsdl HOT 2
- kdsoap-test_wsdl_document fails on s390x
- Disabling HTTP2 Upgrade HOT 5
- Server path cleanup incorrectly processes query string HOT 3
- kdwsdl2cpp cycle reference HOT 3
- kdwsdl2cpp creates invalid code with Qt6 HOT 3
- Incorrect fault message is sent from server side if request contained parse errors.
- Broken CMake config files HOT 3
- Server application crashes when client is disconnected while an action is still running HOT 6
- Co-installability of Qt5 and Qt6 version HOT 2
- (CMake-VCPKG) KDSoap 1.9 build issue HOT 6
- Occasional getting an assert when writing data. HOT 5
- Call a service without using WSLD HOT 2
- kdwsdl2cpp: XML Primitive type usage HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kdsoap.