IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

EDI, CMS, Outils, Scripts et API PHP Discussion :

[APEC] - mise en place soap


Sujet :

EDI, CMS, Outils, Scripts et API PHP

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Homme Profil pro
    Développeur Web
    Inscrit en
    Février 2008
    Messages
    155
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Santé

    Informations forums :
    Inscription : Février 2008
    Messages : 155
    Par défaut [APEC] - mise en place soap
    Bonjour,

    J'aimerai savoir si quelqu'un à déjà mis en place un client soap pour l'apec en PHP. Car j'ai un problème quand j'envoie mon xml sur la methode qui nous permet de créer une offre d'emploi il me retourne que mon xml est mal formé alors que l'apec nous confirme que le xml est correct. Donc je patoge un peu alors si quelqu'un pouvez m'aidé.

  2. #2
    Expert confirmé

    Profil pro
    Inscrit en
    Septembre 2010
    Messages
    7 920
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2010
    Messages : 7 920
    Par défaut
    montre ton code

  3. #3
    Membre confirmé
    Homme Profil pro
    Développeur Web
    Inscrit en
    Février 2008
    Messages
    155
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Santé

    Informations forums :
    Inscription : Février 2008
    Messages : 155
    Par défaut
    Voici mon code :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
     
    $xml  = '<?xml version="1.0" encoding="utf-8" ?>';
    $xml .= "<S:Envelope xmlns:S='http://schemas.xmlsoap.org/soap/envelope/'>";
    $xml .= "<S:Body>";
    $xml .= "<ns2:openPositionRequest xmlns:ns2='http://adep.apec.fr/hrxml/sides' xmlns='http://ns.hr-xml.org/2006-02-28'>";
    $xml .= "<ns2:authentication>";
    $xml .= "<ns2:userId>email</ns2:userId>";
    $xml .= "<ns2:partnerId>id</ns2:partnerId>";
    $xml .= "<ns2:md5Key>a6zd6ad16az16d1az6d16a</ns2:md5Key>";
    $xml .= "</ns2:authentication>";
    $xml .= "<ns2:uniquePayloadTrackingId idOwner='CLIENT'>";
    $xml .= "<IdValue>Client-DAI-3</IdValue>";
    $xml .= "</ns2:uniquePayloadTrackingId>";
    $xml .= "<ns2:position>";
    $xml .= "<ns2:staffingOrder xml:lang='fr'>";
    $xml .= "<OrderId idOwner='CLIENT'>";
    $xml .= "<IdValue>TEST-client-DAI</IdValue>";
    $xml .= "</OrderId>";
    $xml .= "<ReferenceInformation />";
    $xml .= "<CustomerReportingRequirements />";
    $xml .= "<OrderClassification orderStatus='new' orderType='ODD' />";
    $xml .= "<OrderContact contactType='placed by'>";
    $xml .= "<ContactInfo>";
    $xml .= "<PersonName />";
    $xml .= "<ContactMethod>";
    $xml .= "<InternetEmailAddress>e</InternetEmailAddress>";
    $xml .= "</ContactMethod>";
    $xml .= "</ContactInfo>";
    $xml .= "</OrderContact>";
    $xml .= "<PositionQuantity>1</PositionQuantity>";
    $xml .= "<MultiVendorDistribution>true</MultiVendorDistribution>";
    $xml .= "<StaffingPosition>";
    $xml .= "<PositionHeader>";
    $xml .= "<PositionId>";
    $xml .= "<Id>222C</Id>";
    $xml .= "<Domain>";
    $xml .= "<IdIssuer>INSEE</IdIssuer>";
    $xml .= "<IdType>NAF</IdType>";
    $xml .= "</Domain>";
    $xml .= "</PositionId>";
    $xml .= "<PositionTitle>test intitule</PositionTitle>";
    $xml .= "<PositionType>CDI</PositionType>";
    $xml .= "<PositionDescription>Description de test</PositionDescription>";
    $xml .= "<Quantity>1.0</Quantity>";
    $xml .= "</PositionHeader>";
    $xml .= "<CustomerReportingRequirements />";
    $xml .= "<PositionDateRange>";
    $xml .= "<StartDate>2007-01-01</StartDate>";
    $xml .= "</PositionDateRange>";
    $xml .= "<PositionContact contactType='recipient'>";
    $xml .= "<ContactInfo>";
    $xml .= "<PersonName />";
    $xml .= "<ContactMethod>";
    $xml .= "<InternetEmailAddress></InternetEmailAddress>";
    $xml .= "<InternetWebAddress></InternetWebAddress>";
    $xml .= "</ContactMethod>";
    $xml .= "</ContactInfo>";
    $xml .= "</PositionContact>";
    $xml .= "<Rates rateStatus='proposed' rateType='minPayRate'>";
    $xml .= "<Amount currency='EUR' rateAmountPeriod='yearly'>30000</Amount>";
    $xml .= "<Class>regular</Class>";
    $xml .= "<StartDate>2007-01-01</StartDate>";
    $xml .= "</Rates>";
    $xml .= "<Rates rateStatus='proposed' rateType='maxPayRate'>";
    $xml .= "<Amount currency='EUR' rateAmountPeriod='yearly'>40000</Amount>";
    $xml .= "<Class>regular</Class>";
    $xml .= "<StartDate>2007-01-01</StartDate>";
    $xml .= "</Rates>";
    $xml .= "<Rates rateStatus='proposed' rateType='pay'>";
    $xml .= "<Class>regular</Class>";
    $xml .= "<StartDate>2007-01-01</StartDate>";
    $xml .= "<Description>p</Description>";
    $xml .= "</Rates>";
    $xml .= "<WorkSite>";
    $xml .= "<WorkSiteId>";
    $xml .= "<Id>J</Id>";
    $xml .= "<Domain>";
    $xml .= "<IdIssuer>ISO</IdIssuer>";
    $xml .= "<IdType>3166-2</IdType>";
    $xml .= "</Domain>";
    $xml .= "</WorkSiteId>";
    $xml .= "<WorkSiteName>Ile-de-France</WorkSiteName>";
    $xml .= "</WorkSite>";
    $xml .= "<StaffingShift>";
    $xml .= "<Id idOwner='CLIENT'>";
    $xml .= "<IdValue>xxxx</IdValue>";
    $xml .= "</Id>";
    $xml .= "</StaffingShift>";
    $xml .= "<PositionRequirements interviewRequired='false' resumeRequired='false'>";
    $xml .= "<Competency name='GLOBAL_EXPERIENCE_LEVEL'>";
    $xml .= "<CompetencyEvidence>";
    $xml .= "<StringValue>2</StringValue>";
    $xml .= "</CompetencyEvidence>";
    $xml .= "</Competency>";
    $xml .= "<Competency name='INTERNATIONAL_PROFILE' />";
    $xml .= "</PositionRequirements>";
    $xml .= "</StaffingPosition>";
    $xml .= "</ns2:staffingOrder>";
    $xml .= "<ns2:onBehalfOf typeOfOrganization='Customer'>";
    $xml .= "<Organization>";
    $xml .= "<OrganizationName>Entreprise client reel</OrganizationName>";
    $xml .= "<LegalId idOwner='INSEE'>";
    $xml .= "<IdValue>33386886700032</IdValue>";
    $xml .= "</LegalId>";
    $xml .= "<IndustryCode classificationName='INSEE'>222C</IndustryCode>";
    $xml .= "<ContactInfo>";
    $xml .= "<ContactName>";
    $xml .= "<GivenName>Pierre</GivenName>";
    $xml .= "<FamilyName primary='true'>DURAND</FamilyName>";
    $xml .= "<Affix type='formOfAddress'>1</Affix>";
    $xml .= "</ContactName>";
    $xml .= "<ContactMethod>";
    $xml .= "<Telephone>";
    $xml .= "<FormattedNumber>0123455678</FormattedNumber>";
    $xml .= "</Telephone>";
    $xml .= "<Fax>";
    $xml .= "<FormattedNumber>0123455678</FormattedNumber>";
    $xml .= "</Fax>";
    $xml .= "<InternetEmailAddress></InternetEmailAddress>";
    $xml .= "<PostalAddress>";
    $xml .= "<CountryCode>FR</CountryCode>";
    $xml .= "<PostalCode>75014</PostalCode>";
    $xml .= "<Municipality>Paris</Municipality>";
    $xml .= "<DeliveryAddress>";
    $xml .= "<StreetName>rue Didot</StreetName>";
    $xml .= "<BuildingNumber>38</BuildingNumber>";
    $xml .= "</DeliveryAddress>";
    $xml .= "</PostalAddress>";
    $xml .= "</ContactMethod>";
    $xml .= "</ContactInfo>";
    $xml .= "</Organization>";
    $xml .= "</ns2:onBehalfOf>";
    $xml .= "</ns2:position>";
    $xml .= "</ns2:openPositionRequest>";
    $xml .= "</S:Body>";
    $xml .= "</S:Envelope>";
    // -----------------------------------------------------------------------------------------------------------------------------
    // Nouveau Client SOAP
        // Nouvelle instance de la classe soapClient
       $client = new SoapClient('http://testadepsides.apec.fr/tools?wsdl', array('trace' => 1,'encoding'=>'utf-8'));
     
       try{
         $oReturn =   $client->__soapCall("openPosition", array($xml));
        } catch (SoapFault $fault) {
            trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR);
        }
            // affiche le résultat
         var_dump ($oReturn);

  4. #4
    Expert confirmé

    Profil pro
    Inscrit en
    Septembre 2010
    Messages
    7 920
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2010
    Messages : 7 920
    Par défaut
    oula, pour t'envoies du XML, ca marche pas comme ça le SOAP,
    t'as pas non plus avec des try..catch imbrique, un seul suffit dans ton cas,
    faut pas non plus utilise soapCall, c'est direct la méthode, ensuite y'a juste les paramètre de méthode à mettre

  5. #5
    Membre confirmé
    Homme Profil pro
    Développeur Web
    Inscrit en
    Février 2008
    Messages
    155
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Santé

    Informations forums :
    Inscription : Février 2008
    Messages : 155
    Par défaut
    1- j'ai virer le premier try car s'est du code d'un ancien test.
    2- en gros faudrait que je face un
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    $client->openPosition($xml)
    3- le xml est bien envoyé puisque leur systeme me renvoie une erreur.

  6. #6
    Expert confirmé

    Profil pro
    Inscrit en
    Septembre 2010
    Messages
    7 920
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2010
    Messages : 7 920
    Par défaut
    Citation Envoyé par amalec78 Voir le message
    1- j'ai virer le premier try car s'est du code d'un ancien test.
    2- en gros faudrait que je face un
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    $client->openPosition($xml)
    ?
    non c'est pas du XML que t'envoie c'est des valeurs normale

    si mon SOAP a une fonction hello($name)
    tu feras : $client->hello('amalec78')

    c'est à ça que sert le SOAP

    la méthode, openPosition attend un OpenPositionRequestType, donc c'est a toi de le recréer (en array)

  7. #7
    Membre confirmé
    Homme Profil pro
    Développeur Web
    Inscrit en
    Février 2008
    Messages
    155
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : Santé

    Informations forums :
    Inscription : Février 2008
    Messages : 155
    Par défaut
    Dans les deux cas j'ai la meme erreur :

    Fatal error: SOAP Fault: (faultcode: ns2:Server, faultstring: API_2004_VALIDATION_ERROR)

Discussions similaires

  1. [2.x] Symfony 2 et mise en place web service SOAP
    Par cid007300 dans le forum Symfony
    Réponses: 0
    Dernier message: 23/05/2014, 16h11
  2. Réponses: 1
    Dernier message: 06/02/2014, 08h23
  3. mise en place serveur web intranet
    Par gui4593 dans le forum Installation
    Réponses: 7
    Dernier message: 01/01/2004, 18h18
  4. Mise en place d'index....??
    Par liv dans le forum Requêtes
    Réponses: 6
    Dernier message: 18/12/2003, 11h04

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo