-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using jquery.soap with VB.net web service #4
Comments
you might try adding appendMethodToURL: false to the options.....? |
Thanks for the reply, very much appreciated. You know, I thought of that and was setting appendMethodToURL both in my JavaScript as well as forcing it in your jquery.soap.js file, but it didn’t seem to make any difference. I got started looking at that because at first I was getting a 404 error and looking at the URL it was ending in a net/lmwapi/service1.asmxLMSLaunch... which obviously wasn’t going to work. I was able to capture the request package and compare. Here is the response package created by jquery.soap: <soap:Envelope And the one created by the webservice.htc behavior: <SOAP-ENV:Envelope xmlns="" SOAP-ENV:Body Now, if I kill the namespace it makes the options look like the successful packed but of course there is no namespace and it fails. <soap:Envelope /lns:soap="http://schemas.xmlsoap.org/soap/envelope/"> Hopefully, this rambling will give you some ideas what I’ve done wrong. |
Also, is the namespaceUrl: 'urn://service1.www.server.com' correct? I'm not sure where that fits in. |
I think in your case namespaceQualifier should be 'tns' and namespaceUrl should be 'SCORM12/'... and also try the option soap12: true Just a quick response... Hope it helps Remy On 5 apr. 2013, at 21:15, Velocedge notifications@github.com wrote:
|
I’ve worked on this so long, I’ll call it progress... I changed to tns and SCORM12 with soap12 set to true. The new error was: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Xml.XmlException: '/' is an unexpected token. The expected token is '>'. So I took the namespace out hoping that it would sneak through and just recognize the LMSLaunch action by itself but no luck. Got the following: |
Can you send me the soap request you sent in the last attempt? So I can compare it to the htc soap… It should look better now… It's time for bed here in the Netherlands…. good luck greets REMY |
Here’s the latest for your morning reading pleasure... <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"> I’ll also attach a bunch of this in a file. BTW, I really appreciate this. Thanks! Steve SOAPRequest webservice.htc <SOAP-ENV:Envelope xmlns="" SOAP-ENV:Body jquery.soap without namespace <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> tried to fake the thing out by hard coding: ... didn't work <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> soap:Reason<soap:Text xml:lang="en">System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Xml.XmlException: '/' is an unexpected token. The expected token is '>'. last request: <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"> |
It’s working but I don’t totally understand why... or at least why this way. I changed the parameters to an xml string and then wrapped that with the method (ie. myParams = '<' + method + ' xmlns="SCORM12">' + myParams + '</' + _trackAPI + '>'; ) so the request package looks like: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> Now that it’s working, I also noticed it’s an asynchronous call. Any reason why it can’t be a synchronous one? Thanks, Steve |
I am glad it is working now... Could you post that part of the code that is responsible for producing the working soapRequest? This way you're helping future users of $.soap that run into your problem. Thanx! Why is it async? The popular answer would be, cause it's 2013? The technical answer is, because $.ajax is async. And
Besides, I'd advise you to use async calls, since they don't block up the browser like sync does. It might need a change in your programming from linear to event-driven. But it will surely pay off. As a programmer, you can just continue with doing stuff in the page, while your browser is doing the $.soap call... PS: I edited our previous posts to delete quoted emails due to reply-on-reply.... So this issue is now a bit better readable. |
Sure... here’s the whole thing and you can edit it so it makes sense to subsequent readers. var wsURI = 'http://Server_Name/net/LMWAPI/Service1.asmx' in body onload function: $.soap({ in the call: function makeRequest(_trackAPI, myParams) { myParams = '<' + _trackAPI + ' xmlns="SCORM12">' + myParams + '</' + _trackAPI + '>'; // this was what made it work $.soap({ Thanks for all your help. I have one more question but it’s different so I’ll open a new ticket. sr |
I'm trying to upgrade my clients that call a VB.net web service using jquery.soap that I just downloaded. I'm getting an error "Server did not recognize the value of HTTP Header SOAPAction: LMSLaunch". My JavaScript code looks like:
[code]
myParams = { course: course_int, lesson: lesson_int, etc..... }
$.soap({
url: 'www.server.com/Net/LMWAPI/service1.asmx',
namespaceQualifier: 'SCORM12/',
namespaceUrl: 'urn://service1.www.server.com', // don't really know what to put here
method: 'LMSLaunch',
params: myParams,
success: function (soapResponse) {
debugger
}
request: function (SOAPRequest) {
debugger
},
error: function (SOAPResponse) {
debugger
}
});
[/code]
In the web service I really have two different API's for the LMSLaunch method, one for RPC and another. With the "string params" removed for clarity the VB web service code looks like:
[code]
<WebService(Namespace:="SCORM12/" Description:="A .NET API")> _
Public Class Service1
<WebMethod(Description:="Launchs a SCO")> _
Public Function LMSLaunch(...string params...) As String
and
<SoapRpcMethod("SCORM12/LMSLaunchRPC", _
requestnamespace:="SCORM12/", _
responsenamespace:="SCORM12/"), _
WebMethod(Description:="Stub for RPC communication")> _
Public Function LMSLaunchRPC(...string params...) As String
[/code]
So, can you tell me (1) what I've done wrong and (2) what the namespaceUrl really should be?
The text was updated successfully, but these errors were encountered: