[SOAP/XML et VB Macro /Excel] Complex types

Hello,

Je dois faire appel a une fonction d’un web service (XML donc) a travers une macro excel (via le SOAP Toolkit, seul moyen apparemment pour acceder a un web service sous excel), sauf que la fonction que j’ai besoin d’utiliser contiens apparemment des types de donees trop complexes pour etre comprise simplement par VB et cela m’indique que VB ne peux pas generer automatiquement le code VB correspondant a ma fonction.

En gros, je dois me demerder tout seul pour appeller via SOAP (avec les fonctions natives) avec les parametres qui vont bien.

J’ai deja cherche, j’ai trouve une portion de code qui fais ca, mais ca plante sur la dernier instruction de ce code :

URL = "https://masociete.com/MONWEBSERVICE/API.asmx" Uri = "urn:" & URL Method = "UpdateData" Dim Connector As SoapConnector Dim Serializer As SoapSerializer Dim Reader As SoapReader Set Connector = New HttpConnector Set Serializer = New SoapSerializer Set Reader = New SoapReader Connector.Property("EndPointURL") = URL Call Connector.Connect Connector.Property("SoapAction") = Uri & "#" & Method Call Connector.BeginMessage Serializer.Init Connector.InputStream ' build message Serializer.startEnvelope , ENC Serializer.SoapNamespace "xsi", XSI Serializer.SoapNamespace "SOAP-ENC", ENC Serializer.SoapNamespace "xsd", XSD ' build body Serializer.startBody Serializer.startElement Method, Uri, , "method" Serializer.startElement "data" Serializer.startElement "plannedEffort" Serializer.SoapAttribute "type", , "xsd:string", "xsi" Serializer.writeString str_effort Serializer.endElement 'plannedEffort Serializer.endElement 'data Serializer.startElement "project" Serializer.SoapAttribute "type", , "xsd:string", "xsi" Serializer.writeString str_proj Serializer.endElement 'project Serializer.startElement "number" Serializer.SoapAttribute "type", , "xsd:string", "xsi" Serializer.writeString str_number Serializer.endElement 'number Serializer.endBody ' end build body Serializer.endEnvelope

Avec comme code : runtime error -2147467259 (800004005) Method ‘endEnvelope’ of object ‘ISoapSerializer’ failed

Quelqu’un pourrai me filer un coup de main ? B)

P.S : je precise que je ne m’y connais pas en SOAP.

Quel version d’Excel ?

excel 2003 pro SP2

Pour vous aider un peu plus, voila le format XML attendu :

<?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> <UpdateData xmlns="http://masociete.com/API"> <data> <title>string</title> <mainProject>string</mainProject> <author>string</author> <crType>string</crType> <Imes_Number>string</Imes_Number> <MelID>string</MelID> <functionality>string</functionality> <prio>string</prio> <description>string</description> <submitComment>string</submitComment> <OITS>string</OITS> <custRelCF>string</custRelCF> <plannedEffort>string</plannedEffort> <actualEffort>string</actualEffort> <severity>string</severity> <analysisComment>string</analysisComment> <status>string</status> <responsible>string</responsible> <Identifier>string</Identifier> <errorOccuredBaseline>string</errorOccuredBaseline> <errorFoundBaseline>string</errorFoundBaseline> <plannedBaseline>string</plannedBaseline> <whoFoundDepartment>string</whoFoundDepartment> <reqFlag>boolean</reqFlag> <actionRequired>boolean</actionRequired> <CRClassification_Reason>string</CRClassification_Reason> <CRClassification_Responsible>string</CRClassification_Responsible> <fatherProject>string</fatherProject> <fatherImesNumber>string</fatherImesNumber> <FileReferenceName>string</FileReferenceName> <FileReferenceOldVersion>string</FileReferenceOldVersion> <FileReferenceNewVersion>string</FileReferenceNewVersion> </data> <project>string</project> <number>long</number> <identifier>string</identifier> <relCustCR>string</relCustCR> </UpdateIMESData> </soap:Body> </soap:Envelope>

beaucoup de ces parametres sont inutilises, seuls 3 sont utiles: plannedEffort, projeect et number.