Article View: borland.public.cppbuilder.webservices.soap
Article #108Borland framework does not create valid SOAP request data
From: Robert Klauc
Date: Wed, 01 Sep 2004 13:42
Date: Wed, 01 Sep 2004 13:42
54 lines
3695 bytes
3695 bytes
We use Borland C++ Builder 6.0 (Enterprise Edition) to develop a large client/server application. As part of this application we have to call already running web services. We use the WSDL Importer to create classes and methods to call the web services. But the Borland framework does not create valid XML request data for the web service.
The WSDL defines XML elements for the request that belongs to different namespaces. But in the web service request only the root element of the request has a namespace specified. Our question is, how can we achieve, that the SOAP request created by the Borland framework fits to the WSDL definition (including the correct namespace for all elements).
The file Service1_1.wsdl is a sample WSDL that demonstrates the problem (not attached because of the size, but can be provided).
The XML element "HelloWorld" belongs to the namespace "http://microsoft.com/webservices/" and
the XML element "testIn" belongs to the namespace "http://microsoft.com/webservices/schemaIn".
The files Service1_1.h and Service1_1.cpp contains the classes and definitions created by the WSDL Importer (not attached because of the size, but can be provided).
Borland creates the following SOAP request:
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<HelloWorld mlns="http://microsoft.com/webservices/">
<testIn>
<val1>10</val1>
<val2>20</val2>
</testIn>
</HelloWorld>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
You can see, there is no namespace specified for the "testIn" element.
A valid SOAP request has to look like this:
<?xml version="1.0" encoding="utf-16"?>
<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>
<HelloWorld xmlns="http://microsoft.com/webservices/">
<testIn xmlns="http://microsoft.com/webservices/schemaIn">
<val1>0</val1>
<val2>0</val2>
</testIn>
</HelloWorld>
</soap:Body>
</soap:Envelope>
This is the code that we use to call the web service:
_di_Service1Soap objWs = GetService1Soap();
testIn_body* valIn = new testIn_body();
valIn->val1 = 10;
valIn->val2 = 20;
testOut_body* valOut = objWs->HelloWorld(valIn) ;
Are there any attributes or parameters that can be set to get the correct namespace declaration?
We would appreciate any help on this issue.
Thank you for any suggestions.
Technical Details
Message-ID:
<4135d1b1$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!news-out.ntli.net!newsrout1.ntli.net!news-in.ntli.net!ntli.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 11096a,befcd4ba362980e5,start X-Google-Attributes: gid11096a,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Robert Klauc" <robert.klauc@siemens.com> Sender: "Robert Klauc" <robert.klauc@siemens.com> Reply-To: "Robert Klauc" <robert.klauc@siemens.com> Subject: Borland framework does not create valid SOAP request data Newsgroups: borland.public.cppbuilder.webservices.soap X-User-Info: 193.81.246.3 X-Forwarded-For: 158.226.204.229, unknown NNTP-Posting-Host: 207.105.83.66 Message-ID: <4135d1b1$1@newsgroups.borland.com> Date: 1 Sep 2004 06:42:09 -0700 X-Trace: newsgroups.borland.com 1094046129 207.105.83.66 (1 Sep 2004 06:42:09 -0700) Lines: 56 Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!news-out.ntli.net!newsrout1.ntli.net!news-in.ntli.net!ntli.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail