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 Javier Kohen <jk...@users.sourceforge.net> on 2006/12/06 02:15:49 UTC

Messages with many parts

I'm trying to write the WSDL for an already existing web service that
requires including two elements as children of the Body element. The web
service uses SOAP and expects the request's body in the form
<soap:Body><ElementA xmlns="mynamespace">content</ElementA><ElementB
xmlns="mynamespace">content</ElementB></soap:Body>

As I'm using Axis on the client side, I'd like to know what
Axis-compatible construction I can use to generate the above message.
I have tried many options with Axis 1.4 and Axis2 1.1, to no avail. The
best I could achieve was to have both elements inside a wrapper element,
but the web service rejects that. I'd like to start moving my codebase
to Axis2 now that 1.1 seems to be able to handle my other WDSLs
correctly, but I'm still using Axis 1.4 at the moment, so either is fine
with me.

In case you were wondering the server is using .Net and there's no way I
can have them change the definition. The WSDL itself is simply not
available, so I can't work from there either.

Thanks in advance,
-- 
Javier Kohen <jk...@users.sourceforge.net>
ICQ: blashyrkh #2361802
Jabber: jkohen@jabber.org

RE: Messages with many parts

Posted by Javier Kohen <jk...@users.sourceforge.net>.
El mié, 06-12-2006 a las 14:07 -0500, Bhatra, Junaid escribió:
> If you have the WSDL you can certainly try WSDL2Java (Axis 1.x or Axis2) and check if it handles this for you. I don't know if it can, so you will have to try it out. Even though you are writing the WSDL, it has to be consistent w/ the SOAP messages that your web service expects (input messages w/ more than 1 part for doc/literal style), so you don't have much leeway in authoring the WSDL. 

That's what my original message is about... I am trying to write the
WSDL so that Axis produces the result I need. So far my attempts haven't
been successful, so I'm pleading here for help.

> > -----Original Message-----
> > From: Javier Kohen [mailto:jkohen@users.sourceforge.net] 
> > Sent: Tuesday, December 05, 2006 8:16 PM
> > To: axis-user@ws.apache.org
> > Subject: Messages with many parts
> > 
> > I'm trying to write the WSDL for an already existing web service that
> > requires including two elements as children of the Body element. The web
> > service uses SOAP and expects the request's body in the form
> > <soap:Body><ElementA xmlns="mynamespace">content</ElementA><ElementB
> > xmlns="mynamespace">content</ElementB></soap:Body>
> > 
> > As I'm using Axis on the client side, I'd like to know what
> > Axis-compatible construction I can use to generate the above message.
> > I have tried many options with Axis 1.4 and Axis2 1.1, to no avail. The
> > best I could achieve was to have both elements inside a wrapper element,
> > but the web service rejects that. I'd like to start moving my codebase
> > to Axis2 now that 1.1 seems to be able to handle my other WDSLs
> > correctly, but I'm still using Axis 1.4 at the moment, so either is fine
> > with me.
> > 
> > In case you were wondering the server is using .Net and there's no way I
> > can have them change the definition. The WSDL itself is simply not
> > available, so I can't work from there either.
> > 
> > Thanks in advance,
-- 
Javier Kohen <jk...@users.sourceforge.net>
ICQ: blashyrkh #2361802
Jabber: jkohen@jabber.org

RE: Messages with many parts

Posted by "Bhatra, Junaid" <jb...@rsasecurity.com>.
If you have the WSDL you can certainly try WSDL2Java (Axis 1.x or Axis2) and check if it handles this for you. I don't know if it can, so you will have to try it out. Even though you are writing the WSDL, it has to be consistent w/ the SOAP messages that your web service expects (input messages w/ more than 1 part for doc/literal style), so you don't have much leeway in authoring the WSDL. 

- Junaid

-----Original Message-----
From: Javier Kohen [mailto:jkohen@users.sourceforge.net] 
Sent: Wednesday, December 06, 2006 1:23 PM
To: axis-user@ws.apache.org
Subject: RE: Messages with many parts

El mié, 06-12-2006 a las 10:53 -0500, Bhatra, Junaid escribió:
> In Axis 1.x, you can try using the Call interface passing it an array of
> org.apache.axis.message.SOAPBodyElement as parameter. I believe this
> should generate the message that you require (multiple elements as
> children of SOAP Body). Of course you will have to manually create the
> message yourself as DOM Elements. Note that even though the SOAP/WSDL
> specs allow this, it is disallowed in the WS-I Basic profile.

I see... any chances of being able to use WSDL2Java from Axis or Axis2
instead? I'm writing the WSDL on top of the messages, so I have some
freedom in how I do it.

Thanks for your suggestion, it seems I'll end up following it.

> -----Original Message-----
> From: Javier Kohen [mailto:jkohen@users.sourceforge.net] 
> Sent: Tuesday, December 05, 2006 8:16 PM
> To: axis-user@ws.apache.org
> Subject: Messages with many parts
> 
> I'm trying to write the WSDL for an already existing web service that
> requires including two elements as children of the Body element. The web
> service uses SOAP and expects the request's body in the form
> <soap:Body><ElementA xmlns="mynamespace">content</ElementA><ElementB
> xmlns="mynamespace">content</ElementB></soap:Body>
> 
> As I'm using Axis on the client side, I'd like to know what
> Axis-compatible construction I can use to generate the above message.
> I have tried many options with Axis 1.4 and Axis2 1.1, to no avail. The
> best I could achieve was to have both elements inside a wrapper element,
> but the web service rejects that. I'd like to start moving my codebase
> to Axis2 now that 1.1 seems to be able to handle my other WDSLs
> correctly, but I'm still using Axis 1.4 at the moment, so either is fine
> with me.
> 
> In case you were wondering the server is using .Net and there's no way I
> can have them change the definition. The WSDL itself is simply not
> available, so I can't work from there either.
> 
> Thanks in advance,
-- 
Javier Kohen <jk...@users.sourceforge.net>
ICQ: blashyrkh #2361802
Jabber: jkohen@jabber.org

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


RE: Messages with many parts

Posted by Javier Kohen <jk...@users.sourceforge.net>.
El mié, 06-12-2006 a las 10:53 -0500, Bhatra, Junaid escribió:
> In Axis 1.x, you can try using the Call interface passing it an array of
> org.apache.axis.message.SOAPBodyElement as parameter. I believe this
> should generate the message that you require (multiple elements as
> children of SOAP Body). Of course you will have to manually create the
> message yourself as DOM Elements. Note that even though the SOAP/WSDL
> specs allow this, it is disallowed in the WS-I Basic profile.

I see... any chances of being able to use WSDL2Java from Axis or Axis2
instead? I'm writing the WSDL on top of the messages, so I have some
freedom in how I do it.

Thanks for your suggestion, it seems I'll end up following it.

> -----Original Message-----
> From: Javier Kohen [mailto:jkohen@users.sourceforge.net] 
> Sent: Tuesday, December 05, 2006 8:16 PM
> To: axis-user@ws.apache.org
> Subject: Messages with many parts
> 
> I'm trying to write the WSDL for an already existing web service that
> requires including two elements as children of the Body element. The web
> service uses SOAP and expects the request's body in the form
> <soap:Body><ElementA xmlns="mynamespace">content</ElementA><ElementB
> xmlns="mynamespace">content</ElementB></soap:Body>
> 
> As I'm using Axis on the client side, I'd like to know what
> Axis-compatible construction I can use to generate the above message.
> I have tried many options with Axis 1.4 and Axis2 1.1, to no avail. The
> best I could achieve was to have both elements inside a wrapper element,
> but the web service rejects that. I'd like to start moving my codebase
> to Axis2 now that 1.1 seems to be able to handle my other WDSLs
> correctly, but I'm still using Axis 1.4 at the moment, so either is fine
> with me.
> 
> In case you were wondering the server is using .Net and there's no way I
> can have them change the definition. The WSDL itself is simply not
> available, so I can't work from there either.
> 
> Thanks in advance,
-- 
Javier Kohen <jk...@users.sourceforge.net>
ICQ: blashyrkh #2361802
Jabber: jkohen@jabber.org

RE: Messages with many parts

Posted by "Bhatra, Junaid" <jb...@rsasecurity.com>.
In Axis 1.x, you can try using the Call interface passing it an array of
org.apache.axis.message.SOAPBodyElement as parameter. I believe this
should generate the message that you require (multiple elements as
children of SOAP Body). Of course you will have to manually create the
message yourself as DOM Elements. Note that even though the SOAP/WSDL
specs allow this, it is disallowed in the WS-I Basic profile.

Something like this might work:

Call call = ....
call.setProperty(Call.OPERATION_STYLE_PROPERTY, "document");
org.w3c.dom.Element[] elements = ....
SOAPBodyElement[] soapBodyElements = new
SOAPBodyElement[elements.length];
for(int j=0; j < elements.length; j++){
	soapBodyElements[j] = new SOAPBodyElement(elements[j]);
}
Vector ret = (Vector)call.invoke(soapBodyElements); //returns a Vector
of SOAPBodyElement.

- Junaid


-----Original Message-----
From: Javier Kohen [mailto:jkohen@users.sourceforge.net] 
Sent: Tuesday, December 05, 2006 8:16 PM
To: axis-user@ws.apache.org
Subject: Messages with many parts

I'm trying to write the WSDL for an already existing web service that
requires including two elements as children of the Body element. The web
service uses SOAP and expects the request's body in the form
<soap:Body><ElementA xmlns="mynamespace">content</ElementA><ElementB
xmlns="mynamespace">content</ElementB></soap:Body>

As I'm using Axis on the client side, I'd like to know what
Axis-compatible construction I can use to generate the above message.
I have tried many options with Axis 1.4 and Axis2 1.1, to no avail. The
best I could achieve was to have both elements inside a wrapper element,
but the web service rejects that. I'd like to start moving my codebase
to Axis2 now that 1.1 seems to be able to handle my other WDSLs
correctly, but I'm still using Axis 1.4 at the moment, so either is fine
with me.

In case you were wondering the server is using .Net and there's no way I
can have them change the definition. The WSDL itself is simply not
available, so I can't work from there either.

Thanks in advance,
-- 
Javier Kohen <jk...@users.sourceforge.net>
ICQ: blashyrkh #2361802
Jabber: jkohen@jabber.org

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