Git Product home page Git Product logo

Comments (10)

doedje avatar doedje commented on May 20, 2024

you might try adding appendMethodToURL: false to the options.....?

from jquery.soap.

Velocedge avatar Velocedge commented on May 20, 2024

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
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
soap:Body
<SCORM12/:LMSLaunch xmlns:SCORM12/="urn://service1.learnnet">
<SCORM12/:org_int>98</SCORM12/:org_int>
<SCORM12/:person_int>9</SCORM12/:person_int>
<SCORM12/:course_int>3895</SCORM12/:course_int>
<SCORM12/:lesson_int>0</SCORM12/:lesson_int>
<SCORM12/:sco_identifier></SCORM12/:sco_identifier>
<SCORM12/:test_int>915599</SCORM12/:test_int>
<SCORM12/:strData>0</SCORM12/:strData>
</SCORM12/:LMSLaunch>
/soap:Body
/soap:Envelope

And the one created by the webservice.htc behavior:

<SOAP-ENV:Envelope xmlns=""
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tns="SCORM12/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

SOAP-ENV:Body

<org_int>98</org_int>
<person_int>9</person_int>
<course_int>3895</course_int>
<lesson_int>0</lesson_int>
<sco_identifier></sco_identifier>
<test_int>915599</test_int>
0

/SOAP-ENV:Body
/SOAP-ENV:Envelope

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/">
soap:Body

<org_int>98</org_int>
<person_int>9</person_int>
<course_int>3895</course_int>
<lesson_int>0</lesson_int>
<sco_identifier></sco_identifier>
<test_int>915599</test_int>
0

/soap:Body
/soap:Envelope

Hopefully, this rambling will give you some ideas what I’ve done wrong.

from jquery.soap.

Velocedge avatar Velocedge commented on May 20, 2024

Also, is the namespaceUrl: 'urn://service1.www.server.com' correct? I'm not sure where that fits in.

from jquery.soap.

doedje avatar doedje commented on May 20, 2024

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 [email protected] wrote:

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
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
soap:Body
<SCORM12/:LMSLaunch xmlns:SCORM12/="urn://service1.learnnet">
<SCORM12/:org_int>98</SCORM12/:org_int>
<SCORM12/:person_int>9</SCORM12/:person_int>
<SCORM12/:course_int>3895</SCORM12/:course_int>
<SCORM12/:lesson_int>0</SCORM12/:lesson_int>
<SCORM12/:sco_identifier></SCORM12/:sco_identifier>
<SCORM12/:test_int>915599</SCORM12/:test_int>
<SCORM12/:strData>0</SCORM12/:strData>
</SCORM12/:LMSLaunch>
/soap:Body
/soap:Envelope

And the one created by the webservice.htc behavior:

<SOAP-ENV:Envelope xmlns=""
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tns="SCORM12/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

SOAP-ENV:Body

<org_int>98</org_int>
<person_int>9</person_int>
<course_int>3895</course_int>
<lesson_int>0</lesson_int>
<sco_identifier></sco_identifier>
<test_int>915599</test_int>
0

/SOAP-ENV:Body
/SOAP-ENV:Envelope

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/">
soap:Body

<org_int>98</org_int>
<person_int>9</person_int>
<course_int>3895</course_int>
<lesson_int>0</lesson_int>
<sco_identifier></sco_identifier>
<test_int>915599</test_int>
0

/soap:Body
/soap:Envelope

Hopefully, this rambling will give you some ideas what I’ve done wrong.

From: Remy Blom
Sent: Friday, April 05, 2013 6:04 AM
To: doedje/jquery.soap
Cc: Velocedge
Subject: Re: [jquery.soap] Using jquery.soap with VB.net web service (#4)

you might try adding appendMethodToURL: false to the options.....?


Reply to this email directly or view it on GitHub.

Reply to this email directly or view it on GitHub.

from jquery.soap.

Velocedge avatar Velocedge commented on May 20, 2024

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:
System.Web.Services.Protocols.SoapException: Unable to handle request without a valid action parameter. Please supply a valid soap action.

from jquery.soap.

doedje avatar doedje commented on May 20, 2024

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

from jquery.soap.

Velocedge avatar Velocedge commented on May 20, 2024

Here’s the latest for your morning reading pleasure...

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
soap:Body
<SCORM12:LMSLaunch xmlns:SCORM12="tns://SCORM12.learnnet">
SCORM12:org_int98/SCORM12:org_int
SCORM12:person_int9/SCORM12:person_int
SCORM12:course_int3895/SCORM12:course_int
SCORM12:lesson_int0/SCORM12:lesson_int
SCORM12:sco_identifier/SCORM12:sco_identifier
SCORM12:test_int915599/SCORM12:test_int
SCORM12:strData0/SCORM12:strData
/SCORM12:LMSLaunch
/soap:Body
/soap:Envelope

I’ll also attach a bunch of this in a file.

BTW, I really appreciate this. Thanks!

Steve
jquery.soap

SOAPRequest
{
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
soap:Body
<SCORM12/:LMSLaunch xmlns:SCORM12/="urn://service1.learnnet">
<SCORM12/:org_int>98</SCORM12/:org_int>
<SCORM12/:person_int>9</SCORM12/:person_int>
<SCORM12/:course_int>3895</SCORM12/:course_int>
<SCORM12/:lesson_int>0</SCORM12/:lesson_int>
<SCORM12/:sco_identifier></SCORM12/:sco_identifier>
<SCORM12/:test_int>915599</SCORM12/:test_int>
<SCORM12/:strData>0</SCORM12/:strData>
</SCORM12/:LMSLaunch>
/soap:Body
/soap:Envelope
}
soapNamespace: "http://schemas.xmlsoap.org/soap/envelope/"
typeOf: "SOAPRequest"

webservice.htc

<SOAP-ENV:Envelope xmlns=""
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tns="SCORM12/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

SOAP-ENV:Body

<org_int>98</org_int>
<person_int>9</person_int>
<course_int>3895</course_int>
<lesson_int>0</lesson_int>
<sco_identifier></sco_identifier>
<test_int>915599</test_int>
0

/SOAP-ENV:Body
/SOAP-ENV:Envelope
"

jquery.soap without namespace

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
soap:Body

<org_int>98</org_int>
<person_int>9</person_int>
<course_int>3895</course_int>
<lesson_int>0</lesson_int>
<sco_identifier></sco_identifier>
<test_int>915599</test_int>
0

/soap:Body<
/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:Body

<org_int>98</org_int>
<person_int>9</person_int>
<course_int>3895</course_int>
<lesson_int>0</lesson_int>
<sco_identifier></sco_identifier>
<test_int>915599</test_int>
0
</LMSLaunch xmlns="SCORM12/">
/soap:Body
/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 '>'.
System.Web.Services.Protocols.SoapException: Unable to handle request without a valid action parameter. Please supply a valid soap action.

last request:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
soap:Body
<SCORM12:LMSLaunch xmlns:SCORM12="tns://SCORM12.learnnet">
SCORM12:org_int98/SCORM12:org_int
SCORM12:person_int9/SCORM12:person_int
SCORM12:course_int3895/SCORM12:course_int
SCORM12:lesson_int0/SCORM12:lesson_int
SCORM12:sco_identifier/SCORM12:sco_identifier
SCORM12:test_int915599/SCORM12:test_int
SCORM12:strData0/SCORM12:strData
/SCORM12:LMSLaunch
/soap:Body
/soap:Envelope

from jquery.soap.

Velocedge avatar Velocedge commented on May 20, 2024

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/">
soap:Body

<org_int>98</org_int>
<person_int>9</person_int>
<course_int>3895</course_int>
<lesson_int>0</lesson_int>
<sco_identifier></sco_identifier>
<test_int>915599</test_int>
0

/soap:Body
/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

from jquery.soap.

doedje avatar doedje commented on May 20, 2024

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 $.soap uses $.ajax... There used to be a async: false option in $.ajax but:

As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done() or the deprecated jqXHR.success().

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.

from jquery.soap.

Velocedge avatar Velocedge commented on May 20, 2024

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'
var nameSpace = "SCORM12"

in body onload function:

$.soap({
url: wsURI,
namespaceQualifier: nameSpace,
appendMethodToURL: false,
soap12: true,
namespaceUrl: 'urn://SCORM12.learnnet',
request: function (SOAPRequest) {
//alert(SOAPRequest);
},
error: function (SOAPResponse) {
alert('SOAP Error ' + SOAPResponse);
}
});

in the call:

function makeRequest(_trackAPI, myParams) {

myParams = '<' + _trackAPI + ' xmlns="SCORM12">' + myParams + '</' + _trackAPI + '>'; // this was what made it work

$.soap({
method: _trackAPI,
params: myParams,
success: function (soapResponse) {
var x = soapResponse.toString();
prepValue(x);
}
}
});

Thanks for all your help. I have one more question but it’s different so I’ll open a new ticket.

sr

from jquery.soap.

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.