Calling .Net WS with Mozilla SOAP API


S

Steve Ricketts

I've written a .Net web service running on IIS, W2K Server and using
IE with the webservice.htc behavior to call it and all works fine.
However, when I call the web service with Mozilla using the its SOAP
API, the message is received by the web service but all the parameters
equate to "Nothing". I've checked the outgoing message and the values
are in the message sent by Mozilla to the .Net web service, but not
picked up.

I change the code to return data when the parameters are empty and I'm
able to get data from the .Net web service into Mozilla. I've
searched everywhere and just can't find anything on how you can talk
to a .Net web service from Mozilla's SOAP API. Surely, this is
something that lots of people must want to be doing, but I can't
figure out what I'm doing wrong.

Anyway, here's a summary of my situation

1. MS .Net Web Service written in Visual Studio 2003 VB, on W2K Server
2. IE with webservice.htc works fine
3. Call the service with Mozilla SOAP API, values are sent fine
4. .Net Web Service receives message, runs method, but parameters are
empty
5. Mozilla can receive .Net responses
6. Copies of messages and code below

Any direction you can give is greatly appreciated. I've been
struggling with this problem for a long, long time. Thanks very much
for any information you can provide.

Steve Ricketts

The web method on the server side looks like:

<WebMethod(Description:="Launchs a SCO")> _
Public Function LMSLaunch(ByVal org_int As String, ByVal person_int As
String, ByVal course_int As String, ByVal sco_identifier As String,
ByVal
strData As String) As String

The Javascript in Mozilla looks like:

var method = "LMSLaunch"
var soapVersion = 0
var headers = [ ]
var params = [
new SOAPParameter(org_int,"org_int"),
new SOAPParameter(person_int,"person_int"),
new SOAPParameter(course_int,"course_int"),
new SOAPParameter(SCO,"sco_identifier"),
new SOAPParameter("<%=url%>","strData")
]

var CADEAPI = new SOAPCall();
CADEAPI.transportURI =
"http://www.velocedge.com/net/LMWAPI/service1.asmx"
CADEAPI.actionURI = "SCORM12/" + method
CADEAPI.encode(soapVersion, method, "SCORM12/", headers.length,
headers,
params.length, params)
var results = CADEAPI.invoke()

if (results.fault) {
alert(results.fault.faultString)
}
else {
var returnValue = new Array()
returnValue = results.getParameters(false,{})
alert('Returned ' + returnValue[0].value)
}

Copies of SOAP messages follow:

SOAP Message Sent From IE
<?xml version='1.0'?>
<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:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="SCORM12/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<LMSLaunch xmlns="SCORM12/">
<org_int>99</org_int>
<person_int>9</person_int>
<course_int>67</course_int>
<sco_identifier></sco_identifier>
<strData>0</strData></LMSLaunch></SOAP-ENV:Body>
</SOAP-ENV:Envelope>


SOAP Message From Mozilla:
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xs="http://www.w3.org/1999/XMLSchema"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"><env:Header/><env:Body><a0:LMSLaunch
xmlns:a0="SCORM12/"><org_int
xsi:type="xs:string">99</org_int><person_int
xsi:type="xs:string">9</person_int><course_int
xsi:type="xs:string">67</course_int><sco_identifier
xsi:type="xs:string">1</sco_identifier><strData
xsi:type="xs:string">http://www.velocedge.com/LMWi/net/1_2/CADEcontent.htm</strData></a0:LMSLaunch></env:Body></env:Envelope>

Test return from .Net web service to Mozilla
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.0
Date: Sun, 22 Feb 2004 21:04:05 GMT
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 368

<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><LMSTestResponse
xmlns="SCORM12/"><LMSTestResult xsi:type="xsd:string">I can return
data</LMSTestResult></LMSTestResponse></soap:Body></soap:Envelope>
 
Ad

Advertisements

D

Dan Rogers

Hi Steve,

What it sounds like to me is a namespace mismatch problem. In your sample
code, it appears that you are picking up the parameter namespace from the
web service namespace. If the Mozilla SOAP request doesn't put the
parameters in the correct namespace, the symptom on the web service side
will be that the parameters to the call were all empty or null.

If the Mozilla SOAP interface is SOAP compliant, it will provide a way for
you to put your request into the right namespace, which will allow the
values being passed to be seen.

I hope this helps,

Dan Rogers (danro)
Microsoft Corporation
--------------------
From: (e-mail address removed) (Steve Ricketts)
Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
Subject: Calling .Net WS with Mozilla SOAP API
Date: 23 Feb 2004 01:18:24 -0800
Organization: http://groups.google.com
Lines: 124
Message-ID: <[email protected]>
NNTP-Posting-Host: 68.201.104.194
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1077527904 20628 127.0.0.1 (23 Feb 2004 09:18:24 GMT)
X-Complaints-To: (e-mail address removed)
NNTP-Posting-Date: Mon, 23 Feb 2004 09:18:24 +0000 (UTC)
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!newsfee
d01.sul.t-online.de!t-online.de!fu-berlin.de!postnews1.google.com!not-for-ma
il
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet.webservices:21968
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices

I've written a .Net web service running on IIS, W2K Server and using
IE with the webservice.htc behavior to call it and all works fine.
However, when I call the web service with Mozilla using the its SOAP
API, the message is received by the web service but all the parameters
equate to "Nothing". I've checked the outgoing message and the values
are in the message sent by Mozilla to the .Net web service, but not
picked up.

I change the code to return data when the parameters are empty and I'm
able to get data from the .Net web service into Mozilla. I've
searched everywhere and just can't find anything on how you can talk
to a .Net web service from Mozilla's SOAP API. Surely, this is
something that lots of people must want to be doing, but I can't
figure out what I'm doing wrong.

Anyway, here's a summary of my situation

1. MS .Net Web Service written in Visual Studio 2003 VB, on W2K Server
2. IE with webservice.htc works fine
3. Call the service with Mozilla SOAP API, values are sent fine
4. .Net Web Service receives message, runs method, but parameters are
empty
5. Mozilla can receive .Net responses
6. Copies of messages and code below

Any direction you can give is greatly appreciated. I've been
struggling with this problem for a long, long time. Thanks very much
for any information you can provide.

Steve Ricketts

The web method on the server side looks like:

<WebMethod(Description:="Launchs a SCO")> _
Public Function LMSLaunch(ByVal org_int As String, ByVal person_int As
String, ByVal course_int As String, ByVal sco_identifier As String,
ByVal
strData As String) As String

The Javascript in Mozilla looks like:

var method = "LMSLaunch"
var soapVersion = 0
var headers = [ ]
var params = [
new SOAPParameter(org_int,"org_int"),
new SOAPParameter(person_int,"person_int"),
new SOAPParameter(course_int,"course_int"),
new SOAPParameter(SCO,"sco_identifier"),
new SOAPParameter("<%=url%>","strData")
]

var CADEAPI = new SOAPCall();
CADEAPI.transportURI =
"http://www.velocedge.com/net/LMWAPI/service1.asmx"
CADEAPI.actionURI = "SCORM12/" + method
CADEAPI.encode(soapVersion, method, "SCORM12/", headers.length,
headers,
params.length, params)
var results = CADEAPI.invoke()

if (results.fault) {
alert(results.fault.faultString)
}
else {
var returnValue = new Array()
returnValue = results.getParameters(false,{})
alert('Returned ' + returnValue[0].value)
}

Copies of SOAP messages follow:

SOAP Message Sent From IE
<?xml version='1.0'?>
<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:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s0="SCORM12/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<LMSLaunch xmlns="SCORM12/">
<org_int>99</org_int>
<person_int>9</person_int>
<course_int>67</course_int>
<sco_identifier></sco_identifier>
<strData>0</strData></LMSLaunch></SOAP-ENV:Body>
</SOAP-ENV:Envelope>


SOAP Message From Mozilla:
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xs="http://www.w3.org/1999/XMLSchema"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"><env:Header/><env:Bod y><a0:LMSLaunch
xmlns:a0="SCORM12/"><org_int
xsi:type="xs:string">99</org_int><person_int
xsi:type="xs:string">9</person_int><course_int
xsi:type="xs:string">67</course_int><sco_identifier
xsi:type="xs:string">1</sco_identifier><strData
xsi:type="xs:string">http://www.velocedge.com/LMWi/net/1_2/CADEcontent.htm<
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top