#1 2012-05-02 19:21:56

jtc007
New member
Registered: 2012-01-31
Posts: 6

Consuming SayHelloService from Microsoft Visual Studio 2010

The SayHelloService is running in TOS for ESB.  It is consumed successfully by SayHelloConsumer and SoapUI 4.5.

In Visual Studio 2010, there is a Service Reference added to http://localhost:8090/services/SayHelloService?wsdl.

When calling the operation with the following,

    string ret;
    ServiceReference1.SayHelloServicePortTypeClient ws = new ServiceReference1.SayHelloServicePortTypeClient();           
    ret = ws.SayHelloServiceOperation("klaus");         

it completes without error but ret is null.

Has anyone successfully called an ESB service from VS?  What is the correct syntax?

Last edited by jtc007 (2012-05-02 19:22:54)

Offline

#2 2012-05-09 10:35:42

dlenzen
Talend Team
Registered: 2010-12-06
Posts: 73

Re: Consuming SayHelloService from Microsoft Visual Studio 2010

Hi jtc007

just check it and it worked fine:

Follow the steps outlined here: http://msdn.microsoft.com/en-us/library/ms733133.aspx (with 3 subsequent pages linked from this page as 'Next')
(Use the http://localhost:8090/services/SayHelloService?WSDL URL for the WSDL)

And then create / add the following into your program.cs might look like:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;


namespace SayHelloConsumer
{
    class Program
    {
        static void Main(string[] args)
        {
            string ret;
            SayHelloServicePortTypeClient ws = new SayHelloServicePortTypeClient();
            ret = ws.SayHelloServiceOperation("Dietmar");   
            Console.WriteLine("Service returned with: {0}", ret);
            Console.ReadLine();
        }
    }
}


And then my console Window showed the response as:

"Service returned with: Hello Dietmar - Welcome to Talend ESB"

So hope this would also work for you,
Dietmar

Offline

#3 2012-05-09 20:05:08

jtc007
New member
Registered: 2012-01-31
Posts: 6

Re: Consuming SayHelloService from Microsoft Visual Studio 2010

Hi Dietmar, thanks for the reply.

I created a new console app per the instructions.  Unfortunately, the return value is still null (see service2.png).  I did notice on the SayHelloService running in TOS for ESB that when the call is made, there is one row from tESBProviderRequest_1 to tXMLMap_1 and 0 rows coming out of tXMLMap_1 (service3.png).  So it looks like something is failing within tXMLMap_1 (service4.png).  Is your tXMLMap_1 set up the same?


Uploaded Images

Offline

#4 2012-05-09 20:11:56

jtc007
New member
Registered: 2012-01-31
Posts: 6

Re: Consuming SayHelloService from Microsoft Visual Studio 2010

Needed to resize the other referenced screenshots...


Uploaded Images

Offline

#5 2012-05-09 20:21:14

jtc007
New member
Registered: 2012-01-31
Posts: 6

Re: Consuming SayHelloService from Microsoft Visual Studio 2010

updated screenshot of tXMLMap...


Uploaded Images

Offline

#6 2012-05-11 13:38:37

dlenzen
Talend Team
Registered: 2010-12-06
Posts: 73

Re: Consuming SayHelloService from Microsoft Visual Studio 2010

Hi,

hm, this all looks good. Most likely there could be two reasons:

1) the request is wrong (e.g. a wrong namespace is send from your .NET code)
2) the tXMLMap mapping has an issue (but from the image it looks good)

So if you like I could take a look at your VS Solution / Talend Data Service. In this case, please open a bug in our bug tracker (http://jira.talendforge.org) under the TESB project and post the Bug ID here. To this bug report please attach your VS Solution and an export of your Data Service (as ZIP) by this I can use your code to see if it is different somehow.

Thanks
Dietmar

Offline

#7 2012-05-11 19:23:03

jtc007
New member
Registered: 2012-01-31
Posts: 6

Re: Consuming SayHelloService from Microsoft Visual Studio 2010

Dietmar,

The Bug ID is TESB-5901.

Thanks for looking...

Offline

#8 2012-06-25 19:18:46

jtc007
New member
Registered: 2012-01-31
Posts: 6

Re: Consuming SayHelloService from Microsoft Visual Studio 2010

Issue may have been with 5.0.2; downloaded 5.1.1 and everything works as expected.

Offline

Board footer

Powered by FluxBB