wsdl2java ant task and http basic Authentication

2006-09-26 Thread Olivier Mocquais RD-BIZZ

Hello,

I want to use the wsdl2java ant task to generate stubs and beans in 
order to write a client to a web service.
But the wsdl is protected by the http basic Authentication mecanism.(I 
know the username and password) and I can't access to the wsdl file with 
the wsdljava ant task.


   axis-wsdl2java output=src verbose=true serverSide=false 
url=${wsdl.url}

   mapping namespace=${namespace.mapping} package=ws /
   /axis-wsdl2java

How can I specifiy the username and password in the ant task ?

Thanks.

Olivier

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: wsdl2java ant task and http basic Authentication

2006-09-26 Thread Olivier Mocquais RD-BIZZ
yes, I can do that, but I want to automate this action with an ant task 
(wsdl2java)


VF wrote:

Hi Olivier,

Isnt it possible to download this wsdl file on local disc and then generate
stubs etc from local file?

-Original Message-
From: Olivier Mocquais RD-BIZZ [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 26, 2006 2:11 PM

To: axis-user@ws.apache.org
Subject: wsdl2java ant task and http basic Authentication

Hello,

I want to use the wsdl2java ant task to generate stubs and beans in 
order to write a client to a web service.
But the wsdl is protected by the http basic Authentication mecanism.(I 
know the username and password) and I can't access to the wsdl file with 
the wsdljava ant task.


axis-wsdl2java output=src verbose=true serverSide=false 
url=${wsdl.url}

mapping namespace=${namespace.mapping} package=ws /
/axis-wsdl2java

How can I specifiy the username and password in the ant task ?

Thanks.

Olivier

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Handlers and SOAPFaultException in Axis

2006-06-30 Thread Olivier Mocquais RD-BIZZ

Hi,

I have written an handler which implements the handleRequest et 
handleFault methods with Axis 1.2.1 and Jonas 4.6.6


In the handleRequest method, if I have a bad parameter in the request  I 
have to throw a SOAPFaultException


in the handleRequest method:
Detail detail = null;
detail = SOAPFactory.newInstance().createDetail();
detail.addChildElement( Stock Trade ).addTextNode( failed );
throw new SOAPFaultException(new QName( 
http://www.francetelecom.com/2006/int;, ServiceFailed ),
  action parameter 
is null,
  
http://www.francetelecom.com/2006/int/handler;,

  detail);

And according to the specifications, the handleFault method is called:
But in this method I don't want to send a SOAPFault but a SOAP Message 
with a custom element (Response) in the soap message;


In the handleFault method:
SOAPMessageContext messagectx = (SOAPMessageContext) context;
SOAPFactory factory = SOAPFactory.newInstance();  
MessageFactory mf = MessageFactory.newInstance();

SOAPMessage msg = mf.createMessage();
msg.getSOAPHeader().detachNode();
SOAPBody body = msg.getSOAPBody();
Name testName = factory.createName(TestResponse, test, 
http://www.francetelecom.com/2006/int;);  
SOAPBodyElement theBodyElement = body.addBodyElement(testName);

Name responseName = factory.createName(Reponse);
theBodyElement.addChildElement(responseName);
messagectx.setMessage(msg);

//For debugging
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
messagectx.getMessage().writeTo(outputStream);
logger.debug(outputStream.toString());

BUT:
the client receives a RemoteException and not the custom soap message 
with the TestResponse element that I have built in the handleFault method.


In the console, the soap message contains the custom element.
?xml version=1.0 encoding=utf-8?soapenv:Envelope 
xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; 
xmlns:xsd=http://www.w3.org/2001/XMLSchema; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;

soapenv:Body
test:TestResponse xmlns:test=http://www.francetelecom.com/2006/int;
 Reponse xmlns=/
/test:TestResponse
/soapenv:Body
/soapenv:Envelope
2006-06-29 14:47:42,905 : JonasHandler.onFault : *--* Fault

1/ How can I solve this problem ?
2/ Where the SOAPFaultException  exception has gone when I throw it ?

Thanks for your help.

Olivier

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Axis and multipart message

2006-06-07 Thread Olivier Mocquais RD-BIZZ

Hi,

I use Axis 1.2.1 with Jonas 4.6.6 and I have written a wsdl which 
describe an operation which receives in parameters a complex type and a 
binary file in attachment (with Multipart/*).


In the type definitions of the wsdl, I have defined this complexType:

xsd:complexType name=listeCRsType
  xsd:sequence
  xsd:element name=crs type=xsd:string/
  xsd:element name=idPJ type=xsd:string/
  /xsd:sequence
/xsd:complexType

In the operation section of the wsdl:
wsdl:operation name=testPastel4
   wsdl:input message=tns:testPastel4Request/
   wsdl:output message=tns:testPastel4Response/
/wsdl:operation

In the message section of the wsdl:
 wsdl:message name=testPastel4Request
wsdl:part name=notification4 type=tns:listeCRsType/
wsdl:part name=photoAttachment4 type=xsd:hexBinary/
 /wsdl:message

 wsdl:message name=testPastel4Response
wsdl:part name=clientidrep14 type=xsd:string/
wsdl:part name=clientidrep24 type=xsd:string/
 /wsdl:message

In the binding part of the wsdl file:
wsdl:operation name=testPastel4
   soap:operation 
soapAction=http://www.example.org/bot/testPastel/

   wsdl:input
  mime:multipartRelated
 mime:part
soap:body parts=notification4 use=literal/
 /mime:part
 mime:part
mime:content part=photoAttachment4 type=multipart/*/
 /mime:part
  /mime:multipartRelated
   /wsdl:input
   wsdl:output
  soap:body parts=clientidrep14 clientidrep24 use=literal/
   /wsdl:output
/wsdl:operation

I have written an implementation of the web service and I have used Axis 
client (version 1.2.1) to call it.


Inside the wsdd file:
operation name=testPastel4 qname=testPastel4 
soapAction=http://www.example.org/bot/testPastel; 
  parameter qname=notification4 type=ptns:listeCRsType 
xmlns:ptns=http://www.example.org/bot//
  parameter qname=photoAttachment4 type=ptns:Multipart 
xmlns:ptns=http://xml.apache.org/xml-soap/
  parameter qname=clientidrep14 type=ptns:string 
xmlns:ptns=http://www.w3.org/2001/XMLSchema; mode=OUT/
  parameter qname=clientidrep24 type=ptns:string 
xmlns:ptns=http://www.w3.org/2001/XMLSchema; mode=OUT/

/operation

But I have an exception:
faultstringorg.xml.sax.SAXException: Invalid element in 
com.ws.ListeCRsType - notification4/faultstring

 detail
  ns1:stackTrace 
xmlns:ns1=http://xml.apache.org/axis/;org.xml.sax.SAXException: 
Invalid element in com.ws.ListeCRsType - notification4
  at 
org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:258) 

  at 
org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035) 

  at 
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165) 



?xml version=1.0 encoding=UTF-8?
soapenv:Envelope 
xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; 
xmlns:xsd=http://www.w3.org/2001/XMLSchema; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;

  soapenv:Body
  testPastel4 xmlns=
  notification4
  crscrs1/crs
  idPJidpj1/idPJ
  /notification4
  photoAttachment4 href=cid:FF6A8F5B2F3C6D0BC8FA703BEF84A2D2/
  /testPastel4
  /soapenv:Body
/soapenv:Envelope

I have used the XML Spy SOAP client which has generated a sample soap 
message and sent it to the web service, and it works:


SOAP-ENV:Envelope 
xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/; 
xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xmlns:xsd=http://www.w3.org/2001/XMLSchema;

  SOAP-ENV:Body
  crscrs1/crs
  idPJidpj1/idPJ
photoAttachment4 href=cid:FF6A8F5B2F3C6D0BC8FA703BEF84A2D2/
  /SOAP-ENV:Body
/SOAP-ENV:Envelope

The difference between the 2 messages is that Axis adds an 
notification4 element corresponding to the name of the first part.


1/ Which soapmessage is correct ? Which implementatio is correct ?
2/ Have you any information about this subject ?
3/ If the input message of the operation has 2 parts, why Axis adds an 
element with the name of the part and encapsulates datas ?


Thanks for your help.

Olivier


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[Axis2] - WSDL2Java - csharp option

2006-05-04 Thread Olivier Mocquais RD-BIZZ

Hi,

I have just downloaded Axis 2 version 0.95.

I have tried to generate a web service with the -l csharp option of 
WSDL2Java from a wsdl, but I have this exception:


Exception in thread main 
org.apache.axis2.wsdl.codegen.CodeGenerationException: 
java.lang.Exception: Emitter class not found!
   at 
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:146)

   at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
   at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
Caused by: java.lang.Exception: Emitter class not found!
   at 
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:123)


Command Line: WSDL2Java.bat -uri gestionClientPojo.wsdl -ss -sd -l 
csharp -o C:\webservice


Does this option work ?

Thanks.

Olivier


Wsdl2java and array generation

2006-03-09 Thread Olivier Mocquais RD-BIZZ

Hi,

I have a question about wsdl2java ant task of Axis

I have specified a complex type in a WSDL and used the wsdl2java to 
generate the java class.


?xml version=1.0 encoding=UTF-8?
xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema; 
elementFormDefault=qualified attributeFormDefault=unqualified

   xs:element name=intervention
   xs:annotation
   xs:documentationComment describing your root 
element/xs:documentation

   /xs:annotation
   xs:complexType
   xs:sequence minOccurs=1 maxOccurs=unbounded
   xs:element name=bloc
   xs:complexType
   xs:sequence maxOccurs=unbounded
   xs:element name=item
   xs:complexType
   xs:attribute name=valeur 
use=required/
   xs:attribute name=libelle 
use=required/

   /xs:complexType
   /xs:element
   /xs:sequence
   xs:attribute name=valeur/
   xs:attribute name=libelle use=required/
   /xs:complexType
   /xs:element
   /xs:sequence
   /xs:complexType
   /xs:element
/xs:schema

And after the generation, I have:
public class Intervention  implements java.io.Serializable {
   private generated.InterventionBloc bloc;
   public Intervention() {}
... }

But I wanted a array of generated.InterventionBloc as I have specified 
in the xml schema (with maxOccurs=unbounded)

private generated.InterventionBloc[] bloc;

Why it doesn't work ?

Thanks.

Olivier


Re: Send Attachment with SAAJ

2005-10-26 Thread Olivier Mocquais RD-BIZZ

MOCQUAIS Olivier RD-BIZZ wrote:


Hi,

I want to send an attachment a file with SAAJ (in the server side).

org.apache.axis.MessageContext context = 
org.apache.axis.MessageContext.getCurrentContext();

javax.xml.soap.SOAPMessage message = context.getResponseMessage();
javax.xml.soap.AttachmentPart ap = message.createAttachmentPart();
ap.setContent(XXX, application/xml);
message.addAttachmentPart(ap);

It works, but it uses the org.apache.axis.MessageContext class and the 
getResponseMessage() and getCurrentContext() methods.


And I don't want to use this class and I want to use classes from 
specification (SAAJ or JAX-RPC).


How can I do this ?

Thanks.

Olivier


I have read some documentations about SAAJ, and I found this lines: (it 
creates a new SOAP Message)

SOAPConnectionFactory spConFactory =SOAPConnectionFactory.newInstance();
SOAPConnection con = spConFactory.createConnection();
SOAPFactory soapFactory = SOAPFactory.newInstance();
SOAPMessage message = factory.createMessage();

But how can I send this new message to Axis ?


Send Attachment with SAAJ

2005-10-25 Thread Olivier Mocquais RD-BIZZ

Hi,

I want to send an attachment a file with SAAJ (in the server side).

org.apache.axis.MessageContext context = 
org.apache.axis.MessageContext.getCurrentContext();

javax.xml.soap.SOAPMessage message = context.getResponseMessage();
javax.xml.soap.AttachmentPart ap = message.createAttachmentPart();
ap.setContent(XXX, application/xml);
message.addAttachmentPart(ap);

It works, but it uses the org.apache.axis.MessageContext class and the 
getResponseMessage() and getCurrentContext() methods.


And I don't want to use this class and I want to use classes from 
specification (SAAJ or JAX-RPC).


How can I do this ?

Thanks.

Olivier




Java2wsdl deploy option: generate wsdd file

2005-03-23 Thread Olivier Mocquais RD-BIZZ
Hi all,
In a comment of the AXIS-1898 in JIRA, dims says: check latest cvs, 
java2wsdl has a deploy option that can create the wsdd's as well.

Where can I find some documentation about this task and this new option 
? Will it be included in the next release of Axis ?
Do I still have to use the wsdl2java task after the java2wsdl in order 
to expose a class as a web service ?

Thanks.
Olivier