Just a note:
I have encountered this problem as well, quite often I'm afraid. This
occurred when I was subclassing and specifically seemed to occur when I
ref'd elements from a foreign namespace. To work around this I simply
included all items in one namespace. Not an ideal approach but it was a
work around none the less.
I've also noticed an interesting generation quirk on the server side
(Axis Java Server) when ref'ing elements from another namespace:
Was this intentional?
Cheers,
Alastair
-Original Message-
From: Dan Ciarniello [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 19, 2006 9:45 AM
To: axis-c-user@ws.apache.org
Subject: Namespace problem between header and body
I am trying to use the wsdl2ws tool to write a C++ client for a web
service that I have implemented using Java Axis. I am using Axis-C++
v1.6 and Java Axis v1.2.
When making a call using the wsdl2ws generated code, the SOAP envelope
sent is, for example,
|
http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
http://cityxpress.com/external";>
cityxpress
master
new_demo
123456
|
This is fine but I need to add a header to the envelope so I subclassed
the stub and added the following to the constructor:
| IHeaderBlock *phb = this->createSOAPHeaderBlock("authinfo",
"http://cityxpress.com/external";, "ai");
BasicNode *el_node = phb->createChild(ELEMENT_NODE, "user", NULL,
"http://cityxpress.com/external";, NULL);
BasicNode *t_node = phb->createChild(CHARACTER_NODE);
t_node->setValue(user);
el_node->addChild(t_node);
phb->addChild(el_node);
el_node = phb->createChild(ELEMENT_NODE, "password", NULL,
"http://cityxpress.com/external";, NULL);
t_node = phb->createChild(CHARACTER_NODE);
t_node->setValue(pass);
el_node->addChild(t_node);
phb->addChild(el_node);
|
Now, when I make the call to the service, the SOAP envelope is
|
http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
http://cityxpress.com/external";>
username
password
http://cityxpress.com/external";>
cityxpress
master
new_demo
123456
|
Note that the partner, deployment and site subelements of siteinfo have
lost their namespace prefix. This means that the web service ignores
the values given because the elements are not in the expected namespace.
For the sake of comparison, here is the envelope created by a Java
version of the client created with WSDL2Java which is understood by the
web service:
|
http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
http://schemas.xmlsoap.org/soap/actor/next";
soapenv:mustUnderstand="0"
xmlns:ns1="http://cityxpress.com/external";>
username
password
http://cityxpress.com/external";>
cityxpress
master
new_demo
123456
|The obvious question is how do I get the C++ client to generate a SOAP
Envelope that is comparable to the one created by the Java client?
As an aside, I wanted to try a C client to see if the same problem
existed but, though wsdl2ws will generate C-code, there don't seem to be
any C libraries that I can link to. Are C libraries missing or is there
a way that I can link C code to the C++ libraries?
Thanks,
Dan.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]