unsubscribe
-----Original Message-----
From: Jansen Werner [mailto:[EMAIL PROTECTED]
Sent: Monday, April 10, 2006 9:21 AM
To: [email protected]
Subject: Problems getting data into the header
Hey folks,
this is my first post to this list, I hope I don't ask something
discussed over a thousand times before. At least aunt Google said, it's
new to the list (as I am to axis and Web services) :)
I wrote a simple web service for playing with web services. The
corresponding Java class on the server side looks like this:
public void logMessage(ClientCallMetaData ccMetaData, LogLevel level,
String message) { ...
}
this is an excerpt of server-config.wsdd:
<operation name="logMessage" qname="prs:logMessage">
<parameter name="clientCallMetaData"
type="prs:ClientCallMetaData" />
<parameter name="level" type="prs:LogLevel" mode="IN" />
<parameter name="message" type="xsd:string" mode="IN" />
</operation>
I managed to (de-)serialize LogLevel and ClientCallMetaData as
parameters. All three parameters of this method are transmitted as
children of <logMessage> in <soap:body>. So far, my web service runs
really fine.
But: I want to move the ClientCallMetaData into the soap:header-Section,
since it's not part of the business logic but technical metadata.
So this is what I did:
1. added an attribute inHeader="true" in my server-config.wsdd (in the
line <parameter name="clientCallMetaData" ... />)
2. changed call.addParameter(..) to call.addParameterAsHeader(..) on the
client side.
After compiling and deploying, I started my Client an got an error I
don't unterstand:
org.xml.sax.SAXException: Found instance data for clientCallMetaData in
the soap:body instead of the soap:header.
When using a network sniffer (ethereal) I found out that
clientCallMetaData is actually part of the header in the request as it's
supposed to be. So what does this error message mean? I have no idea
where to look for a mistake.
I hope I'm not talking to confused stuff here. If more information is
needed, please let me know.
Anybody got a hint for me?
Thanks in advance,
CU
Werner
PS: I'm not using a WSDL for now, but I attached the "operation" part of
the web service generated by calling http://..../CommonServer?wsdl,
which looks fine for me:
<wsdl:operation name="logMessage">
<wsdlsoap:operation soapAction="" />
<wsdl:input name="logMessageRequest">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.eon-is.com/namespaces/prs/1.0" parts="level
message" use="encoded" />
<wsdlsoap:header
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
message="impl:logMessageRequest"
namespace="http://www.eon-is.com/namespaces/prs/1.0/schedule/eon"
part="clientCallMetaData" use="encoded" />
</wsdl:input>
<wsdl:output name="logMessageResponse">
<wsdlsoap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.eon-is.com/namespaces/prs/1.0/schedule/eon"
use="encoded" />
</wsdl:output>
</wsdl:operation>