Erro na em cliente que acessa WebServices

4 respostas
luuu

Criei um cliente no NetBeans 6.0 para acessar um wsdl baseado em JAX-WS 2.1

Quando vou roda-lo eu pego a seguinte exceção.

com.sun.xml.ws.server.UnsupportedMediaException: Unsupported Content-Type: text/html Supported ones are: [text/xml]
        at com.sun.xml.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:130)
        at com.sun.xml.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:294)
        at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:173)
        at com.sun.xml.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:88)
        at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
        at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
        at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
        at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
        at com.sun.xml.ws.client.Stub.process(Stub.java:248)
        at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:134)
        at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:244)
        at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:224)
        at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:117)
        at $Proxy30.vif0146(Unknown Source)
        at Client.main(Client.java:10)

Alguem sabe o que pode ser?

4 Respostas

PatricMaffi

mude a versao da maquina virtual java de 1.6 para 1.5

nas propriedades do projetos em codigos fontes onde aparece a versao do jdk que vc ta usando

luuu

Aonde eu mudo?

é indo em propriedades do projeto e em baixo ali tem
formato codigo fonte/binario…
eu coloco jdk5 ?

se for isso ja testei e num deu certo

PatricMaffi

sim seria ali sim
qdo deu problema no meu com isso
ainda no netbeans 5.5 eu alterei a versao da jdk pra resolver isto

luuu

é parece q mudou o erro aqui, mas eu coloquei a jdk 6 , pq tava na jdk 5.

agora lança a seguinte exception.

com.sun.xml.ws.encoding.soap.DeserializationException: Failed to read a response: javax.xml.bind.UnmarshalException
 - with linked exception:
[javax.xml.stream.XMLStreamException: ParseError at [row,col]:[23,13]
Message: An invalid XML character (Unicode: 0x1) was found in the element content of the document.]
        at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:259)
        at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:224)
        at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:117)
        at $Proxy30.vif0146(Unknown Source)
        at Client.main(Client.java:10)
Caused by: javax.xml.bind.UnmarshalException
 - with linked exception:
[javax.xml.stream.XMLStreamException: ParseError at [row,col]:[23,13]
Message: An invalid XML character (Unicode: 0x1) was found in the element content of the document.]
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamException(UnmarshallerImpl.java:422)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:360)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:330)
        at com.sun.xml.ws.message.stream.StreamMessage.readPayloadAsJAXB(StreamMessage.java:217)
        at com.sun.xml.ws.fault.SOAPFaultBuilder.create(SOAPFaultBuilder.java:478)
        at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:253)
        ... 4 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[23,13]
Failed to read a response: javax.xml.bind.UnmarshalException
 - with linked exception:
[javax.xml.stream.XMLStreamException: ParseError at [row,col]:[23,13]
Message: An invalid XML character (Unicode: 0x1) was found in the element content of the document.]
Message: An invalid XML character (Unicode: 0x1) was found in the element content of the document.
        at com.sun.xml.stream.XMLReaderImpl.next(XMLReaderImpl.java:563)
        at com.sun.xml.ws.util.xml.XMLStreamReaderFilter.next(XMLStreamReaderFilter.java:92)
        at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:225)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:358)
        ... 8 more
Criado 13 de maio de 2008
Ultima resposta 13 de mai. de 2008
Respostas 4
Participantes 2