Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems sending XML to a Server 2

Status
Not open for further replies.

WalterJolon

Programmer
Jul 22, 2004
23
GT
I'm trying to send XML but it doesn't work, someone help me please!

This is the code:

**********************************************************

Create Cursor CurXML(Respuesta M)

** Estructura XML
strXML = "<?xml version='1.0' encoding='utf-8'?><Root><Item>ID1</Item><Item>ID2</Item></Root>"

** Carga Estructura XML
vDoc = CreateObject('Msxml2.DOMDocument')
_Sync = vDoc.async = .F.
_Load = vDoc.loadXML(strXML)

** Envia Estructura XML
TRANS_CERTIFICATE_NAME="0000001266"
vEnv = CreateObject('Msxml2.XMLHTTP')
_Open = vEnv.open('POST','_SetR = vEnv.setRequestHeader("Content-Type", "application/x-_Send = vEnv.send(vDoc)

** Respuesta
Select CurXML
Append Blank
Replace Next 1 Respuesta With vEnv.responseText

****************************************************

This is that I'm getting back:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap=" xmlns:xsi=" xmlns:xsd=" <soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>Unable to handle request without a valid action parameter. Please supply a valid soap action.</faultstring>
<detail />
</soap:Fault>
</soap:Body>
</soap:Envelope>

Walter Geovanny Jolon Ruiz
Guatemala, C.A.
 
Based on the response, "Unable to handle request without a valid action parameter. Please supply a valid soap action", you need to use an XML message which conforms to SOAP, not just an arbitrary XML message, because that error means that the server got your XML but didn't recognize what you meant by it.

Here's a sample SOAP message (taken from ):
Code:
<?xml version='1.0' ?>
<env:Envelope xmlns:env="[URL unfurl="true"]http://www.w3.org/2003/05/soap-envelope">[/URL] 
 <env:Header>
  <m:reservation xmlns:m="[URL unfurl="true"]http://travelcompany.example.org/reservation"[/URL] 
          env:role="[URL unfurl="true"]http://www.w3.org/2003/05/soap-envelope/role/next"[/URL]
           env:mustUnderstand="true">
   <m:reference>uuid:093a2da1-q345-739r-ba5d-pqff98fe8j7d</m:reference>
   <m:dateAndTime>2001-11-29T13:20:00.000-05:00</m:dateAndTime>
  </m:reservation>
  <n:passenger xmlns:n="[URL unfurl="true"]http://mycompany.example.com/employees"[/URL]
          env:role="[URL unfurl="true"]http://www.w3.org/2003/05/soap-envelope/role/next"[/URL]
           env:mustUnderstand="true">
   <n:name>Åke Jógvan Øyvind</n:name>
  </n:passenger>
 </env:Header>
 <env:Body>
  <p:itinerary
    xmlns:p="[URL unfurl="true"]http://travelcompany.example.org/reservation/travel">[/URL]
   <p:departure>
     <p:departing>New York</p:departing>
     <p:arriving>Los Angeles</p:arriving>
     <p:departureDate>2001-12-14</p:departureDate>
     <p:departureTime>late afternoon</p:departureTime>
     <p:seatPreference>aisle</p:seatPreference>
   </p:departure>
   <p:return>
     <p:departing>Los Angeles</p:departing>
     <p:arriving>New York</p:arriving>
     <p:departureDate>2001-12-20</p:departureDate>
     <p:departureTime>mid-morning</p:departureTime>
     <p:seatPreference/>
   </p:return>
  </p:itinerary>
  <q:lodging
   xmlns:q="[URL unfurl="true"]http://travelcompany.example.org/reservation/hotels">[/URL]
   <q:preference>none</q:preference>
  </q:lodging>
 </env:Body>
</env:Envelope>

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Thanx a lot Bill, your post was exactly what I was looking for, I really appreciate that.

Regards!

Walter Geovanny Jolon Ruiz
Guatemala, C.A.
 
Glad to Help!

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top