SwA and
jesla Aug 7, 2006 6:03 AMHi,
I am experimenting with SOAP with attachments and JSR-181 EJB endpoint. My endpoint deploys seemingly well with following metadata:
2006-08-07 12:01:57,593 DEBUG [org.jboss.ws.deployment.JSR181MetaDataBuilderEJB3] END buildMetaData: UnifiedMetaData: securityDomain: null ServiceMetaData: name={http://ejb.swa/jaws}SwaTestBeanService wsdName=null wsdlFile=META-INF/wsdl/SwaTestWsdl.wsdl jaxrpcFile=null publishLocation=null properties=null TypesMetaData: [complexType={http://www.w3.org/2005/05/xmlmime}base64Binary,javaType=java.awt.Image] ServerEndpointMetaData: name={http://ejb.swa/jaws}SwaTestBeanPort id=jboss.ws:context=swa,endpoint=SwaTestBean address=http://substanssi:8080/swa/SwaTestBean linkName=SwaTestBean implName=swa.ejb.SwaTestBean seiName=swa.ejb.SwaTestBean annotated=true portComponentName=null contextRoot=/swa urlPattern=/SwaTestBean configFile=null configName=null authMethod=null transportGuarantee=null properties=null OperationMetaData: xmlName={http://ejb.swa/jaws}sendImage javaName=sendImage style=rpc/literal oneWay=false soapAction= ParameterMetaData: xmlName=image xmlType={http://www.w3.org/2005/05/xmlmime}base64Binary javaType=java.awt.Image mode=IN inHeader=false
But when I send an image to the service I get the following warning and error:
2006-08-07 12:11:45,187 WARN [org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping] Cannot find jaxrpc-mapping for type: {http://www.w3.org/2005/05/xmlmime}base64Binary 2006-08-07 12:11:45,187 DEBUG [org.jboss.ws.jaxrpc.encoding.SerializationContextImpl] Add type mapping: [qname={http://www.w3.org/2005/05/xmlmime}base64Binary,javaType=javax.mail.internet.MimeMultipart,scope=complexType] 2006-08-07 12:11:45,187 WARN [org.jboss.ws.jaxb.SchemaBindingBuilder] Type definition not found in schema: {http://www.w3.org/2005/05/xmlmime}base64Binary 2006-08-07 12:11:45,187 WARN [org.jboss.ws.jaxb.SchemaBindingBuilder] Cannot obtain type binding for: {http://www.w3.org/2005/05/xmlmime}base64Binary 2006-08-07 12:11:45,187 DEBUG [javax.xml.rpc.soap.SOAPFaultException] new SOAPFaultException [code={http://schemas.xmlsoap.org/soap/envelope/}Client,string=Root type {http://www.w3.org/2005/05/xmlmime}base64Binary not found in the schema.,actor=null,detail=null] 2006-08-07 12:11:45,187 ERROR [org.jboss.ws.jaxrpc.SOAPFaultExceptionHelper] SOAP request exception org.jboss.ws.WSException: Root type {http://www.w3.org/2005/05/xmlmime}base64Binary not found in the schema. at org.jboss.ws.jaxb.SchemaBindingBuilder.bindParameterToElement(SchemaBindingBuilder.java:426) at org.jboss.ws.jaxb.JBossXBSupport.getOrCreateSchemaBinding(JBossXBSupport.java:72) at org.jboss.ws.jaxb.JBossXBUnmarshallerImpl.unmarshal(JBossXBUnmarshallerImpl.java:59) at org.jboss.ws.jaxrpc.encoding.JAXBDeserializer.deserialize(JAXBDeserializer.java:92) at org.jboss.ws.soap.SOAPContentElement.getObjectValue(SOAPContentElement.java:229) at org.jboss.ws.binding.EndpointInvocation.transformPayloadValue(EndpointInvocation.java:233) at org.jboss.ws.binding.EndpointInvocation.getRequestParamValue(EndpointInvocation.java:103) at org.jboss.ws.binding.EndpointInvocation.getRequestPayload(EndpointInvocation.java:117)
Does anyone have any idea, why the binding cannot be obtained ? I also wonder why do I get base64Binary as a xmlType (see metadata listing above) in a first place. After all, I've defined the data type as xsd:hexBinary (see wsdl below)?
Regards, Matti
Endpoint implementation:
package swa.ejb; import java.awt.Image; import javax.ejb.Stateless; import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebService; import javax.jws.soap.SOAPBinding; import javax.jws.soap.SOAPBinding.Style; import org.apache.log4j.Logger; @Stateless @WebService(wsdlLocation="META-INF/wsdl/SwaTestWsdl.wsdl") @SOAPBinding(style=Style.RPC) public class SwaTestBean { static Logger log = Logger.getLogger(SwaTestBean.class); @WebMethod public void sendImage(@WebParam(name="image") Image image) { log.info("sendImage..."); } }
wsdl file:
<definitions name='SwaTestBeanService' targetNamespace='http://ejb.swa/jaws' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://ejb.swa/jaws' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:mime='http://schemas.xmlsoap.org/wsdl/mime/'> <types/> <message name='SwaTestBean_sendImageResponse' /> <message name='SwaTestBean_sendImage'> <part name='image' type='xsd:hexBinary' /> </message> <portType name='SwaTestBean'> <operation name='sendImage'> <input message='tns:SwaTestBean_sendImage' /> <output message='tns:SwaTestBean_sendImageResponse' /> </operation> </portType> <binding name='SwaTestBeanBinding' type='tns:SwaTestBean'> <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http' /> <operation name='sendImage'> <soap:operation soapAction='' /> <input> <mime:multipartRelated> <mime:part> <soap:body use="literal" /> </mime:part> <mime:part> <mime:content part="image" type="image/jpeg" /> </mime:part> </mime:multipartRelated> </input> <output> <soap:body use='literal' /> </output> </operation> </binding> <service name='SwaTestBeanService'> <port binding='tns:SwaTestBeanBinding' name='SwaTestBeanPort'> <soap:address location='http://substanssi:8080/swa/SwaTestBean' /> </port> </service> </definitions>