You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Vivian Zhou <vi...@yahoo.com> on 2008/02/27 02:21:35 UTC
A wsdl2java problem -- node code generated for message soapHeader
Hi, All,
I am encountering a problem when generating java stub from a wsdl using wsdl2java. Basically, I have a binding in WSDL like this:
<binding name="Connection_Operations" type="tns:Connection_Operations">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="Logout">
<soap:operation soapAction="function=Logout"/>
<input>
<soap:body use="literal"/>
<soap:header message="tns:SecureConnection" part="session" use="literal">
</soap:header>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
And the operation is deinfed as this:
<operation name="Logout">
<input message="tns:Logout_Input"/>
<output message="tns:Logout_Output"/>
</operation>
The input message is deinfed as:
<message name="Logout_Input">
</message>
When I generated the java soap stub for the logout, it has no input parameter, so I have no way to set the soapHeader information. I will have to manually modify the code. Is this a known problem?
Thanks much in advance.
V.
Here is the method in the stub that wsdl2java generates for me:
public com.xxx.ResponseStatus logout() throws java.rmi.RemoteException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[2]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("function=Logout");
_call.setOperationStyle("document");
_call.setEncodingStyle(null);
_call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR, Boolean.FALSE);
_call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS, Boolean.FALSE);
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("", "Logout"));
setRequestHeaders(_call);
setAttachments(_call);
try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {});
if (_resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)_resp;
}
else {
extractAttachments(_call);
try {
return (com.xxx.ResponseStatus) _resp;
} catch (java.lang.Exception _exception) {
return (com.xxx.ResponseStatus) org.apache.axis.utils.JavaUtils.convert(_resp, com.xxx.ResponseStatus.class);
}
}
} catch (org.apache.axis.AxisFault axisFaultException) {
throw axisFaultException;
}
}
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ