21. September 2007 10:31
21. April 2008 09:52
21. April 2008 14:17
19. Juni 2008 16:52
CLEAR(locautXmlDoc);
CLEAR(locautSoapHttpConnector);
CLEAR(locautSoapSerializer);
CREATE(locautSoapHttpConnector);
locautSoapHttpConnector.Property('EndPointURL', recSteuerdaten.WSDLAdresse);
locautSoapHttpConnector.Connect;
locautSoapHttpConnector.Property('AuthUser', recSteuerdaten.User);
locautSoapHttpConnector.Property('AuthPassword', recSteuerdaten.Passwort);
locautSoapHttpConnector.Property('Timeout', 5 * 1000);
locautSoapHttpConnector.Property('SoapAction',recSteuerdaten.ServiceAdresse);
locautSoapHttpConnector.BeginMessage;
CREATE(locautSoapSerializer);
locautSoapSerializer.Init(locautSoapHttpConnector.InputStream);
locautSoapSerializer.startEnvelope('SOAP','STANDARD');
locautSoapSerializer.startBody;
locautSoapSerializer.startElement('NameDesService');
locautSoapSerializer.startElement('login');
locautSoapSerializer.writeString(recSteuerdaten.User);
locautSoapSerializer.endElement;
locautSoapSerializer.startElement('password');
locautSoapSerializer.writeString(recSteuerdaten.Passwort);
locautSoapSerializer.endElement;
locautSoapSerializer.endElement;
locautSoapSerializer.endBody;
locautSoapSerializer.endEnvelope;
locautSoapHttpConnector.EndMessage;
CREATE(locautXmlDoc);
locautXmlDoc.load(locautSoapHttpConnector.OutputStream);
//optional, speichern des XML Files
locautXmlDoc.save('N:\XXX\'+Datumsformatierung+'_Getvt.xml');
XMLNodeList := locautXmlDoc.getElementsByTagName('item');
//MESSAGE(FORMAT(XMLNodeList.length));
FOR i := 0 TO XMLNodeList.length - 1 DO BEGIN
XMLNode := XMLNodeList.item(i);
XMLNode2 := XMLNode.selectSingleNode('Nodename');
IF XMLNode2.text <> ''
THEN BEGIN
ANWEISUNG
End;
END;
CLEAR(locautXmlDoc);
CLEAR(locautSoapHttpConnector);
CLEAR(locautSoapSerializer);
20. Juni 2008 12:34
POST /TranslateService.asmx HTTP/1.1
Host: www.webservicex.net
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://www.webservicex.net/Translate"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Translate xmlns="http://www.webservicex.net">
<LanguageMode>EnglishTOGerman</LanguageMode>
<Text>string</Text>
</Translate>
</soap:Body>
</soap:Envelope>
CREATE(locautSoapHttpConnector);
locautSoapHttpConnector.Property('EndPointURL', http://www.webservicex.net/TranslateService.asmx');
locautSoapHttpConnector.Connect;
locautSoapHttpConnector.Property('AuthUser', 'User');
locautSoapHttpConnector.Property('AuthPassword', 'Password');
locautSoapHttpConnector.Property('Timeout', 5 * 1000);
locautSoapHttpConnector.Property('SoapAction','http://www.webservicex.net/Translate');
locautSoapHttpConnector.BeginMessage;
CREATE(locautSoapSerializer);
locautSoapSerializer.Init(locautSoapHttpConnector.InputStream);
locautSoapSerializer.startEnvelope('SOAP','STANDARD');
locautSoapSerializer.startBody;
locautSoapSerializer.startElement('Translate');
locautSoapSerializer.startElement('LanguageMode');
locautSoapSerializer.writeString('EnglishTOGerman');
locautSoapSerializer.endElement;
locautSoapSerializer.startElement('Text');
locautSoapSerializer.writeString('master');
locautSoapSerializer.endElement;
locautSoapSerializer.endElement;
locautSoapSerializer.endBody;
locautSoapSerializer.endEnvelope;
locautSoapHttpConnector.EndMessage;
CREATE(locautXmlDoc);
locautXmlDoc.load(locautSoapHttpConnector.OutputStream);
locautXmlDoc.save('c:\temp1.xml');
<?xml version="1.0" encoding="utf-8" ?>
- <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <soap:Body>
- <TranslateResponse xmlns="http://www.webservicex.net">
<TranslateResult>Value cannot be null. Parameter name: translationmode</TranslateResult>
</TranslateResponse>
</soap:Body>
</soap:Envelope>
24. Juni 2008 16:22
9. Dezember 2010 11:54
CLEAR(locautXmlDoc);
CLEAR(locautSoapHttpConnector);
CLEAR(locautSoapSerializer);
CREATE(locautSoapHttpConnector);
locautSoapHttpConnector.Property('EndPointURL', 'http://www.webservicex.net/TranslateService.asmx');
locautSoapHttpConnector.Connect;
locautSoapHttpConnector.Property('Timeout', 5 * 1000);
locautSoapHttpConnector.Property('SoapAction','http://www.webservicex.net/Translate');
locautSoapHttpConnector.BeginMessage;
CREATE(locautSoapSerializer);
locautSoapSerializer.Init(locautSoapHttpConnector.InputStream);
locautSoapSerializer.StartEnvelope('SOAP','STANDARD');
locautSoapSerializer.StartBody;
locautSoapSerializer.StartElement('EnglishTOGerman');
locautSoapSerializer.StartElement('Text');
locautSoapSerializer.WriteString('Hello');
locautSoapSerializer.EndElement;
locautSoapSerializer.EndElement;
locautSoapSerializer.EndBody;
locautSoapSerializer.EndEnvelope;
CLEAR(locautXmlDoc);
locautSoapHttpConnector.EndMessage;
CREATE(locautXmlDoc);
locautXmlDoc.load(locautSoapHttpConnector.OutputStream);
locautXmlDoc.save('c:\testxmloutput1.xml');
CLEAR(locautXmlDoc);
CLEAR(locautSoapHttpConnector);
CLEAR(locautSoapSerializer);
<soap:Envelope>
<soap:Body>
<TranslateResponse>
<TranslateResult>
Value cannot be null.
Parameter name: translationmode
</TranslateResult>
</TranslateResponse>
</soap:Body>
</soap:Envelope>
10. Dezember 2010 10:24
10. Dezember 2010 13:10
{
Name DataType Subtype Length
XMLDOMDocument Automation 'Microsoft XML, v5.0'.DOMDocument50
XMLDOMDocument2 Automation 'Microsoft XML, v5.0'.DOMDocument50
CurrNode Automation 'Microsoft XML, v5.0'.IXMLDOMNode
BaseNode Automation 'Microsoft XML, v5.0'.IXMLDOMNode
NewChild Automation 'Microsoft XML, v5.0'.IXMLDOMNode
XMLDOMManagement Codeunit XML DOM Management
DocNameSpace Text 200
locautXmlHttp Automation 'Microsoft XML, v5.0'.XMLHTTP
LocXMLNodeList Automation 'Microsoft XML, v5.0'.IXMLDOMNodeList
LocXMLNode Automation 'Microsoft XML, v5.0'.IXMLDOMNode
ItemCount Integer
i Integer
}
CLEAR(XMLDOMDocument);
CLEARALL;
IF NOT CREATE(XMLDOMDocument) THEN
EXIT;
XMLDOMDocument.loadXML := '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"/>';
CurrNode := XMLDOMDocument.documentElement;
DocNameSpace := 'http://schemas.xmlsoap.org/soap/envelope/';
WITH XMLDOMManagement DO BEGIN
XMLDOMManagement.SetNormalCase;
IF AddElement(CurrNode,'soapenv:Header','',DocNameSpace,NewChild) > 0 THEN
EXIT;
IF AddElement(CurrNode,'soapenv:Body','',DocNameSpace,NewChild) > 0 THEN
EXIT;
CurrNode := NewChild;
DocNameSpace :='weiterer Namespace';
IF AddElement(CurrNode,'nav:GetLoginFromRegNr','',DocNameSpace,NewChild) > 0 THEN
EXIT;
CurrNode := NewChild;
IF AddElement(CurrNode,'nav:regNr','Daten',DocNameSpace,NewChild) > 0 THEN
EXIT;
END;
CREATE(locautXmlHttp);
locautXmlHttp.open('POST','http://url des Services/Service.asmx',0);
locautXmlHttp.setRequestHeader('Content-type','text/xml');
locautXmlHttp.setRequestHeader('charset','utf-8');
locautXmlHttp.setRequestHeader('SOAPAction','url des speziellen Dienstes');
locautXmlHttp.send(XMLDOMDocument);
IF ISCLEAR(XMLDOMDocument2) THEN
CREATE(XMLDOMDocument2);
XMLDOMDocument2.async := FALSE;
XMLDOMDocument2.load(locautXmlHttp.responseXML);
IF locautXmlHttp.status = 200 THEN BEGIN
LocXMLNode := XMLDOMDocument2.documentElement();
i := 0;
REPEAT
i += 1;
LocXMLNode := LocXMLNode.firstChild;
UNTIL (LocXMLNode.nodeName = 'Error') OR (i = 20);
IF LocXMLNode.text ='Success' THEN BEGIN
MESSAGE(FORMAT(LocXMLNode.text));
//Zum Tag Login springen
LocXMLNode := LocXMLNode.nextSibling;
MESSAGE(LocXMLNode.nodeName);
//Liste der Tags unter Login
LocXMLNodeList := LocXMLNode.childNodes;
ItemCount := LocXMLNodeList.length;
MESSAGE(FORMAT(ItemCount));
LocXMLNode := LocXMLNode.firstChild;
END ELSE BEGIN
MESSAGE(FORMAT( LocXMLNode.text));
END;
END ELSE BEGIN
MESSAGE('%1', locautXmlHttp.status);
END;
CLEARALL;
11. November 2011 10:24
MrAbbey hat geschrieben:Hi,
Wir nutzen die Microsoft SOAP.dll und die XML.dll. Folgender Code zeigt einen einfachen Aufbau einer Anfrage. Funktioniert in beide Richtungen und ist sehr stabil.
Gruß
- Code:
CLEAR(locautXmlDoc);
CLEAR(locautSoapHttpConnector);
CLEAR(locautSoapSerializer);
CREATE(locautSoapHttpConnector);
locautSoapHttpConnector.Property('EndPointURL', recSteuerdaten.WSDLAdresse);
locautSoapHttpConnector.Connect;
locautSoapHttpConnector.Property('AuthUser', recSteuerdaten.User);
locautSoapHttpConnector.Property('AuthPassword', recSteuerdaten.Passwort);
locautSoapHttpConnector.Property('Timeout', 5 * 1000);
locautSoapHttpConnector.Property('SoapAction',recSteuerdaten.ServiceAdresse);
locautSoapHttpConnector.BeginMessage;
CREATE(locautSoapSerializer);
locautSoapSerializer.Init(locautSoapHttpConnector.InputStream);
locautSoapSerializer.startEnvelope('SOAP','STANDARD');
locautSoapSerializer.startBody;
locautSoapSerializer.startElement('NameDesService');
locautSoapSerializer.startElement('login');
locautSoapSerializer.writeString(recSteuerdaten.User);
locautSoapSerializer.endElement;
locautSoapSerializer.startElement('password');
locautSoapSerializer.writeString(recSteuerdaten.Passwort);
locautSoapSerializer.endElement;
locautSoapSerializer.endElement;
locautSoapSerializer.endBody;
locautSoapSerializer.endEnvelope;
locautSoapHttpConnector.EndMessage;
CREATE(locautXmlDoc);
locautXmlDoc.load(locautSoapHttpConnector.OutputStream);
//optional, speichern des XML Files
locautXmlDoc.save('N:\XXX\'+Datumsformatierung+'_Getvt.xml');
XMLNodeList := locautXmlDoc.getElementsByTagName('item');
//MESSAGE(FORMAT(XMLNodeList.length));
FOR i := 0 TO XMLNodeList.length - 1 DO BEGIN
XMLNode := XMLNodeList.item(i);
XMLNode2 := XMLNode.selectSingleNode('Nodename');
IF XMLNode2.text <> ''
THEN BEGIN
ANWEISUNG
End;
END;
CLEAR(locautXmlDoc);
CLEAR(locautSoapHttpConnector);
CLEAR(locautSoapSerializer);
28. Dezember 2011 12:33
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:man="http://futureware.biz/mantisconnect">
<soapenv:Header/>
<soapenv:Body>
<man:mc_issue_get_biggest_id soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<username xsi:type="xsd:string">Administrator</username>
<password xsi:type="xsd:string">root</password>
<project_id xsi:type="xsd:integer">1</project_id>
</man:mc_issue_get_biggest_id>
</soapenv:Body>
</soapenv:Envelope>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:mc_issue_get_biggest_idResponse xmlns:ns1="http://futureware.biz/mantisconnect">
[color=#FF0000]<return xsi:type="xsd:integer">5</return>[/color]
</ns1:mc_issue_get_biggest_idResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>