Delphi 2007은 Java-WS 웹 서비스로 보내고 싶은 XML을 생성하지 않습니다.
-
11-09-2019 - |
문제
WSDL 수입업자를 사용하여 Delphi 2007 앱에서 링크 한 Java 웹 서비스가 있습니다. 설정을 설정했습니다 록키로드 그러나 나는 거의 거기에있다!
이제 Java 웹 서비스가 소비 할 수있는 방식으로 어레이가 직렬화되지 않는 상황이 있습니다. .NET에 동일한 앱을 작성하여 테스트하고 (잘 작동합니다) 생성하려는 XML은 다음과 같이 보입니다.
<?xml version="1.0"?>
<SOAP-ENV:Envelope
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 xmlns:NS2="http://path.to.service">
<NS1:addActivities xmlns:NS1="http://path.to.service/">
<login href="#1"/>
<project xsi:type="xsd:string">PROJ001</project>
<activities>
<id xsi:type="xsd:string">DELPHITEST</id>
<name xsi:type="xsd:string">This is a test</name>
</activities>
<activities>
<id xsi:type="xsd:string">DELPHITEST2</id>
<name xsi:type="xsd:string">This is another test</name>
</activities>
</NS1:addActivities>
<NS2:login id="1" xsi:type="NS2:login">
<database xsi:type="xsd:string">My_database</database>
<password xsi:type="xsd:string">neverUmind</password>
<username xsi:type="xsd:string">bob</username>
</NS2:login>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
그러나 델파이가 생성하는 XML은 다음과 같습니다.
<?xml version="1.0"?>
<SOAP-ENV:Envelope
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 xmlns:NS2="http://path.to.service/">
<NS1:addActivities xmlns:NS1="http://path.to.service/">
<login href="#1"/>
<project xsi:type="xsd:string">PROJ001</project>
<activities xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="NS2:activity[2]">
<item href="#2"/>
<item href="#3"/>
</activities>
</NS1:addActivities>
<NS2:login id="1" xsi:type="NS2:login">
<database xsi:type="xsd:string">My_database</database>
<password xsi:type="xsd:string">neverUmind</password>
<username xsi:type="xsd:string">bob</username>
</NS2:login>
<NS2:activity id="2" xsi:type="NS2:activity">
<id xsi:type="xsd:string">DELPHITEST</id>
<name xsi:type="xsd:string">This is a test</name>
</NS2:activity>
<NS2:activity id="3" xsi:type="NS2:activity">
<id xsi:type="xsd:string">DELPHITEST2</id>
<name xsi:type="xsd:string">This is another test</name>
</NS2:activity>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
기본적으로 생성을 중단하려면 델파이가 필요합니다 활동 내의 요소 활동 요소와 대신 각 ID와 이름을 활동 요소 안에 넣습니다 (.NET와 Java가 기대하는 것처럼).
invregistry.registerinvokeoptions 및 remclassregistry.registerserializeoptions에 대해 Bugger를 사용했지만 조합은 작동하지 않는 것 같습니다. 솔직히 말해서, 나는 그것을 알아 내기 위해 오랫동안이를 위해 내 자신의 XML 파서를 작성하기 직전에 있습니다. 그러나 누군가가 어떻게 작동 해야하는지에 대한 제안이 있다면 나는 매우 감사 할 것입니다.
확실히 누군가가 델파이 2007을 통해 Java-WS 웹 서비스를 소비했을 것입니다. :)
티아
해결책
Delphi 2007의 XmlDocument 구성 요소가 깨진 것 같습니다. 나는 그것을 설치했다 Alcinoe 대신 구성 요소가 매력적입니다. 그것은 단지 일주일 낭비였습니다 ... Grrrr
제휴하지 않습니다 StackOverflow