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 985781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:12:58+00:00 2026-05-16T05:12:58+00:00

My application has its own scripting language of which I cannot get rid of

  • 0

My application has its own scripting language of which I cannot get rid of (lots of customer-specific scripts written). Now my customers are asking if it would be possible to call a SOAP service from within that scripting language. Of course, the SOAP service that needs to be called will be different for every customer. This leaves me with several options:

  • Use the WSDL utility to generate customer-specific SOAP client proxies and put the customer-specific logic in my application
  • Use the WSDL utility to generate customer-specific SOAP client proxies, put the customer-specific logic in customer-specific DLL’s and foresee a plug-in system where the application can call the plug-in in a generic way
  • Write a generic module that dynamically generates the SOAP call

The first 2 options are no real alternative in my case since I don’t want any customer-specific logic in the application, or customer-specific DLL’s.

For me, the 3rd option is, in the long term, the best since it allows my consultant colleagues to call the SOAP service via my scripting language without doing any customer-specific developments. Dynamically adding functions to my scripting language is not a problem, generating the dynamic SOAP call is.

I started by looking at the output of the WSDL utility. Then I started to remove things until it didn’t work anymore. The following piece of code is the one still working:

[System::CodeDom::Compiler::GeneratedCodeAttribute(L"wsdl", L"4.0.30319.1"), 
System::Diagnostics::DebuggerStepThroughAttribute, 
System::ComponentModel::DesignerCategoryAttribute(L"code"),
System::Web::Services::WebServiceBindingAttribute(Name=L"MyOwnScriptingSoapClient", Namespace=L"http://microsoft.com/webservices/")]
public ref class MyWebService : public System::Web::Services::Protocols::SoapHttpClientProtocol
   {
    public:
      MyWebService() {}

    public:
      [System::Web::Services::Protocols::SoapDocumentMethodAttribute(L"http://microsoft.com/webservices/GetPrimeNumbers", RequestNamespace=L"http://microsoft.com/webservices/", 
       ResponseNamespace=L"http://microsoft.com/webservices/", Use=System::Web::Services::Description::SoapBindingUse::Literal, ParameterStyle=System::Web::Services::Protocols::SoapParameterStyle::Wrapped)]
      System::String^  GetPrimeNumbers(System::Int32 max);
  };

inline System::String^  MyWebService::GetPrimeNumbers(System::Int32 max) {
    cli::array< System::Object^  >^  results = this->Invoke(L"GetPrimeNumbers", gcnew cli::array< System::Object^  >(1) {max});
    return (cli::safe_cast<System::String^  >(results[0]));
}

The URL of the web service can be dynamically by setting the Url property, but I can’t find a way to make the method name dynamic.

Adding a generic method like this still seems to work:

...
[System::Web::Services::Protocols::SoapDocumentMethodAttribute(L"http://microsoft.com/webservices/GetPrimeNumbers", RequestNamespace=L"http://microsoft.com/webservices/", 
 ResponseNamespace=L"http://microsoft.com/webservices/", Use=System::Web::Services::Description::SoapBindingUse::Literal, ParameterStyle=System::Web::Services::Protocols::SoapParameterStyle::Wrapped)]
cli::array< System::Object^  >^  CallWs(cli::array< System::Object^  >^ args);
...

inline cli::array< System::Object^  >^  MyWebService::CallWs(cli::array< System::Object^  >^ args) {
    cli::array< System::Object^  >^  results = this->Invoke(L"GetPrimeNumbers", args);
    return results;

But as soon as I remove the GetPrimeNumbers method, the call doesn’t work anymore and reports the following error:

Unhandled Exception: System.ArgumentException: GetPrimeNumbers Web Service method name is not valid.
   at System.Web.Services.Protocols.SoapHttpClientProtocol.BeforeSerialize(WebRequest request, String methodName, Object[] parameters)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at MyWebService.CallWs(Object[] args)
   at main(Int32 argc, SByte** argv)
   at _mainCRTStartup()

Also, changing the web service name in the SoapDocumentMethodAttribute attribute (e.g. to GetPrimo), gives this same error.

Therefore, my questions:

  • Does it make sense to continue on this path, i.e. looking at the WSDL generated logic trying to ‘generalize’ the call to a (any) SOAP service or will this simply never work?
  • Are there any other good ways of generating the SOAP call in a dynamic way (using .Net)?
  • Or is the only method to create the XML (Soap Envelope) yourself to do the SOAP call?
  • Any chance of finding some example code that I can continue to work on?

Thanks in advance,
Patrick

  • 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-05-16T05:12:59+00:00Added an answer on May 16, 2026 at 5:12 am

    You can give a mechanism in your scripting language to call an external .NET assembly. You can use reflection to find the function and call them. Similar to way the plugins work in many applications.

    This will not only allow the customers to call an external web service, but can be used for many other enhancements.

    Or if you don’t want to rely on your customer writing .NET assemblies, you can generate the SOAP requests yourself by asking the user SOAP message name, parameter names, their type and values, service URL etc. But I think it is not going to be an easy path and I admit that I never have done it myself.

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

Sidebar

Related Questions

Currently we have many applications, where each application has its own error notification and
I have several applications across sub domains on various servers. Each application has its
I have a shared web server setup among friends. Each website has its own
This often comes up: your application has gotten extensive enough that it's time to
I was demonstrating my WPF application to a customer and he asked me if
We are currently using SVN to develop an internal application that has most of
I am developing a web application using Java/JSP. One class, say Student, has a
I'm going to be as specific and verbose as possible and include some of
Building decent RIA data-intensive crud-like application is still hard. In spite of existence tons
Our application is built in VB6 and delivered in a SaaS model via Citrix.

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.