[jboss-user] [JBossWS] - Re: Exception while deploying a webservice with attachment (

mnsharif do-not-reply at jboss.com
Tue Nov 14 13:58:37 EST 2006


Yeah, the generated jaxrpc-mapping.xml does have <param-type>java.lang.String</param-type> and Yes, i do have .... type='xsd:string'/> like thing in my part definitions in WSDL. But that is there for a reason, which i will try to explain.


As a matter of fact, wscompile does not allow to have primitive types (like xsd:string etc) to be specified like following:
<message name = "methodName">
  |     <part name = "paraName" element = "xsd:string"/>
  | </message>
If used, wscompile gives error and skips mapping for this method. Please note that this behavior is peculiar to document based web wervices _only_ (this is allowed in rpc style). So, in document based services, i have to wrap these primitive types in wrapper types like this
<message name = "methodName">
  |     <part name = "paraName" element = "ns2:wrapperString"/>
  | </message>
and then, combination of following fragment in types section of the WSDL gives me the equavilent desired effect.
<complexType name = "wrapperStringType">
  |     <sequence>
  |         <element
  |             name = "parameterOne"
  |             type = "string"
  |             nillable = "true"/>
  |     </sequence>
  | </complexType>
  | <element name = "wrapperString" type = "tns:wrapperStringType"/>
  | 



Now everything is fine with attachment-less webservices. But for the web-service where i need attachment support, the message _has_ to be defined as 
<message name = "methodWithAttachment">
  |     <part name = "paraName" element = "ns2:wrapperString"/>
  |     <part name = "attachmentContents" type = "xsd:string"/>
  | </message>
Interestingly enough, the wscompile tool does _not_ show any error/warning while generating mapping. The attachmentContents above is my parameter defined in mime:content (which happens to be of type text/plain), so that could be the possible reason of wscompile staying silent on this part being specified as xsd:string.

But at deployment time i get the following warning and then exception (as i mentioned in my first post):
anonymous wrote : 22:11:09,354 WARN  [JavaWsdlMapping] Cannot find jaxrpc-mapping for type: {http://www.w3.org/2001/XMLSchema}string
  | 22:11:09,354 ERROR [MainDeployer] Could not create deployment: file:/D:/jboss-4.0.4.GA/server/default/deploy/alhamd.war
  | org.jboss.ws.WSException: Cannot obtain java/xml type mapping for: {http://www.w3.org/2001/XMLSchema}string
  |         at org.jboss.ws.deployment.JSR109MetaDataBuilder.buildParameterMetaDataDoc(JSR109MetaDataBuilder.java:513)
  | 


Phew! No wonder, writing this all down is more difficult than explaining on face.


mnsharif

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3985912#3985912

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3985912



More information about the jboss-user mailing list