Problem with web service

Author: Jeff Johnson

Posted: 2015-02-22 at 13:57:54

Tracy: you helped me with this. Here is your code that works:

LOCAL oHttp as MSXML2.ServerXMLHTTP30

oHttp = CREATEOBJECT('msxml2.serverxmlhttp.3.0')

oHttp.open("post",

"http://support.itsonboarding.com/OnBoarding.svc", .F.)

oHttp.setRequestHeader("Accept", "text/xml")

oHttp.setRequestHeader("Content-Type", "text/xml;charset=UTF-8")

oHttp.setRequestHeader("SOAPAction",

"http://tempuri.org/IOnBoarding/GetInsurance")

TEXT TO postText NOSHOW

<soapenv:Envelope

xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"

xmlns:tem="" target="_blank">http://tempuri.org/">

<soapenv:Header/>

<soapenv:Body>

<tem:GetInsurance>

<tem:UserName>JS</tem:UserName>

<tem:Password>pa</tem:Password>

<tem:Token>hIzPN7YwfAsPpSQQ1HV2uGAU2IJTgigbn0R6yJuW959Ck6Yst4z3hg==</tem:Token>

</tem:GetInsurance>

</soapenv:Body>

</soapenv:Envelope>

ENDTEXT

oHttp.send(postText)

x = oHttp.responsexml.xml

I need to change the token each time so

Here is my code that does not work:

LOCAL oHttp as MSXML2.ServerXMLHTTP30

oHttp = CREATEOBJECT('msxml2.serverxmlhttp.3.0')

oHttp.open("post",

"http://support.itsonboarding.com/OnBoarding.svc", .F.)

oHttp.setRequestHeader("Accept", "text/xml")

oHttp.setRequestHeader("Content-Type", "text/xml;charset=UTF-8")

oHttp.setRequestHeader("SOAPAction",

"http://tempuri.org/IOnBoarding/GetInsurance")

postText = ''

postText = postText + '<soapenv:Envelope

xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"

xmlns:tem="'" target="_blank">http://tempuri.org/">' + crlf

postText = postText + ' <soapenv:Header/>' + crlf

postText = postText + ' <soapenv:Body>' + crlf

postText = postText + ' <tem:GetInsurance>' + crlf

postText = postText + ' <tem:UserName>JS</tem:UserName>' + crlf

postText = postText + ' <tem:Password>pa</tem:Password>' + crlf

postText = postText + ' <tem:Token>' + lctoken +

'</tem:Token>' + crlf

postText = postText + ' </tem:GetInsurance>' + crlf

postText = postText + ' </soapenv:Body>' + crlf

postText = postText + '</soapenv:Envelope>'

oHttp.send(postText)

x = oHttp.responsexml.xml

I tried it with crlf = chr(13) + chr(10) and also crlf = ''

Is the line delimiter wrong or what am I missing. I need to put that

token in each call.

--

Jeff

Jeff Johnson

jeff@san-dc.com

SanDC, Inc.

(623) 582-0323

SMS (602) 717-5476

Fax 623-869-0675

www.san-dc.com

www.cremationtracker.com

www.agentrelationshipmanager.com

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/54EA34C2.9080502@san-dc.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2015 Jeff Johnson