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 sean curtis <se...@yahoo.com> on 2006/11/11 05:19:13 UTC

SOAPHeader, SOAPBody, wsdl2java, and compiled code question

Im trying to get an example working where I define
message structures within my schema element in wsdl
for both header and body messages.

Im using JIBX as a data binding tool between my domain
types and the message being passed as request/response
data structures. My question is the following:

by declaring my binding type as follows:

<wsdl:operation name="authenticate">
   <soap:operation soapAction="mynamespace/myaction"
/>
	<wsdl:input>
	<soap:header
part="request_header"message="tns:authHeaders"
use="literal"/> 
	<soap:body use="literal" />
	</wsdl:input>
	<wsdl:output>
	<soap:body use="literal" />
	</wsdl:output>
</wsdl:operation>

It seems like since Im referencing another element on
my schema to define what is in my SOAPHeader block,
that jibx needs to find a mapping in my binding file
to match.

The thing thats confusing is that this element
theoretically shouldnt necessarily get to my skeleton,
and more likely handled within a Handler that I define
in, say, an "authentication" phase within the axis2
stack.

Can someone give me any advice as to how they did it?
Do I just leave my header definition out of my schema
and messages and compile my skeleton/stub code with
what only SOAPBody elements? I included my wsdl and
binding in an earlier post just in case it helps
explain it any better.

On a side note, if I dont actually choose JIBX as my
binding mechanism and leave it to default to ADB, the
wsdl2java compiles fine but gives me methods where
both my header and body are passed to my skeleton.

Sean

Im ok with the fact


 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: SOAPHeader, SOAPBody, wsdl2java, and compiled code question

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
Hi Sean,

I haven't tested the JiBX handling for header parts, so there may be 
some problems in this area. What I'd expect to happen is that the header 
part element will be passed to JiBX for unmarshalling, and the 
unmarshalled object will then be passed to your service method. If you 
want to send what you're working with directly to me I'll take a look.

AFAIK there's no way to say in WSDL that you expect a header element to 
be present for an operation, but the header element doesn't actually 
serve as input to the operation. That seems to be what you're saying - 
that you want this header element to be processed by a handler and never 
seen by your service code. Maybe someone else can comment on this?

  - Dennis

sean curtis wrote:
> Im trying to get an example working where I define
> message structures within my schema element in wsdl
> for both header and body messages.
>
> Im using JIBX as a data binding tool between my domain
> types and the message being passed as request/response
> data structures. My question is the following:
>
> by declaring my binding type as follows:
>
> <wsdl:operation name="authenticate">
>    <soap:operation soapAction="mynamespace/myaction"
> />
> 	<wsdl:input>
> 	<soap:header
> part="request_header"message="tns:authHeaders"
> use="literal"/> 
> 	<soap:body use="literal" />
> 	</wsdl:input>
> 	<wsdl:output>
> 	<soap:body use="literal" />
> 	</wsdl:output>
> </wsdl:operation>
>
> It seems like since Im referencing another element on
> my schema to define what is in my SOAPHeader block,
> that jibx needs to find a mapping in my binding file
> to match.
>
> The thing thats confusing is that this element
> theoretically shouldnt necessarily get to my skeleton,
> and more likely handled within a Handler that I define
> in, say, an "authentication" phase within the axis2
> stack.
>
> Can someone give me any advice as to how they did it?
> Do I just leave my header definition out of my schema
> and messages and compile my skeleton/stub code with
> what only SOAPBody elements? I included my wsdl and
> binding in an earlier post just in case it helps
> explain it any better.
>
> On a side note, if I dont actually choose JIBX as my
> binding mechanism and leave it to default to ADB, the
> wsdl2java compiles fine but gives me methods where
> both my header and body are passed to my skeleton.
>
> Sean
>
> Im ok with the fact
>
>
>  
> ____________________________________________________________________________________
> Do you Yahoo!?
> Everyone is raving about the all-new Yahoo! Mail beta.
> http://new.mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: SOAPHeader, SOAPBody, wsdl2java, and compiled code question

Posted by Amila Suriarachchi <am...@gmail.com>.
As sosnoski has told this may not work correctly with the jibx. but with the
ADB it should should produce the correct method signatures for both stub and
skelton.
In fact I generated the code and checked. The header part is included only
with the stub.

skelton
public
com.bamnetworks.services.identity.types._1_0.EmailPasswordIdentifyResponse1authenticate
                  (

com.bamnetworks.services.identity.types._1_0.EmailPasswordIdentifyRequest2param3
                  )
            {

stub
public
com.bamnetworks.services.identity.types._1_0.EmailPasswordIdentifyResponse1authenticate(


com.bamnetworks.services.identity.types._1_0.EmailPasswordIdentifyRequest2param33,
com.bamnetworks.services.identity.types._1_0.AuthHeaders0 param34)
                    throws java.rmi.RemoteException

                    {

Re: SOAPHeader, SOAPBody, wsdl2java, and compiled code question

Posted by sean curtis <se...@yahoo.com>.
WSDL is attached, the WSDL2Java portion of my build
file excerpt is included below with options. The
skeleton  method signature is derived from the wsdl
via the WSDL2Java ant call, so since WSDL2Java is
actually breaking, I cant include that signature.

If you remove the binding option setting the mechanism
to jibx, it defaults to ADB and compiles.



<java classname="org.apache.axis2.wsdl.WSDL2Java"
fork="true">
	     
		<classpath>
	  	      <fileset dir="${axis2.shared.dir}">
	  	        <include name="**/*.*"/>
	  	      </fileset>
	  	      <fileset dir="${jibx.shared.dir}">
	  	        <include name="**/*.*"/>
	  	      </fileset>
	  	</classpath>
	  		
	  	  <arg value="-l"/>
	      <arg value="java"/>
	      <arg value="-d"/>
	      <arg value="jibx"/>
	  	  <arg value="-Ebindingfile"/>
	      <arg value="${binding.dir}/jibx/binding.xml"/>
	      <arg value="-uri"/>
	      <arg
file="${message-definition.dir}/wsdl/registration-extends-bam.wsdl"/>
	      <arg value="-ss"/>
	      <arg value="-sd"/>
	      <arg value="-s"/>
	      <arg value="-g"/>
	      <arg value="-ssi"/>
	      <arg value="-o"/>
	      <arg
file="${bam.project.tmp.dir}/wsdl2java-generated"/>
	   </java>
	  	
	</target>


--- Amila Suriarachchi <am...@gmail.com>
wrote:

> >
> >
> > On a side note, if I dont actually choose JIBX as
> my
> > binding mechanism and leave it to default to ADB,
> the
> > wsdl2java compiles fine but gives me methods where
> > both my header and body are passed to my skeleton.
> >
> > can  you please send the wsdl, skelton method
> signature and the command
> line options you use?
> 


 
____________________________________________________________________________________
Yahoo! Music Unlimited
Access over 1 million songs.
http://music.yahoo.com/unlimited

Re: SOAPHeader, SOAPBody, wsdl2java, and compiled code question

Posted by Amila Suriarachchi <am...@gmail.com>.
>
>
> On a side note, if I dont actually choose JIBX as my
> binding mechanism and leave it to default to ADB, the
> wsdl2java compiles fine but gives me methods where
> both my header and body are passed to my skeleton.
>
> can  you please send the wsdl, skelton method signature and the command
line options you use?