NAV web service - passing parameter problem on SOAP function

chuan214
Member Posts: 6
Hi,
I'm calling a Web Service from within NAV as follows:
and the web service method code is as code below
This is send email function by using NAV code calling web services. It is work on sending email by that codes above, however, i can't pass parameter of "SubjectSC" to that function.
Does anyone have any ideas on what could be wrong? ](*,)
Thanks in advance.
I'm calling a Web Service from within NAV as follows:
CREATE(locautXmlDoc,FALSE,TRUE); abc := 'jiki'; locautXmlDoc.async := FALSE; locautXmlDoc.loadXML( '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >'+ '<soap:Body>' + '<sendToSCTee xmlns:Temp="http://tempuri.org/">' + '<SubjectSC>'+abc+'</SubjectSC>' + '</sendToSCTee>'+ '</soap:Body>' + '</soap:Envelope>');
and the web service method code is as code below
public string sendToSCTee(string SubjectSC) { return smtpctrl.SendEmail("ab@xxx.com", null, null, IMailPriority.Normal, SubjectSC, IMailFormat.Html, "Testing", null, "CRONUS International Ltd_"); }
This is send email function by using NAV code calling web services. It is work on sending email by that codes above, however, i can't pass parameter of "SubjectSC" to that function.
Does anyone have any ideas on what could be wrong? ](*,)
Thanks in advance.
0
Comments
-
Create http connection like..
CREATE(XMLHttpConn,TRUE,TRUE);
XMLHttpConn.open(" Method name",Web Service URL", FALSE,HTTP Connection UserName", HTTP Connection Password");
XMLHttpConn.setRequestHeader('Host',HTTP Connection Host Name");
XMLHttpConn.setRequestHeader('SOAPAction',"Web Service Namespace" +
"Request Web Service Method");
XMLHttpConn.setRequestHeader('Content-Type',"HTTP Request Content-Type");
XMLHttpConn.send(locautXmlDoc);0 -
my coding is like that
CREATE(locautXmlHttp,true,TRUE); locautXmlHttp.open('POST','http://localhost:8282/siweb/WebServices/prq.asmx',0); locautXmlHttp.setRequestHeader('Content-Type', 'text/xml; charset=utf-8'); locautXmlHttp.setRequestHeader('SOAPAction','http://tempuri.org/sendToSCTee'); locautXmlHttp.send(locautXmlDoc);
how do i modify for the code above?0 -
Nagaraju17 wrote:Create http connection like..
CREATE(XMLHttpConn,TRUE,TRUE);
XMLHttpConn.open(" Method name",Web Service URL", FALSE,HTTP Connection UserName", HTTP Connection Password");
XMLHttpConn.setRequestHeader('Host',HTTP Connection Host Name");
XMLHttpConn.setRequestHeader('SOAPAction',"Web Service Namespace" +
"Request Web Service Method");
XMLHttpConn.setRequestHeader('Content-Type',"HTTP Request Content-Type");
XMLHttpConn.send(locautXmlDoc);0 -
Your sendToSCTee and SubjectSC elements are using the default namespace, the tag 'xmlns:Temp="http://tempuri.org/"' is just defining a namespace not using it.
I think web services more or less require namespaces to be set on all elements; perhaps you should remove the ':Temp' part.Robert de Bath
TVision Technology Ltd0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions