|    
|
|  |
From: "Vince C." Subject: Help needed on using SoapServer.SoapInvoke *without* ASP Req... Date: Tue, 4 Jun 2002 00:45:46 +0200
| |
Hi all, I'm trying to write an ASP where I'm reading form fields to create a SOAP message and process it using the SoapInvoke method of a SoapServer object. Unfortunately, all I succeed in getting is a "Bad server request" error message. Can someone point some direction I can follow, please? Here is the code for the modified ASP that was generated by the WSDL wizard: ... ' Determine if we're using SOAP client (SOAPAction HTTP header exists) If Len(Request.ServerVariables("HTTP_SOAPACTION")) Then SoapServer.SoapInvoke Request, Response, "" Else SoapServer.SoapInvoke ProcessPost(), Response, """http://tempuri.org/action/HelloServer." & Request.Form("Method") & """" End If ... Function CreateElement( ByVal szName, ByVal szValue, ByVal nsURI ) ' Create an empty document; serves as a node factory Dim xmlDoc: Set xmlDoc = Server.CreateObject("MSXML2.DOMDocument") ' Create a NODE_ELEMENT (1) from an empty document and set its value Dim n: Set n = xmlDoc.createNode( 1, szName, nsURI ) ' Optionally set the node value and return the element If Len(szValue) Then n.Text = szValue Set CreateElement = n End Function Function ProcessPost ' First create a SOAP message Dim Msg: Set Msg = Server.CreateObject("MSSMO.SoapMessage") ' Then append method child node: use Request.Form() fields to fill a SOAP message Dim n: Set n = CreateElement( "m:" & Request.Form("Method"), "", "http://tempuri.org/message/" ) Select Case Request.Form("Method") Case "sayHelloTo" n.appendChild CreateElement("Name", Request.Form("Name"), "") Case "addNumbers" n.appendChild CreateElement("Number1", Request.Form("Number1"), "") n.appendChild CreateElement("Number2", Request.Form("Number2"), "") End Select ' Add methods to the message body Msg.BodyParts.BodyElement.appendChild n ProcessPost = "<?xml version=""1.0"" encoding=""UTF-8"" standalone=""no"" ?>" & vbCrLf & Msg.XML End Function Can someone tell me what is wrong? Thanks in advance. Vince C.
| | Post a follow up to this message... |
|  |
|