Closed AlexCln closed 6 years ago
what does your args
look like? the request should indeed be a complete XML with SOAP namespaces and everything.....
Hi Doedje;
My args looks like :
args = {
appId: "params1",
username: "params2",
password: "params3"
}
the request should indeed be a complete XML with SOAP namespaces and everything..... ==> Totally agree, but it doesn't... I don't understand why my request isn't encapsulated in a xml envelop. $.soap is correctly imported, everythings looks good
Update 26 september at 2pm: I've made an update on my $.soap implementation :
$.soap({
url: "http://myserver.com/myApp/services/AuthenticationService.AuthenticationServiceHttpSoap12Endpoint",
method: "verifyUser",
appendMethodToURL: false,
enableLogging: true,
soap12: true,
namespaceQualifier: 'off',
namespaceURL: 'http://my.server.com',
data: args,
context: document.body,
beforeSend: function(req){
MyApp.writeMessage(this);
},
success: function (soapResponse) {
MyApp.writeMessage("Res: "+ JSON.stringify(soapResponse));
},
error: function (SOAPResponse) {
// show error
MyApp.writeMessage("SOAP error : " + SOAPResponse);
}
});
When I put a breakpoint at jquery.soap.js:742 I got this output :
`<?xml version="1.0" encoding="UTF-8"?>
Ah, those certificates.......
Now I realise what might have happened with your xml when you printed:
request : params1params2params3
It looks like you print to something that is interpreting html, dropping all the xml that is wrapping your params1,2 and 3.... like what would happen when you put xml into an html-element on a website....
Why the config.context is empty I don't really know. I'll look into that.
Good luck with your project and certificates!
Thanks for your answers anyway !
It looks like you print to something that is interpreting html, dropping all the xml that is wrapping your params1,2 and 3.... like what would happen when you put xml into an html-element on a website....
==> Exactly this is what my MyApp.writeMessage looks like :
MyApp.writeMessage = function writeMessage(text){
$('.ms-MessageBar').hide();
$('#messageBarError').show();
$('#messageBarError .ms-MessageBar-text').append('<br/>'+text);
}
If needed for people coming to my post this is how my $.soap
looks like :
$.soap({
url: "https://localhost:8444/myApp/services/AuthenticationService.AuthenticationServiceHttpSoap11Endpoint",
method: methodName,
appendMethodToURL: false,
enableLogging: true,
namespaceQualifier: 'off',
namespaceURL: 'http://myDistantServer.services.com',
data: args,
context: document.body,
beforeSend: function(req){
MyApp.writeMessage(this);
},
success: function (soapResponse) {
MyApp.writeMessage("Res: "+ JSON.stringify(soapResponse));
},
error: function (SOAPResponse) {
MyApp.writeMessage("SOAP error : " + SOAPResponse);
}
});
The url property is the url:port of my reverse proxy who redirect every request of this url:port to my Soap distant web server.
Hope it will help someone in the future. Thanks again Alex
You're welcome!
Hi, I was try to make your lib work but without success.
Jquery soap version: 1.7.1 Jquery version : 2.2.1
Here is my code:
My app is a javascript Add-In for Word 2016. The output is :
I already have take a look on Same Origin Policy. My reverse proxy is ok. My resquest doesn't look like your exemple.
May I miss something ? I don't understand why and where
Thanks for your time Regards Alex