Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9042441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T10:29:30+00:00 2026-06-16T10:29:30+00:00

step 1, i had create an WebService using ASP.NET (C#): [WebService(Namespace = http://tempuri.org/)] [WebServiceBinding(ConformsTo

  • 0

step 1, i had create an WebService using ASP.NET (C#):

[WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class WebService1 : System.Web.Services.WebService
    {

        [WebMethod]
        public string HelloWorld(int a, int b)
        {
            return a.ToString() + "," + b.ToString();
        }
    }

step 2, and then i use gsoap_2.8.12 generate code, following command:

 wsdl2h -c -o a.h http://localhost:29556/WebService1.asmx?WSDL
  soapcpp2 -c -C -I import a.h

step3, create an empty C project in VC, add the following files:
soapH.h
soapStub.h
stdsoap2.h
soapC.c
soapClient.c
stdsoap2.c

step4, config the folders, and create a new class :

#include <stdio.h>
#include "WebService1Soap.nsmap";

void main()
{
    struct soap soap;
    int ret;
    struct _ns1__HelloWorld hello;
    struct _ns1__HelloWorldResponse respHello;
    int arg1, arg2;

    soap_init(&soap);
    hello.a = 2;
    hello.b = 3;

    ret = soap_call___ns1__HelloWorld(&soap, NULL, NULL, &hello, &respHello);
    if (ret == SOAP_OK)
    {
        printf("return :%s", respHello.HelloWorldResult);
    }
    else
    {
        printf("error :%d", ret);
    }

    getchar();
}

Problem: the return value is “0,0”, as we expect it should be “2,3”,
Please tell me what i had missed about these things ? thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T10:29:31+00:00Added an answer on June 16, 2026 at 10:29 am

    after hours work, i had fixed this thing, if you are using WCF , you need add an attribute into your operation, for example:

    [ServiceContract]
        public interface IMyService
        {
            [OperationContract]
            [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Literal)]
            long Method1(int a, int b, long c, string d);
         }
    

    if using WebService, that should be:

    [WebMethod]
            [System.Web.Services.Protocols.SoapRpcMethodAttribute(Use = System.Web.Services.Description.SoapBindingUse.Literal)]
            public string HelloWorld(int a, int b)
            {
                return a.ToString() + "," + b.ToString();
            }
    

    so the gsoap can send the argument value correctly to server.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using this tutorial: http://www.codeproject.com/Articles/105273/Create-RESTful-WCF-Service-API-Step-By-Step-Guide I can get a Directory Listing to display when I
Has anyone had any experience with using the STEP and EXPRESS formats in a
When I create a new ASP.Net MVC 4 project with Visual Studio 2012 it
I was following the Contoso University tutorial on the asp.net website and it all
I want to create a windows installer package using visual studio. It is my
Using SubSonic 3 ActiveRecord, I generated code from an existing database that had foreign
I had problem when tried to implement Facebook Credit into my website.. First step
During installation, my application will: Step A, Look for C:\WebService directory. If found do
I have to communicate (using .NET) with a web service running on Axis 1.2.
Using Django 1.3 with PostgreSQL 9.0, I have a multi-step object creation function/view, where:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.