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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:19:05+00:00 2026-06-09T18:19:05+00:00

I am trying to connect to an example soap server at http://www.webservicex.net/ using the

  • 0

I am trying to connect to an example soap server at http://www.webservicex.net/ using the following MATLAB code:

% createSoapMessage(NAMESPACE,METHOD,VALUES,NAMES,TYPES,STYLE) creates a SOAP message.
% VALUES, NAMES, and TYPES are cell arrays.  
m = createSoapMessage('http://www.webserviceX.NET', 'GetCitiesByCountry', ...
  {'Australia'}, {'CountryName'}, { '{http://www.w3.org/2001/XMLSchema}string' }, 'rpc')

%    callSoapService(ENDPOINT,SOAPACTION,MESSAGE) sends the MESSAGE,
%    a Java DOM, to the SOAPACTION service at the ENDPOINT.
response = callSoapService('http://www.webservicex.net/globalweather.asmx?WSDL', ...
  'http://www.webserviceX.NET/GetCitiesByCountry', m);

I get the following response (with line endings inserted for viewing):

val =
  <?xml version="1.0" encoding="utf-8"?>
  <soap:Envelope
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
      <soap:Fault>
        <faultcode>soap:Server</faultcode>
          <faultstring>System.Web.Services.Protocols.SoapException: 
          Server was unable to process request. 
          ---&gt; System.Data.SqlClient.SqlException: 
          Procedure or function 'getWCity' expects parameter '@CountryName',
          which was not supplied.
          at WebServicex.GlobalWeather.GetCitiesByCountry(String CountryName)
          --- End of inner exception stack trace ---
        </faultstring><detail />
      </soap:Fault>
    </soap:Body>
  </soap:Envelope>

I know that the server is responding. I can interrogate it with Python and suds like this:

from suds.client import Client
url = 'http://www.webservicex.net/globalweather.asmx?WSDL'
client = Client(url)
result = client.service.GetCitiesByCountry('Australia')

My simple question is what am I doing wrong?

I would also like to know how to view the DOM object that createSoapMessage creates and how to view the xml that MATLAB sends and receives.

  • 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-09T18:19:06+00:00Added an answer on June 9, 2026 at 6:19 pm

    The correct code looks like this:

    % createSoapMessage(NAMESPACE,METHOD,VALUES,NAMES,TYPES,STYLE) creates a SOAP message.
    message = createSoapMessage( ...
      'http://www.webserviceX.NET', ...
      'GetCitiesByCountry', ...
      {'Australia'}, ...
      {'CountryName'}, ...
      {'{http://www.w3.org/2001/XMLSchema}string' }, ...
      'document')
    
    % callSoapService(ENDPOINT,SOAPACTION,MESSAGE) sends the MESSAGE,
    response = callSoapService( ...
      'http://www.webservicex.net/GlobalWeather.asmx', ...
      'http://www.webserviceX.NET/GetCitiesByCountry', ...
      message);
    
    % parseSoapResponse Convert the response from a SOAP server into MATLAB types.
    cities = parseSoapResponse(response)  
    

    The particular differences are:

    • The STYLE parameter is ‘document’, not ‘rpc’
    • http://www.webservicex.net is very inconsistent in how they capitalize, and it matters!
    • The endpoint parameter ends .asmx and does not inclcude ?WDSL.

    I have added an example of the parseSoapResponse call too. This also caused me trouble. For this web service, this call returns just the structure containing the requested data. When working with a different service on the same host, parseSoapResponse returned two outputs, a good/bad result and the data. See sending SOAP request with Matlab.

    Finally, in answer to my supplementary question about viewing the intermediate XML such as message, the soap message, in MATLAB, use the following:

     javaString = message.saveXML(message.getFirstChild())
    

    to get the XML in a java string and then:

     matlabString = char(javaString)
    

    to get the XML in a matlab string.

    The following code adds newlines and spaces to display the XML over several lines to help debugging.

    ms2 = regexprep(matlabString ,'>','>\n')
    ms3 = regexprep(ms2,' x','\n  x')
    

    I still do not know how to view the outgoing and incoming HTTP traffic in MATLAB like you can in a browser.

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

Sidebar

Related Questions

I'm trying to make a C#.net app connect to a server using the XMLSocket
Trying to follow this example to make it work: http://weblogs.asp.net/kiyoshi/archive/2008/10/08/wcf-using-webhttpbinding-for-rest-services.aspx Here is my App.config
I'm trying to connect to google documents (following Marco Cantu's excellent REST example) but
I am trying to connect to a MySQL Server using JDBC tool in java
I'm using the Facebook Connect for iPhone SDK at http://github.com/facebook/facebook-iphone-sdk/ and am trying to
I'm trying to connect my CoreData to iCloud using NSFetchedResultController basing on iCloud example
I'm trying to connect to a MySQL server via VB.NET, but my program keeps
Im trying to connect to a SOAP service using Android and have read in
i am using Oracle Application server 10.1.2.0.2. I am trying to connect an oracle
I am trying to run the basic fb connect example provided here http://developers.facebook.com/docs/guides/web#login Everything

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.