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

Services Web Discussion :

Web Service WCF client Perl


Sujet :

Services Web

  1. #1
    Futur Membre du Club
    Inscrit en
    Février 2009
    Messages
    4
    Détails du profil
    Informations forums :
    Inscription : Février 2009
    Messages : 4
    Points : 5
    Points
    5
    Par défaut Web Service WCF client Perl
    Bonjour,

    N'ayant pas eu de réponse du coter Perl, je viens tenter ma chance ici ... Car je pense que l'erreur est au niveau WCF mais pas sure ...

    Que je m'explique, j'ai un webservice en WCF que j'essaie d'interroger avec un client Perl mais je n'y arrive pas. Ne trouvant pas de solution je vous ai poster le code que j'utilise peut être que quelqu'un aura une piste ...

    Code client Perl:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
     
    #! c:\perl\bin\perl
     
    use strict;
    use warnings;
    use SOAP::Lite +trace => [qw(all)];
    #use SOAP::Lite;
     
    print my $service = SOAP::Lite -> uri('http://192.168.123.105:4242/TestWcfForPerl/')
      -> proxy('http://192.168.123.105:4242/TestWcfForPerl/')
      -> on_action(sub{sprintf '%sIServiceTest/%s', @_})
      -> HelloWorld()->result;
    Contrat :

    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
     
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.ServiceModel;
     
    namespace Contracts
    {
        [ServiceContract]
        //[DataContractFormat(Style = OperationFormatStyle.Rpc)]
        public interface IServiceTest
        {
            [OperationContract]
            string HelloWorld();
        }
    }
    Service :

    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
     
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Contracts;
     
    namespace Services
    {
        public class ServiceTest : IServiceTest
        {
            public string HelloWorld()
            {
                return "Hello world !!";
            }
        }
    }
    Hebergeur de services :

    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
     
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.ServiceModel;
    using Contracts;
    using Services;
     
    namespace Hebergeur
    {
        class Program
        {
            static void Main(string[] args)
            {
                ServiceHost host = new ServiceHost(typeof(ServiceTest));
                try
                {
                    host.Open();
                    Console.WriteLine("Service demarre ...");
                    Console.ReadLine();
                    host.Close();
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                    Console.ReadLine();
                }
            }
        }
    }
    Fichier de configuration du serveur :

    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
     
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="MyBasicHttpBinding" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="false" >
              <security mode="None" />
            </binding>
          </basicHttpBinding>
        </bindings>
        <services>
          <service name="Services.ServiceTest">
            <endpoint address="http://localhost:4242/TestWcfForPerl/" binding="basicHttpBinding"
                bindingConfiguration="MyBasicHttpBinding" contract="Contracts.IServiceTest" />
          </service>
        </services>
      </system.serviceModel>
    </configuration>
    Coter debug :

    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
     
    SOAP::Transport::new: ()
    SOAP::Serializer::new: ()
    SOAP::Deserializer::new: ()
    SOAP::Parser::new: ()
    SOAP::Lite::new: ()
    SOAP::Transport::HTTP::Client::new: ()
    SOAP::Lite::call: ()
    SOAP::Serializer::envelope: ()
    SOAP::Serializer::envelope: HelloWorld
    SOAP::Data::new: ()
    SOAP::Data::new: ()
    SOAP::Data::new: ()
    SOAP::Data::new: ()
    SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x1c7eaa4)
    SOAP::Transport::HTTP::Client::send_receive: POST http://192.168.123.105:4242/Te
    stWcfForPerl/ HTTP/1.1
    Accept: text/xml
    Accept: multipart/*
    Accept: application/soap
    Content-Length: 448
    Content-Type: text/xml; charset=utf-8
    SOAPAction: http://192.168.123.105:4242/TestWcfForPerl/IServiceTest/HelloWorld
     
    <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http://www.w3.or
    g/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encodi
    ng/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://sch
    emas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/env
    elope/"><soap:Body><HelloWorld xmlns="http://192.168.123.105:4242/TestWcfForPerl
    /" xsi:nil="true" /></soap:Body></soap:Envelope>
    SOAP::Transport::HTTP::Client::send_receive: HTTP::Response=HASH(0x303f79c)
    SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 500 Internal Server Error
    Date: Tue, 17 Feb 2009 22:55:38 GMT
    Server: Microsoft-HTTPAPI/1.0
    Content-Length: 764
    Content-Type: text/xml; charset=utf-8
    Client-Date: Tue, 17 Feb 2009 22:55:38 GMT
    Client-Peer: 192.168.123.105:4242
    Client-Response-Num: 1
     
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault
    ><faultcode xmlns:a="http://schemas.microsoft.com/ws/2005/05/addressing/none">a:
    ActionNotSupported</faultcode><faultstring xml:lang="en-US">The message with Act
    ion 'http://192.168.123.105:4242/TestWcfForPerl/IServiceTest/HelloWorld' cannot
    be processed at the receiver, due to a ContractFilter mismatch at the EndpointDi
    spatcher. This may be because of either a contract mismatch (mismatched Actions
    between sender and receiver) or a binding/security mismatch between the sender a
    nd the receiver.  Check that sender and receiver have the same contract and the
    same binding (including security requirements, e.g. Message, Transport, None).</
    faultstring></s:Fault></s:Body></s:Envelope>
    SOAP::Deserializer::deserialize: ()
    SOAP::Parser::decode: ()
    SOAP::SOM::new: ()
    Use of uninitialized value $service in print at C:\bataille\web_service\c#\clien
    t\cli_c#.pl line 11.
    SOAP::SOM::DESTROY: ()
    SOAP::Lite::DESTROY: ()
    SOAP::Transport::DESTROY: ()
    SOAP::Transport::HTTP::Client::DESTROY: ()
    SOAP::Deserializer::DESTROY: ()
    SOAP::Parser::DESTROY: ()
    SOAP::Serializer::DESTROY: ()
    SOAP::Data::DESTROY: ()
    SOAP::Data::DESTROY: ()
    SOAP::Data::DESTROY: ()
    SOAP::Data::DESTROY: ()
    Merci par avance !!

  2. #2
    Futur Membre du Club
    Inscrit en
    Février 2009
    Messages
    4
    Détails du profil
    Informations forums :
    Inscription : Février 2009
    Messages : 4
    Points : 5
    Points
    5
    Par défaut
    Resolu,

    Le probleme venait du client Perl.

    Il fallait préciser dans l'uri un lien ...

    Exemple http://tempuri.org


+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Web service WCF taille client en entrée
    Par rikko57 dans le forum Services Web
    Réponses: 4
    Dernier message: 13/09/2010, 08h49
  2. Appel d'un Web Service WCF utilisant wsHttpBinding
    Par Thomas Lebrun dans le forum Débuter avec Java
    Réponses: 0
    Dernier message: 08/06/2009, 23h34
  3. Web Service PHP / Client JAVA
    Par Ronins13 dans le forum Services Web
    Réponses: 0
    Dernier message: 03/06/2009, 16h02
  4. tutorial web service application cliente sql server
    Par Msysteme dans le forum Débuter
    Réponses: 2
    Dernier message: 22/12/2008, 21h55
  5. Validation d'une architecture web service sécurisé + client windows
    Par WOLO Laurent dans le forum Services Web
    Réponses: 2
    Dernier message: 13/05/2008, 11h22

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