Есть клиент на Qt, который должен работать с веб-сервисами.
| Код | void WebDataProvider::callWebService() { connect(&http, SIGNAL(responseReady(QtSoapMessage)), this, SLOT(getResponse(QtSoapMessage)));
http.setHost("xxx.xxx.xxx", 80); http.setAction("http://tempuri.org/SendMessage");
QtSoapMessage request; request.setMethod(QtSoapQName("SendMessage", "htpp://tempuri.org/"));
request.addMethodArgument("From", "", "bla-bla-bla"); request.addMethodArgument("To", "", "bla-bla-bla" ); request.addMethodArgument("Subject", "", "mysubject"); request.addMethodArgument("Body", "", "bodydydy");
// Submit the method request to the web service. http.submitRequest(request, "/WebService.asmx");
qDebug() << request.toXmlString(); } //-------------------------------------------------------------
void WebDataProvider::getResponse(QtSoapMessage mes) { const QtSoapType &res = mes.returnValue(); qDebug("\n\n\n"); qDebug() << mes.toXmlString(); }
|
Запрос к сервису уходит, а в ответ от сервиса приходит "From is null". То есть сервис запускается, но параметры ему не передаются. Сервис выглядит вот так.
| Код | POST /MedExWebService.asmx HTTP/1.1 Host: xxx.xxx.xxx Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://tempuri.org/SendMessage"
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <SendMessage xmlns="http://tempuri.org/"> <From>string</From> <To>string</To> <Subject>string</Subject> <Body>string</Body> </SendMessage> </soap:Body> </soap:Envelope>
HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <SendMessageResponse xmlns="http://tempuri.org/"> <SendMessageResult>string</SendMessageResult> </SendMessageResponse> </soap:Body> </soap:Envelope>
|
|