From: Kurt \(Coworks\) <ku...@co...> - 2006-03-23 13:07:36
|
Hi, =20 I=92m creating a soap interaction using nusoap (of course=85). All I = have about the system I=92m sending to is an example in VB, it=92s included below. The system uses winHTTP authentication (so not the available basic) and some proxy. I can=92t seem to get this done using nusoap (if even possible?), so any suggestions/help is really welcome=85 (I=92m willing to pay for some help, because it=92s something I need = asap=85) =20 Thanks in advance to anyone who takes the time to respond. =20 Sincerely, =20 Kurt Maet =20 =20 ---VB Public Function Post_Xml() On Local Error GoTo Erreur_ Dim Serializer As SoapSerializer30 Set Serializer =3D New SoapSerializer30 =20 Dim Reader As SoapReader30 Set Reader =3D New SoapReader30 =20 Dim Connector As SoapConnector30 Set Connector =3D New HttpConnector30 =20 Dim Composer As DimeComposer30 Set Composer =3D New DimeComposer30 =20 Dim lCnt As Long Dim Attach As MSSOAPLib30.FileAttachment30 =20 Screen.MousePointer =3D vbHourglass =20 If Form1.UseProxy Then Connector.Property("WinHTTPAuthScheme") =3D 24 Connector.Property("ProxyServer") =3D Form1.TxtProxy.Text Connector.Property("ProxyUser") =3D Form1.TxtUser.Text Connector.Property("ProxyPassword") =3D Form1.TxtPassword.Text Connector.Property("EnableAutoProxy") =3D True End If 'Connector.Property("UseSSL") =3D False 'Connector.Property("SSLClientCertificateName") =3D "" =20 Connector.Property("Timeout") =3D "30000" ' 30sec Connector.Property("AuthUser") =3D Form1.TxtUser.Text Connector.Property("AuthPassword") =3D Form1.TxtPassword.Text =20 =20 Connector.Property("EndPointURL") =3D Form1.txtUrl.Text '& "?WSDL" =20 Connector.Property("SoapAction") =3D Form1.txtNamespace.Text + Form1.txtMethod.Text Connector.Connect =20 Connector.BeginMessage =20 Serializer.InitWithComposer Connector.InputStream, Composer =20 Serializer.StartEnvelope Serializer.StartBody Serializer.StartElement Form1.txtMethod.Text, Form1.txtNamespace.Text Serializer.EndElement Serializer.EndBody Serializer.EndEnvelope =20 For lCnt =3D 0 To Form1.oListFile.ListCount - 1 If (InStr(1, Form1.oListFile.List(lCnt), ".txt") =3D 0) Then Set Attach =3D New MSSOAPLib30.FileAttachment30 Attach.FileName =3D Form1.oListFile.Path & "\" & Form1.oListFile.List(lCnt) Attach.Property("DimeTNF") =3D "media-type" Attach.Property("DimeID") =3D Form1.oListFile.List(lCnt) Attach.Property("DimeType") =3D getMimeType(Form1.oListFile.List(lCnt)) Serializer.AddAttachment Attach Set Attach =3D Nothing End If Next =20 Serializer.Finished Connector.EndMessage Screen.MousePointer =3D vbNormal =20 Reader.Load Connector.OutputStream If Not Reader.Envelope Is Nothing Then Form1.txtResult.Text =3D Form1.txtResult.Text & Reader.Envelope.nodeTypedValue WriteTcmFile Form1.oListFile.Path & "\", Reader.Envelope.childNodes(1).nodeTypedValue Else txtResult.ForeColor =3D 192 Form1.txtResult.Text =3D Form1.txtResult.Text & "Enveloppe VIDE !!" WriteLogMsg Form1.oListFile.Path, Form1.txtResult.Text End If =20 Form1.txtResult.Text =3D Replace(Form1.txtResult.Text, """, = ";") Form1.txtResult.Text =3D Replace(Form1.txtResult.Text, "Z", vbCrLf) Form1.txtResult.Text =3D Replace(Form1.txtResult.Text, "<", "<") Form1.txtResult.Text =3D Replace(Form1.txtResult.Text, ">", ">") Form1.txtResult.Text =3D Form1.txtResult.Text & vbCrLf & "=B0=B0=B0=B0=B0=B0=B0=B0=B0=B0=B0=B0=B0=B0=B0=B0=B0=B0=B0=B0=B0=B0=B0=B0= =B0=B0=B0=B0=B0=B0=B0=B0=B0=B0=B0=B0=B0" & vbCrLf Form1.txtResult.Text =3D Form1.txtResult.Text & vbCrLf Exit Function Erreur_: Screen.MousePointer =3D vbNormal Form1.txtResult.ForeColor =3D 192 Form1.txtResult.Text =3D Form1.txtResult.Text & IIf(Form1.txtResult.Text <> "", vbCrLf, "") & _ "Error Description" & vbCrLf & _ "=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D" & = vbCrLf & _ "- " & Err.Description & vbCrLf Form1.txtResult.Text =3D Replace(Form1.txtResult.Text, """, = ";") Form1.txtResult.Text =3D Replace(Form1.txtResult.Text, "Z", vbCrLf) Form1.txtResult.Text =3D Replace(Form1.txtResult.Text, "<", "<") Form1.txtResult.Text =3D Replace(Form1.txtResult.Text, ">", ">") WriteLogMsg Form1.oListFolder, Form1.txtResult.Text End Function |