• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

JAX-WS TOP DOWN APPROACH

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I want a working example on developing a webservices using JAX-WS Top Down Approach.Actually I have an application which provides two webservices. For one of the webservices it deals with SAAJ. The request and response xml both contain SOAP attachment. The problem is that there is some error showing in both WSDL and XSD.

</complexType>
<xsd:complexType name="SimpleSwaType">
<xsd:sequence>
<xsd:element name="Attachment" type="wsi:swaRef"></xsd:element>
</xsd:sequence>
</xsd:complexType>

and prefix wsi is defined as
xmlns:wsi="http://ws-i.org/profiles/basic/1.1/xsd"

and Here is my Java class for the above complex type.

public class SimpleSwaType {

@XmlElement(name = "Attachment", required = true, type = String.class)
@XmlAttachmentRef
protected DataHandler attachment;

/**
* Gets the value of the attachment property.
*
* @return possible object is {@link String }
*
*/
public DataHandler getAttachment() {
return attachment;
}

/**
* Sets the value of the attachment property.
*
* @param value
* allowed object is {@link String }
*
*/
public void setAttachment(DataHandler value) {
this.attachment = value;
}

}

The error throwing at highlighted line and The error throwing is "src-resolve : Cannot resolve the name 'wsi:swaRef' to a(n) 'type definition' component."

Please help.

Thanks in advance.

Regards,
sreeni.

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I have the same problem, with jaxws-rt 2.2.3 / Java5, except that for me the message was only a warning and the build finished successfully.

>[WARNING] src-resolve: Cannot resolve the name 'swaRef:swaRef' to a(n) 'type definition' component.

With Java6, a little more message in the console :

[WARNING] schema_reference.4: Failed to read schema document 'http://ws-i.org/pr
ofiles/basic/1.1/swaref.xsd', because 1) could not find the document; 2) the doc
ument could not be read; 3) the root element of the document is not <xsd:schema>


So here is a workaround I found : in my XSD attached to my WSDL, I changed :
<xs:import namespace="http://ws-i.org/profiles/basic/1.1/xsd" schemaLocation="http://ws-i.org/profiles/basic/1.1/swaref.xsd"/>
with
<xs:import namespace="http://ws-i.org/profiles/basic/1.1/xsd" schemaLocation="swaref.xsd"/>

after having downloaded http://ws-i.org/profiles/basic/1.1/xsd/swaref.xsd and put it in the directory of my WSDL.


However, it is a poor workaround, as it requires to modify the WSDL/XSD (what we should'nt have to do). I tried to use a catalog file (configuration of the jaxws-maven-plugin) : works for some WSDL, but not for all of them...

So questions for you :
- Do you access internet from your maven build ? Does it require a proxy configuration ?
- Do you use a catalog file ?
- Does the previous workaround is valid for you too ?


Thank you,







 
Nico Nicoo
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
'
 
Nico Nicoo
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
'
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic