Hi everybody,
I work at the client side of a web service. And I have trouble to make it
work. I have 2 problems
The java client (stub) was generated automatically by the WSDL2Java tool.
The SOAP message sent is:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:NewUser soapenv:encodingStyle="
http://schemas.xmlsoap.org/soap/encoding/" xmlns:m="urn:xmethods">
</ns1:NewUser>
</soapenv:Body>
</soapenv:Envelope>
1. Namespace name problem:
I receive an error 500 while testing. And the reason seems to be the name of
the NewUser namespace. In other words, it fails when launching from Java.
Testing with cUrl, from the command line, the same SOAP message doesn't work
either. Only by replacing "ns1" with "m" it seems to work (so to have
"m:NewUser"). It works even if I put a silly value to the NewUser namespace.
So, I conclude that "they", on the server side, only look for "m:NewUser"
tag, but it doen't make sense to me.
My problem is that the SOAP messange is generated and I cannot modify the
name of the namespace, only the value (how I think it is normal).
How it is normal. What can I do? It is a way to modify the name of the
namespace in the message which is generated by Axis?
2. Custom HTTP header:
"They" on the server side have requested me to send the SOAP request having
set a custom HTTP header ( X-Custom-Header: Value ).
The only solution I have found was to modyfy the Stub, by adding the
following code to the createCall() method:
_call.setProperty(Call.SESSION_MAINTAIN_PROPERTY, new Boolean(true));
_call.setProperty(HTTPConstants.HEADER_COOKIE2, "\r\nX-Custom-Header:
Value");
Is there any standard/normal way to add a custom HTTP header to a SOAP
request message generated by Axis?
Thank yoy very much,
Claudiu