Wrapped service wsdl does not generate wrapper classes

2005-05-04 Thread Schwarz, Karl
Hi,

I am having trouble with a wrapped service definition. I've included the 
wsdl below. 

There are two issues I need some assistance with:

 1. The wrapper classes are not being generated. If I define the return 
type for both response messages(getCatalogAllResponse and 
getCatalogTypeResponse) as types:Catalog the wrapper classes are not 
generated. If I change the return type for the getCatalogTypeResponse to 
types:status, the wrapper classes GetCatalogAll and GetCatalogType are 
generated. My requirement is to return the Catalog type so I am stuck on this 
problem.

2. I also noticed that the return type Catalog is not used for the 
return type for the getCatalogAll method in the BindindImpl class generated for 
this service. The constituent parts of the Catalog type, namely count(long) 
and catalog(ArrayofCatalog) are returned via holder classes. If I abandon the 
use of the wrapper types and directly define the  type for the input request 
messages as types:CatalogReq and the return types for the response messages 
as types:Catalog, then the methods in the BindingImpl class are defined to 
return the Catalog type and no holder classes are used.

Any insights to my problems would be welcomed.

regards
Karl Schwarz

Here is the wsdl(this version generates the wrapper classes): 

wsdl:definitions name=CatalogService
  targetNamespace=http://examples.com/CatalogService;
  xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/;
  xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/;
  xmlns:xsd=http://www.w3.org/2001/XMLSchema;
  xmlns:types=http://examples.com/CatalogService/types;
  xmlns:tns=http://examples.com/CatalogService;
wsdl:types

xsd:schema targetNamespace=http://examples.com/CatalogService/types;
   xmlns:types=http://examples.com/CatalogService/types;

xsd:element name=getCatalogAll
   xsd:complexType
  xsd:sequence
 xsd:element ref=types:CatalogReq/
  /xsd:sequence
   /xsd:complexType
/xsd:element

xsd:element name=getCatalogType
   xsd:complexType
  xsd:sequence
 xsd:element ref=types:CatalogReq/ 
  /xsd:sequence
   /xsd:complexType
/xsd:element

xsd:element name=CatalogReq
   xsd:complexType 
  xsd:sequence
  xsd:element name=catalog_id  nillable=true 
type=xsd:string/
  xsd:element name=product_type_id  type=xsd:long/
  xsd:element name=product_id  nillable=true 
type=xsd:string/
  xsd:element name=name  nillable=true type=xsd:string/
  xsd:element name=create_time  nillable=true 
type=xsd:string/
  xsd:element name=update_time  nillable=true 
type=xsd:string/
  xsd:element name=count type=xsd:long/
  xsd:element name=countOnly type=xsd:boolean/
  /xsd:sequence
   /xsd:complexType
 /xsd:element
  
 xsd:complexType name=CatalogInfo
  xsd:sequence
  xsd:element name=catalog_id nillable=true type=xsd:string/
  xsd:element name=product_type_id type=xsd:long/
  xsd:element name=product_id  nillable=true 
type=xsd:string/
  xsd:element name=name nillable=true  type=xsd:string/
  /xsd:sequence
   /xsd:complexType  

xsd:complexType name=ArrayOfCatalog
xsd:sequence
  xsd:element minOccurs =0 maxOccurs=unbounded name=entry 
type=types:CatalogInfo/
/xsd:sequence
/xsd:complexType

xsd:element name=Catalog
  xsd:complexType 
xsd:sequence
  xsd:element name=count type=xsd:long  maxOccurs = 1/  
  xsd:element name=catalog type=types:ArrayOfCatalog/
/xsd:sequence
  /xsd:complexType
/xsd:element
   
xsd:element name=status type=xsd:string /

  /xsd:schema
/wsdl:types

 

wsdl:message name=getCatalogAllRequest  
   wsdl:part name=body element=types:getCatalogAll/  
/wsdl:message
wsdl:message name=getCatalogAllResponse
   wsdl:part name=result element=types:Catalog/
/wsdl:message

wsdl:message name=getCatalogTypeRequest
   wsdl:part name=body element=types:getCatalogType/
/wsdl:message
wsdl:message name=getCatalogTypeResponse
  wsdl:part name=result element=types:status/
/wsdl:message



wsdl:portType name=CatalogServicePortType
  wsdl:operation name=getCatalogAll
wsdl:input message=tns:getCatalogAllRequest/
wsdl:output message=tns:getCatalogAllResponse/
  /wsdl:operation
  wsdl:operation name=getCatalogType
wsdl:input message=tns:getCatalogTypeRequest/
wsdl:output message=tns:getCatalogTypeResponse/
  /wsdl:operation
  
/wsdl:portType

wsdl:binding name=CatalogServiceBinding type=tns:CatalogServicePortType
  soap:binding style=document 
transport=http://schemas.xmlsoap.org/soap/http/
  wsdl:operation name=getCatalogAll
soap:operation soapAction=getCatalogAll/
wsdl:input 
  soap:body  use=literal/   
/wsdl:input
wsdl:output
  

RE: Wrapped service wsdl does not generate wrapper classes

2005-05-04 Thread Schwarz, Karl
Ann,

Your solution solved my second issue. Seems like my first issue is not a 
problem, my service is working without them.

thanks,
Karl

-Original Message-
From: Anne Thomas Manes [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 04, 2005 11:17 AM
To: axis-user@ws.apache.org
Subject: Re: Wrapped service wsdl does not generate wrapper classes


Karl,

When using wrapped your response wrapper element should provide a
container for your return element. So what you want to do is define
types:Catalog as a child of your two response elements. e.g.:

wsdl:message name=getCatalogAllResponse
  wsdl:part name=result element=types:getCatalogAllReturn/
/wsdl:message

xsd:element name=getCatalogAllReturn
  xsd:complexType
xsd:sequence
element ref=types:Catalog/
/xsd:sequence
  /xsd:complexType
/xsd:element

Regards,
Anne

On 5/4/05, Schwarz, Karl [EMAIL PROTECTED] wrote:
 Hi,
 
 I am having trouble with a wrapped service definition. I've included the 
 wsdl below.
 
 There are two issues I need some assistance with:
 
  1. The wrapper classes are not being generated. If I define the return 
 type for both response messages(getCatalogAllResponse and 
 getCatalogTypeResponse) as types:Catalog the wrapper classes are not 
 generated. If I change the return type for the getCatalogTypeResponse to 
 types:status, the wrapper classes GetCatalogAll and GetCatalogType are 
 generated. My requirement is to return the Catalog type so I am stuck on this 
 problem.
 
 2. I also noticed that the return type Catalog is not used for the 
 return type for the getCatalogAll method in the BindindImpl class generated 
 for this service. The constituent parts of the Catalog type, namely 
 count(long) and catalog(ArrayofCatalog) are returned via holder classes. If I 
 abandon the use of the wrapper types and directly define the  type for the 
 input request messages as types:CatalogReq and the return types for the 
 response messages as types:Catalog, then the methods in the BindingImpl 
 class are defined to return the Catalog type and no holder classes are used.
 
 Any insights to my problems would be welcomed.
 
 regards
 Karl Schwarz
 
 Here is the wsdl(this version generates the wrapper classes):
 
 wsdl:definitions name=CatalogService
   targetNamespace=http://examples.com/CatalogService;
   xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/;
   xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/;
   xmlns:xsd=http://www.w3.org/2001/XMLSchema;
   xmlns:types=http://examples.com/CatalogService/types;
   xmlns:tns=http://examples.com/CatalogService;
 wsdl:types
 
 xsd:schema targetNamespace=http://examples.com/CatalogService/types;
xmlns:types=http://examples.com/CatalogService/types;
 
 xsd:element name=getCatalogAll
xsd:complexType
   xsd:sequence
  xsd:element ref=types:CatalogReq/
   /xsd:sequence
/xsd:complexType
 /xsd:element
 
 xsd:element name=getCatalogType
xsd:complexType
   xsd:sequence
  xsd:element ref=types:CatalogReq/
   /xsd:sequence
/xsd:complexType
 /xsd:element
 
 xsd:element name=CatalogReq
xsd:complexType 
   xsd:sequence
   xsd:element name=catalog_id  nillable=true 
 type=xsd:string/
   xsd:element name=product_type_id  type=xsd:long/
   xsd:element name=product_id  nillable=true 
 type=xsd:string/
   xsd:element name=name  nillable=true type=xsd:string/
   xsd:element name=create_time  nillable=true 
 type=xsd:string/
   xsd:element name=update_time  nillable=true 
 type=xsd:string/
   xsd:element name=count type=xsd:long/
   xsd:element name=countOnly type=xsd:boolean/
   /xsd:sequence
/xsd:complexType
  /xsd:element
 
  xsd:complexType name=CatalogInfo
   xsd:sequence
   xsd:element name=catalog_id nillable=true 
 type=xsd:string/
   xsd:element name=product_type_id type=xsd:long/
   xsd:element name=product_id  nillable=true 
 type=xsd:string/
   xsd:element name=name nillable=true  type=xsd:string/
   /xsd:sequence
/xsd:complexType
 
 xsd:complexType name=ArrayOfCatalog
 xsd:sequence
   xsd:element minOccurs =0 maxOccurs=unbounded name=entry 
 type=types:CatalogInfo/
 /xsd:sequence
 /xsd:complexType
 
 xsd:element name=Catalog
   xsd:complexType 
 xsd:sequence
   xsd:element name=count type=xsd:long  maxOccurs = 1/
   xsd:element name=catalog type=types:ArrayOfCatalog/
 /xsd:sequence
   /xsd:complexType
 /xsd:element
 
 xsd:element name=status type=xsd:string /
 
   /xsd:schema
 /wsdl:types
 
 wsdl:message name=getCatalogAllRequest
wsdl:part name=body element=types:getCatalogAll/
 /wsdl:message
 wsdl:message name=getCatalogAllResponse
wsdl:part name=result

Resource has been deleted Exception while Processing Attachments

2005-04-28 Thread Schwarz, Karl
This problem has been reported before but I don't see any resolution. I am 
having a similar issue.

I have a service that accepts or sends a 
org.apache.axis.attachments.OctetStream.  Here are the method signatures from 
the stub:

public void addImage(com.examples.ImageService.types.ImageInfo imageInfo, 
org.apache.axis.attachments.OctetStream image, 
javax.xml.rpc.holders.StringHolder status, 
javax.xml.rpc.holders.LongHolder id) 

public void getImage(com.examples.ImageService.types.ImageInfo imageInfo, 
 javax.xml.rpc.holders.StringHolder status, 
 org.apache.axis.holders.OctetStreamHolder image)

I have a test client that is looping and invoking the addImage and getImage 
operations. After several loops I get the following exception:

java.io.IOException: Resource has been deleted.
at 
org.apache.axis.attachments.ManagedMemoryDataSource$Instream.init(ManagedMemoryDataSource.java:517)
at 
org.apache.axis.attachments.ManagedMemoryDataSource.getInputStream(ManagedMemoryDataSource.java:182)
at javax.activation.DataHandler.writeTo(DataHandler.java:287)
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1206)
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:707)
at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:256)
at com.sun.mail.handlers.multipart_mixed.writeTo(multipart_mixed.java:67)
at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:839)
at javax.activation.DataHandler.writeTo(DataHandler.java:295)
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1206)
at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1611)
at 
org.apache.axis.attachments.MimeUtils.writeToMultiPartStream(MimeUtils.java:202)
at 
org.apache.axis.attachments.AttachmentsImpl.writeContentToStream(AttachmentsImpl.java:461)
at org.apache.axis.Message.writeTo(Message.java:525)
at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:504)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:135)
at 
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2754)
at org.apache.axis.client.Call.invoke(Call.java:2737)
at org.apache.axis.client.Call.invoke(Call.java:2413)
at org.apache.axis.client.Call.invoke(Call.java:2336)
at org.apache.axis.client.Call.invoke(Call.java:1793)
at 
com.examples.ImageService.ImageryServiceBindingStub.getImage(ImageryServiceBindingStub.java:231)
at 
com.examples.ImageService.ImageryServicePortTypeProxy.getImage(ImageryServicePortTypeProxy.java:51)
at com.examples.ImageService.TestImageService.main(TestImageService.java:87)

If I remove the getImage invocation from the test client it runs without error. 
If I remove the addImage invocation I get the same error, again after just a 
few loops.

Any thoughts?

regards,
Karl


Serialization of gif image

2005-04-26 Thread Schwarz, Karl
Hi,

I've got a service defined that is transferring an java.awt.Image using SOAP 
with attachments.

Here is the WSDL:

wsdl:definitions name=ImageryService
targetNamespace=http://examples.com/ImageService;
xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/;
xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/;
xmlns:xsd=http://www.w3.org/2001/XMLSchema;
xmlns:types=http://examples.com/ImageService/types;
xmlns:mime=http://schemas.xmlsoap.org/wsdl/mime/;
xmlns:tns=http://examples.com/ImageService;
wsdl:types

!-- types namespace for this service --
xsd:schema targetNamespace=http://examples.com/ImageService/types;
xmlns:types=http://examples.com/ImageService/types;

!-- Wrapper elements to provide unique signatures for the operations --
xsd:element name=addImage
xsd:complexType
xsd:sequence
xsd:element ref=types:ImageInfo/
/xsd:sequence
/xsd:complexType
/xsd:element
xsd:element name=replaceImage
xsd:complexType
xsd:sequence
xsd:element ref=types:ImageInfo/
/xsd:sequence
/xsd:complexType
/xsd:element
xsd:element name=getImage
xsd:complexType
xsd:sequence
xsd:element ref=types:ImageInfo/
/xsd:sequence
/xsd:complexType
/xsd:element
xsd:element name=ImageInfo
xsd:complexType
xsd:sequence
xsd:element name=name type=xsd:string/
xsd:element name=id type=xsd:int/
xsd:element name=lat type=xsd:double/
xsd:element name=lon type=xsd:double/
xsd:element name=time type=xsd:dateTime/
/xsd:sequence
/xsd:complexType
/xsd:element
!-- Status return for the operations. --
xsd:element name=status type=xsd:string /
/xsd:schema
/wsdl:types



!-- Input for the operations. --
wsdl:message name=addImageRequest
!-- first part is the SOAP body --
wsdl:part name=body element=types:addImage/
!-- second part is the attachment --
wsdl:part name=image type=xsd:base64Binary/
/wsdl:message
wsdl:message name=addImageResponse
wsdl:part name=body element=types:status/
/wsdl:message

wsdl:message name=getImageRequest
!-- first part is the SOAP body --
wsdl:part name=body element=types:getImage/
/wsdl:message
wsdl:message name=getImageResponse
wsdl:part name=status element=types:status/
!-- second part is the attachment --
wsdl:part name=image type=xsd:base64Binary/
/wsdl:message


wsdl:message name=replaceImageRequest
wsdl:part name=body element=types:replaceImage/
wsdl:part name=newImage type=xsd:base64Binary/
/wsdl:message
wsdl:message name=replaceImageResponse
wsdl:part name=status element=types:status/
/wsdl:message
wsdl:portType name=ImageryServicePortType
wsdl:operation name=addImage
wsdl:input message=tns:addImageRequest/
wsdl:output message=tns:addImageResponse/
/wsdl:operation
wsdl:operation name=getImage
wsdl:input message=tns:getImageRequest/
wsdl:output message=tns:getImageResponse/
/wsdl:operation
wsdl:operation name=replaceImage
wsdl:input message=tns:replaceImageRequest/
wsdl:output message=tns:replaceImageResponse/
/wsdl:operation
/wsdl:portType
wsdl:binding name=ImageryServiceBinding type=tns:ImageryServicePortType
soap:binding style=wrapped transport=http://schemas.xmlsoap.org/soap/http/
wsdl:operation name=addImage
soap:operation soapAction=addImage/
wsdl:input
mime:multipartRelated
mime:part
soap:body parts=body use=literal/
/mime:part
mime:part
mime:content part=image type=image/gif/
/mime:part
/mime:multipartRelated
/wsdl:input
wsdl:output
soap:body use=literal/
/wsdl:output
/wsdl:operation
wsdl:operation name=getImage
soap:operation soapAction=getImage/
wsdl:input 
soap:body parts=body use=literal/
/wsdl:input
wsdl:output
mime:multipartRelated
mime:part
soap:body parts=status use=literal/
/mime:part
mime:part
mime:content part=image type=image/gif/
/mime:part
/mime:multipartRelated
/wsdl:output
/wsdl:operation
wsdl:operation name=replaceImage
soap:operation soapAction=replaceImage/
wsdl:input
mime:multipartRelated
mime:part
soap:body parts=body use=literal/
/mime:part
mime:part
mime:content part=newImage type=image/gif/
/mime:part
/mime:multipartRelated
/wsdl:input
wsdl:output
soap:body use=literal/
/wsdl:output
/wsdl:operation
/wsdl:binding
wsdl:service name=ImageryService
wsdl:port name=ImageryService binding=tns:ImageryServiceBinding
soap:address location=http://192.168.1.1:8080/axis/services/ImageryService/
/wsdl:port
/wsdl:service
/wsdl:definitions

It worked fine when the Image was of type image/jpeg (the wsdl defined the type 
as image/jpeg), but now that I am trying to send a gif image, I see that the 
client is still setting the Content-Type in the mime attachment to image/jpeg.

From what I can see from stepping through the 
org.apache.axis.encoding.ser.ImageDataHandlerSerialize.serialize() method, 
when the Data Handler is created the content type for the ImageDataSource() 
object is not specified and so it defaults to image/jpeg.

Have I missed something that will allow support for gif (or other 
content-types)? 

regards
Karl


RE: Example Wrapped/Literal WSDD file anyone ?

2005-04-26 Thread Schwarz, Karl
TImothy,

Here is one that I have used:

!-- Use this file to deploy some handlers/chains and services  --
!-- Two ways to do this:   --
!--   java org.apache.axis.client.AdminClient deploy.wsdd  --
!--  after the axis server is running  --
!-- or --
!--   java org.apache.axis.utils.Admin client|server deploy.wsdd   --
!--  from the same directory that the Axis engine runs --

deployment
xmlns=http://xml.apache.org/axis/wsdd/;
xmlns:java=http://xml.apache.org/axis/wsdd/providers/java;

  !-- Services from ImageryService WSDL service --

  service name=ImageryService provider=java:RPC style=wrapped 
use=literal
  parameter name=wsdlTargetNamespace 
value=http://examples.com/ImageService/
  parameter name=wsdlServiceElement value=ImageryService/
  parameter name=wsdlServicePort value=ImageryService/
  parameter name=sendMultiRefs value=false/
  parameter name=className 
value=com.examples.ImageService.ImageryServiceBindingSkeleton/
  parameter name=wsdlPortType value=ImageryServicePortType/
  parameter name=typeMappingVersion value=1.2/
  parameter name=allowedMethods value=*/

  typeMapping
xmlns:ns=http://examples.com/ImageService;
qname=ns:DataHandler
type=java:javax.activation.DataHandler

serializer=org.apache.axis.encoding.ser.JAFDataHandlerSerializerFactory

deserializer=org.apache.axis.encoding.ser.JAFDataHandlerDeserializerFactory
encodingStyle=
  /
  typeMapping
xmlns:ns=http://examples.com/ImageService/types;
qname=ns:ImageInfo
type=java:com.examples.ImageService.types.ImageInfo
serializer=org.apache.axis.encoding.ser.BeanSerializerFactory
deserializer=org.apache.axis.encoding.ser.BeanDeserializerFactory
encodingStyle=
  /
  typeMapping
xmlns:ns=http://examples.com/ImageService/types;
qname=ns:getImage
type=java:com.examples.ImageService.types.GetImage
serializer=org.apache.axis.encoding.ser.BeanSerializerFactory
deserializer=org.apache.axis.encoding.ser.BeanDeserializerFactory
encodingStyle=
  /
  typeMapping
xmlns:ns=http://examples.com/ImageService/types;
qname=ns:replaceImage
type=java:com.examples.ImageService.types.ReplaceImage
serializer=org.apache.axis.encoding.ser.BeanSerializerFactory
deserializer=org.apache.axis.encoding.ser.BeanDeserializerFactory
encodingStyle=
  /
  typeMapping
xmlns:ns=http://examples.com/ImageService/types;
qname=ns:addImage
type=java:com.examples.ImageService.types.AddImage
serializer=org.apache.axis.encoding.ser.BeanSerializerFactory
deserializer=org.apache.axis.encoding.ser.BeanDeserializerFactory
encodingStyle=
  /
  /service
/deployment

I am fairly new to this but it looks like yours is missing the attribute : 
provider=java:RPC


regards
Karl Schwarz

-Original Message-
From: Timothy Thorpe [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 26, 2005 7:03 AM
To: axis-user@ws.apache.org
Subject: Example Wrapped/Literal WSDD file anyone ?


Hello There

Does anyone have an example 'deploy.wsdd' file that deploys their AXIS web
service as 'wrapped/literal' that they could send me ?

I have an RPC/Encoded web service that I want to convert to Wrapped/Literal
but am struggling to get the WSDD right (it is attached) - the web service
deployed using this WSDD seems to still be accepting only RPC/Encoded
requests. 

Many Thanks,
Timothy Thorpe

Consultant Software Engineer



RE: Exception parsing complex data type

2005-04-26 Thread Schwarz, Karl
Got it to work...seems that the deploy.wsdd file created by Eclipse/WST didn't 
set style attribute to wrapped. When I set it manually, all is well.

Please note the last wsdl I provided didn't have the style set to wrapped, but 
it was with the copy I was using.

Sorry for the confusion

Ann, thanks for all your help

Karl

-Original Message-
From: Schwarz, Karl [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 19, 2005 7:53 AM
To: axis-user@ws.apache.org
Subject: RE: Exception parsing complex data type


Well I've tried a few different tracks and I am still left with the same 
original problem, that is an org.xml.sax.SAXException: Invalid element exception

The wsdl I am using is a follows:

wsdl:definitions name=PhotoCatalogService
  targetNamespace=http://examples.com/PhotoCatalog;
  xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/;
  xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/;
  xmlns:xsd=http://www.w3.org/2001/XMLSchema;
  xmlns:types=http://examples.com/PhotoCatalog/types;
  xmlns:mime=http://schemas.xmlsoap.org/wsdl/mime/;
  xmlns:tns=http://examples.com/PhotoCatalog;

wsdl:types


xsd:schema targetNamespace=http://examples.com/PhotoCatalog/types;
   xmlns:types=http://examples.com/PhotoCatalog/types;


!-- Wrapper elements to provide unique signatures for the addPhoto
and replacePhoto operations --
xsd:element name=addPhoto
   xsd:complexType
  xsd:sequence
 xsd:element ref=types:PhotoInfo/
  /xsd:sequence
   /xsd:complexType
/xsd:element
xsd:element name=replacePhoto
   xsd:complexType
  xsd:sequence
 xsd:element ref=types:PhotoInfo/
  /xsd:sequence
   /xsd:complexType
/xsd:element

!-- Output for the addPhoto and replacePhoto operations. --
xsd:element name=status type=xsd:string /

!-- Input for the addPhoto and replacePhoto operations. --
xsd:element name=PhotoInfo
   xsd:complexType
  xsd:sequence
 xsd:element name=customerName type=xsd:string/
 xsd:element name=photoID type=xsd:int/
 !--xsd:element name=photoRef type=wsi:swaRef/--
  /xsd:sequence
   /xsd:complexType
/xsd:element
  /xsd:schema
/wsdl:types

wsdl:message name=addPhotoRequest
  !-- first part is the SOAP body --
  wsdl:part name=body element=types:addPhoto/
  !-- second part is the attachment --
  wsdl:part name=photo type=xsd:base64Binary/
/wsdl:message

wsdl:message name=addPhotoResponse
  wsdl:part name=body element=types:status/
/wsdl:message

wsdl:message name=replacePhotoRequest
  wsdl:part name=body element=types:replacePhoto/
  wsdl:part name=newPhoto type=xsd:base64Binary/
/wsdl:message

wsdl:message name=replacePhotoResponse
  wsdl:part name=status element=types:status/
/wsdl:message

wsdl:portType name=PhotoCatalog
  wsdl:operation name=addPhoto
wsdl:input message=tns:addPhotoRequest/
wsdl:output message=tns:addPhotoResponse/
  /wsdl:operation
  wsdl:operation name=replacePhoto
wsdl:input message=tns:replacePhotoRequest/
wsdl:output message=tns:replacePhotoResponse/
  /wsdl:operation
/wsdl:portType

wsdl:binding name=PhotoCatalogBinding type=tns:PhotoCatalog
  soap:binding style=document
transport=http://schemas.xmlsoap.org/soap/http/
  wsdl:operation name=addPhoto
soap:operation soapAction=addPhoto/
wsdl:input
  mime:multipartRelated
mime:part
  soap:body parts=body use=literal/
/mime:part
mime:part
  mime:content part=photo type=image/jpeg/
/mime:part
  /mime:multipartRelated
/wsdl:input
wsdl:output
  soap:body use=literal/
/wsdl:output
  /wsdl:operation
  wsdl:operation name=replacePhoto
soap:operation soapAction=replacePhoto/
wsdl:input
  mime:multipartRelated
mime:part
  soap:body parts=body use=literal/
/mime:part
mime:part
  mime:content part=newPhoto type=image/jpeg/
/mime:part
  /mime:multipartRelated
/wsdl:input
wsdl:output
  soap:body use=literal/
/wsdl:output
  /wsdl:operation
/wsdl:binding
wsdl:service name=PhotoCatalogService
  wsdl:port name=PhotoCatalogPort binding=tns:PhotoCatalogBinding
soap:address 
location=http://192.168.1.100:8080/axis/services/PhotoCatalogPort/
  /wsdl:port
/wsdl:service
/wsdl:definitions

I removed the use of swaRef in accordance with 3.1.4.1 of WS-I Usage Scenarios 
for the WS-I Attachments Profile 1.0 (version 1.02 
http://www.ws-i.org/SampleApplications/UsageScenariosAP-1.02-MRD.pdf)


Has anyone successfully processed a SOAP with Attachments request using AXIS 
1-2RC3 and a wsdl like the one I have included.


Karl


RE: Exception parsing complex data type

2005-04-19 Thread Schwarz, Karl
Well I've tried a few different tracks and I am still left with the same 
original problem, that is an org.xml.sax.SAXException: Invalid element exception

The wsdl I am using is a follows:

wsdl:definitions name=PhotoCatalogService
  targetNamespace=http://examples.com/PhotoCatalog;
  xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/;
  xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/;
  xmlns:xsd=http://www.w3.org/2001/XMLSchema;
  xmlns:types=http://examples.com/PhotoCatalog/types;
  xmlns:mime=http://schemas.xmlsoap.org/wsdl/mime/;
  xmlns:tns=http://examples.com/PhotoCatalog;

wsdl:types


xsd:schema targetNamespace=http://examples.com/PhotoCatalog/types;
   xmlns:types=http://examples.com/PhotoCatalog/types;


!-- Wrapper elements to provide unique signatures for the addPhoto
and replacePhoto operations --
xsd:element name=addPhoto
   xsd:complexType
  xsd:sequence
 xsd:element ref=types:PhotoInfo/
  /xsd:sequence
   /xsd:complexType
/xsd:element
xsd:element name=replacePhoto
   xsd:complexType
  xsd:sequence
 xsd:element ref=types:PhotoInfo/
  /xsd:sequence
   /xsd:complexType
/xsd:element

!-- Output for the addPhoto and replacePhoto operations. --
xsd:element name=status type=xsd:string /

!-- Input for the addPhoto and replacePhoto operations. --
xsd:element name=PhotoInfo
   xsd:complexType
  xsd:sequence
 xsd:element name=customerName type=xsd:string/
 xsd:element name=photoID type=xsd:int/
 !--xsd:element name=photoRef type=wsi:swaRef/--
  /xsd:sequence
   /xsd:complexType
/xsd:element
  /xsd:schema
/wsdl:types

wsdl:message name=addPhotoRequest
  !-- first part is the SOAP body --
  wsdl:part name=body element=types:addPhoto/
  !-- second part is the attachment --
  wsdl:part name=photo type=xsd:base64Binary/
/wsdl:message

wsdl:message name=addPhotoResponse
  wsdl:part name=body element=types:status/
/wsdl:message

wsdl:message name=replacePhotoRequest
  wsdl:part name=body element=types:replacePhoto/
  wsdl:part name=newPhoto type=xsd:base64Binary/
/wsdl:message

wsdl:message name=replacePhotoResponse
  wsdl:part name=status element=types:status/
/wsdl:message

wsdl:portType name=PhotoCatalog
  wsdl:operation name=addPhoto
wsdl:input message=tns:addPhotoRequest/
wsdl:output message=tns:addPhotoResponse/
  /wsdl:operation
  wsdl:operation name=replacePhoto
wsdl:input message=tns:replacePhotoRequest/
wsdl:output message=tns:replacePhotoResponse/
  /wsdl:operation
/wsdl:portType

wsdl:binding name=PhotoCatalogBinding type=tns:PhotoCatalog
  soap:binding style=document
transport=http://schemas.xmlsoap.org/soap/http/
  wsdl:operation name=addPhoto
soap:operation soapAction=addPhoto/
wsdl:input
  mime:multipartRelated
mime:part
  soap:body parts=body use=literal/
/mime:part
mime:part
  mime:content part=photo type=image/jpeg/
/mime:part
  /mime:multipartRelated
/wsdl:input
wsdl:output
  soap:body use=literal/
/wsdl:output
  /wsdl:operation
  wsdl:operation name=replacePhoto
soap:operation soapAction=replacePhoto/
wsdl:input
  mime:multipartRelated
mime:part
  soap:body parts=body use=literal/
/mime:part
mime:part
  mime:content part=newPhoto type=image/jpeg/
/mime:part
  /mime:multipartRelated
/wsdl:input
wsdl:output
  soap:body use=literal/
/wsdl:output
  /wsdl:operation
/wsdl:binding
wsdl:service name=PhotoCatalogService
  wsdl:port name=PhotoCatalogPort binding=tns:PhotoCatalogBinding
soap:address 
location=http://192.168.1.100:8080/axis/services/PhotoCatalogPort/
  /wsdl:port
/wsdl:service
/wsdl:definitions

I removed the use of swaRef in accordance with 3.1.4.1 of WS-I Usage Scenarios 
for the WS-I Attachments Profile 1.0 (version 1.02 
http://www.ws-i.org/SampleApplications/UsageScenariosAP-1.02-MRD.pdf)


Has anyone successfully processed a SOAP with Attachments request using AXIS 
1-2RC3 and a wsdl like the one I have included.


Karl


RE: Exception parsing complex data type

2005-04-18 Thread Schwarz, Karl
Anne,

I got past the Non nillable element 'photoRef' is null exception by placing a 
dummy URI into the PhotoInfo object, probably not the right approach but I 
wanted to get to the point where I can actually send the SOAP request to the 
updated service.  I've rebuilt the service with the new wsdl you suggested. 
Unfortunately I am getting the same Invalid element exception as originally 
reported. The SOAP package sent from client to server looks as before (with the 
exception of the additional photoRef element.

I am not sure that I am approaching this correctly. Can I use the wsdl approach 
with the latest release of AXIS to define a service that processing a SOAP with 
attachment message? Or am I too early in the AXIS development cycle? The 
samples included in the AXIS release don't seem to be using a wsdl at all. 

What is the recommended approach, given the current state of AXIS?


regards,
Karl

-Original Message-
From: Schwarz, Karl [mailto:[EMAIL PROTECTED]
Sent: Monday, April 18, 2005 7:31 AM
To: axis-user@ws.apache.org; Anne Thomas Manes
Subject: RE: Exception parsing complex data type


Anne,

Thanks for the help. I still have a few questions

1. I am sure that I would have never come up with the idea to define wrapper 
elements for addPhoto and replacePhoto operations. Do you have any links to 
reference material that describes this need.

2. I rebuilt my client side with the new wsdl and get the following exception:

   Non nillable element 'photoRef' is null

This really doesn't surprise me since I took no steps in any code to set the 
photoRef element. So here's my question. Does one need to modify the addPhoto 
method in the xxxBindingStub class to expicity add the photo as a mime 
attachment part to the org.apache.axis.client.Call obect. What is then passed 
to the _call.invoke method? Do you just pass the 
com.examples.PhotoCatalog.types.PhotoInfo object and omit the image object 
since the attachment has already been added.

I'm including the code snippet for the addPhoto method from xxxBindingStub 
class for reference

public javax.xml.transform.Source 
addPhoto(com.examples.PhotoCatalog.types.PhotoInfo oldPhoto, java.awt.Image 
photo) throws java.rmi.RemoteException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[0]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI();
_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(, addPhoto));

setRequestHeaders(_call);
setAttachments(_call);
 try {java.lang.Object _resp = _call.invoke(new java.lang.Object[] 
{oldPhoto, photo});

if (_resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)_resp;
}
else {
extractAttachments(_call);
try {
return (javax.xml.transform.Source) _resp;
} catch (java.lang.Exception _exception) {
return (javax.xml.transform.Source) 
org.apache.axis.utils.JavaUtils.convert(_resp, java.lang.String.class);
}
}
  } catch (org.apache.axis.AxisFault axisFaultException) {
  throw axisFaultException;



regards
Karl


-Original Message-
From: Anne Thomas Manes [mailto:[EMAIL PROTECTED]
Sent: Friday, April 15, 2005 2:24 PM
To: axis-user@ws.apache.org
Subject: Re: Exception parsing complex data type


It turns out your WSDL isn't valid. 

Tell me if this is correct:: 

For the addPhoto operation, you want to pass in 
- the customer name (string)
- a photo ID (int)
- a photo (as an attachment)

And you want to get in return
- status (string) (currently you're trying to return this as an
attachment, but I think you want to return it in the SOAP Body)

For the replacePhoto operation, you want to pass in
- the customer name (string)
- a photo ID (int)
- a photo (as an attachment)

And you want to get in return
- status (string) (currently you have this defined as
type=wsi:swaRef, which doesn't make sense here. I assume that you
want this to be a string returned in the SOAP Body)

If that's the case, then here's a corrected WSDL:

wsdl:definitions name=PhotoCatalogService
  targetNamespace=http://examples.com/PhotoCatalog;
  xmlns:wsdl=http://schemas.xmlsoap.org/wsdl/;
  xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/;
  xmlns:xsd=http://www.w3.org/2001/XMLSchema;
  xmlns:types=http://examples.com/PhotoCatalog/types;
  xmlns:mime=http://schemas.xmlsoap.org/wsdl/mime/;
  xmlns:tns=http://examples.com/PhotoCatalog;

wsdl:types
!-- ws-i schema --
  xsd:schema