CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2006

    Web Service end point address

    As we know a web service can return data in any format like pox, json, soap etc. I suppose returning data in different formats is implemented by specifying endpoints for these formats somewhat like below in the config file of the service. This is an example only.

          <service name="WcfService.TestService" behaviorConfiguration="defaultBehavior">
                <!-- note, choose an available port-->
                <add baseAddress="http://localhost:81/TestService" />
            <endpoint address="soap" 
                      contract="WcfService.ITestService" />
            <endpoint address="pox"  
                      contract="WcfService.ITestService" />
            <endpoint address="json" 
                      contract="WcfService.ITestService" />
    In this case, I know that, if we need to get data in pox we can call the web service like below:
    where pox is the end point address for pox( xml )..

    But if we do not know what all endpoint addresses a web service has configured, is there any way we can get the end point addresses from client so that we can request data from a native c++ client in the format we desire?

    Thanks in advance..

  2. #2
    Join Date
    Nov 2000
    Voronezh, Russia

    Re: Web Service end point address

    I believe this is what IMetadataExchange contract based endpoint mex is for. You should know, nevertheless, that it is up to service publisher to publish these details or not. I can imagine an absolutely opaque service when client code is generated strictly by service creator (and distributed privately) while service itself exposes main call contract interface only.
    Best regards,

  3. #3
    Join Date
    Jun 2006

    Re: Web Service end point address

    Thank you , Igor. I was actually trying to call a web service from a c++ clint. All I know about the service is the url and the end points. ie. full urls of each method exposed by the server. I am able to call the web service. The thing was the service returned data in both json and xml. As we know a web service can choose to return data in any format and this varies acording to implementation.

    1. Either we can provide separate end points for xml, json, soap etc. in app.config or,

    2. we can have a method whose return is explicitly json or xml or

    3. We can have the client to request the data in json/xml in the request header..

    In my case it was the last thing that worked...ie, I needed to get data in json format from a web service and in order to get it, i had to request in json fomat.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.