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 Shaoguang Cong <sc...@yahoo.com> on 2006/02/14 19:15:05 UTC

Re: SOAP:Header question - how wsdl2java or java2wsdl handle the soap header part

I have read an email chain betwen Tysnes Are Thobias, Terance Dias and Anne Thomas Manes on 2005-10-25, discussing the SOAP Header question. That'll answer George's question.  I've added some new questions on the same issue below. 
   
  I run into two problems with Axis1.3 wsdl2java.  The first problem is the same as the one discussed by Anne etc.  Anne provided a solution that is to define the input message with two parts.  That's the same as an example given in the Axis 1.3 package.  I tried it too. The WSDL2Java will generate the client stub with the soap header part being part of the method signature.  That solution won't solve my problem because 1) it looks strange to have the soap header as part of the method signature. 2) the WSDL defined that way isn't using the "wrapped" document/literal style and it isn't WS-I compliant either.
   
  Our client is .NET where interoperability is critical.  So we need to make sure the WSDLs we defined are WS-I compliant.  
   
  The second problem with using Axis1.3 wsdl2java is sometimes it's unpredictable. I added an annotation/documentation tag to a complex type, that makes the generator somehow switched from"wrapped" to "non-wrapped" style in the generated code.  
   
  I wonder if these are something that Axis 1.3 doesn't support, and will these be taken into consideration in new versions of Axis?
   
  Thanks.
  Shaoguang
   
  p.s. For George, you can search the mailing list archive to find the email chain mentioned.  Try keyword "SAOP:Header question". 
  
Sueveges Gyoergy <ge...@etixpert.com> wrote:
  Hi all,

I'm now testing how axis works. I need a session based web service, so I 
test the SimpleSessionHandler.
On the API site it is written, that it will check if there is a header 
with session_id, and when there is not, then is creates a session. So I 
would except that in the generated wsdl 
(http://localhost:8085/axis/services/ZagreusService?wsdl) there is a soap 
header info in the bining section. So now how will the WSDL2Java know how 
to create such a client that creates soap header with sessionid when 
sending request? Do I imagine the things in wrong way?
Or Is it not a suggested way to create wsdl from the server classes, and 
then to create the client from wsdl?

I deployed my test Servie on the server side with the following wsdd:


xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">



type="java:com.etixpert.zagreus.server.axis.SOAPMonitor"/>
type="java:org.apache.axis.handlers.SimpleSessionHandler"/>


type="java:org.apache.axis.handlers.SimpleSessionHandler"/>
type="java:com.etixpert.zagreus.server.axis.SOAPMonitor"/>


value="com.etixpert.zagreus.server.axis.TestService"/>






I have the following TestService:

package com.etixpert.zagreus.server.axis;

import org.apache.axis.transport.http.*;
import org.apache.axis.handlers.SimpleSessionHandler;
import org.apache.axis.session.*;
import org.apache.axis.*;
import java.util.*;


public class TestService {

public String test(String param) { 
MessageContext context = MessageContext.getCurrentContext();
Session session = context.getSession();

......

}

public void login(String user, String password) throws AxisFault {
....

}
}

Generated wsdl. where there is no header info:


targetNamespace="http://localhost:8085/axis/services/ZagreusService"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://localhost:8085/axis/services/ZagreusService"
xmlns:intf="http://localhost:8085/axis/services/ZagreusService"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
Built on Oct 05, 2005 (05:23:37 EDT)-->















































transport="http://schemas.xmlsoap.org/soap/http"/>







encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://axis.server.zagreus.etixpert.com" use="encoded"/>





encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://localhost:8085/axis/services/ZagreusService" 
use="encoded"/>











encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://axis.server.zagreus.etixpert.com" use="encoded"/>





encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://localhost:8085/axis/services/ZagreusService" 
use="encoded"/>









name="ZagreusService">

location="http://localhost:8085/axis/services/ZagreusService"/>








Thnx for the help
George


-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/


		
---------------------------------
 Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and used cars.